如何控制AIX中目录的ftp访问权限

 我来答
greystar_cn
推荐于2016-09-08 · 知道合伙人软件行家
greystar_cn
知道合伙人软件行家
采纳数:16407 获赞数:17260
本人主要从事.NET C#方向的技术开发工作,具有10多年的各类架构开发工作经验。

向TA提问 私信TA
展开全部
当我们想要将一个目录设置为ftp只读或ftp只写时,我们可以借助/etc/ftpaccess.ctl文件来实现这种权限控制。
一、设置一个目录为ftp只读
1. 编辑/etc/ftpaccess.ctl,加入如下一行:
readonly: /test
2. ftp连接服务器进行读取传输,成功
HA_node2@/> ftp 172.16.18.13
Connected to 172.16.18.13.
220 DumpServer FTP server (Version 4.2 Fri Feb 3 22:13:23 CST 2006) ready.
Name (172.16.18.13:root): root
331 Password required for root.
Password:
230-Last unsuccessful login: Tue May 13 08:44:37 2008 on /dev/pts/1 from 9.181.50.139
230-Last login: Tue May 13 10:45:06 2008 on ftp from ::ffff:9.181.50.246
230 User root logged in.
ftp> cd /test
250 CWD command successful.
ftp> lcd /test
Local directory now /test
ftp> dir
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 29472
-rw-r--r-- 1 root system 7539356 Apr 24 19:42 trace.r
-rw-rw-rw- 1 root system 880640 Apr 24 19:41 trace.raw
-rw-rw-rw- 1 root system 1158232 Apr 24 19:41 trace.raw-0
-rw-rw-rw- 1 root system 1059928 Apr 24 19:41 trace.raw-2
-rw-rw-rw- 1 root system 1050952 Apr 24 19:41 trace.raw-3
-rw-rw-rw- 1 root system 1195440 Apr 24 19:41 trace.raw-4
-rw-rw-rw- 1 root system 2196288 Apr 24 19:41 trace.raw-5
226 Transfer complete.
ftp> bin
200 Type set to I.
ftp> get trace.raw
200 PORT command successful.
150 Opening data connection for trace.raw (880640 bytes).
226 Transfer complete.
880852 bytes received in 0.08342 seconds (1.031e+04 Kbytes/s)
local: trace.raw remote: trace.raw
3.进行写入传输,则遭遇报错
ftp> bin
200 Type set to I.
ftp> put trace.raw-1
200 PORT command successful.
550 Write access denied
二、设置一个目录为ftp只写
1. 编辑/etc/ftpaccess.ctl,加入如下一行:
writeonly: /test
2. ftp连接服务器进行读取传输,则遭遇报错
HA_node2@/> ftp 172.16.18.13
Connected to 172.16.18.13.
220 DumpServer FTP server (Version 4.2 Fri Feb 3 22:13:23 CST 2006) ready.
Name (172.16.18.13:root): root
331 Password required for root.
Password:
230-Last unsuccessful login: Tue May 13 08:44:37 2008 on /dev/pts/1 from 9.181.50.139
230-Last login: Tue May 13 15:45:37 2008 on ftp from ::ffff:172.16.18.11
230 User root logged in.
ftp> cd /test
250 CWD command successful.
ftp> lcd /test
Local directory now /test
ftp> dir
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 29472
-rw-r--r-- 1 root system 7539356 Apr 24 19:42 trace.r
-rw-rw-rw- 1 root system 880640 Apr 24 19:41 trace.raw
-rw-rw-rw- 1 root system 1158232 Apr 24 19:41 trace.raw-0
-rw-rw-rw- 1 root system 1059928 Apr 24 19:41 trace.raw-2
-rw-rw-rw- 1 root system 1050952 Apr 24 19:41 trace.raw-3
-rw-rw-rw- 1 root system 1195440 Apr 24 19:41 trace.raw-4
-rw-rw-rw- 1 root system 2196288 Apr 24 19:41 trace.raw-5
226 Transfer complete.
ftp> bin
200 Type set to I.
ftp> get trace.raw-2
200 PORT command successful.
550 Read access denied
3.进行写入传输,成功
ftp> bin
200 Type set to I.
ftp> put trace.raw-1
200 PORT command successful.
150 Opening data connection for trace.raw-1.
226 Transfer complete.
880640 bytes sent in 0.07938 seconds (1.083e+04 Kbytes/s)
local: trace.raw-1 remote: trace.raw-1
ftp> dir
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 31192
-rw-r--r-- 1 root system 7539356 Apr 24 19:42 trace.r
-rw-rw-rw- 1 root system 880640 Apr 24 19:41 trace.raw
-rw-rw-rw- 1 root system 1158232 Apr 24 19:41 trace.raw-0
-rw-r----- 1 root system 880640 May 13 15:53 trace.raw-1
-rw-rw-rw- 1 root system 1059928 Apr 24 19:41 trace.raw-2
-rw-rw-rw- 1 root system 1050952 Apr 24 19:41 trace.raw-3
-rw-rw-rw- 1 root system 1195440 Apr 24 19:41 trace.raw-4
-rw-rw-rw- 1 root system 2196288 Apr 24 19:41 trace.raw-5
226 Transfer complete.
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
Storm代理
2023-07-25 广告
StormProxies是一家提供动态住宅IP的服务商。动态住宅IP可以为用户提供更加灵活和稳定的网络连接,同时也可以用于一些特定的网络应用场景,例如网络游戏、视频直播等。使用StormProxies的动态住宅IP服务,用户可以通过更换IP... 点击进入详情页
本回答由Storm代理提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式