免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2250 | 回复: 0

如何控制AIX中目录的ftp访问权限 ? [复制链接]

论坛徽章:
0
发表于 2011-11-07 18:38 |显示全部楼层
如何控制AIX中目录的ftp访问权限

     

环境:AIX 5.2或更高

解答: 当我们想要将一个目录设置为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.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

DTCC2020中国数据库技术大会

【架构革新 高效可控】2020年12月21日-23日第十一届中国数据库技术大会将在北京隆重召开。

大会设置2大主会场,20+技术专场,将邀请超百位行业专家,重点围绕数据架构、AI与大数据、传统企业数据库实践和国产开源数据库等内容展开分享和探讨,为广大数据领域从业人士提供一场年度盛会和交流平台。

http://dtcc.it168.com


大会官网>>
  

北京盛拓优讯信息技术有限公司. 版权所有 16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122
中国互联网协会会员  联系我们:huangweiwei@it168.com
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP