建立受限的ftp方法

代码
建立受限的ftp方法:
在系统中添加只具有ftp权限而没有telnet权限的帐户:
[root@ip
-06 /]# useradd -/export/home/zhoucb -/sbin/nologin zhoucb

为新增帐户设置口令:
[root@ip
-06 /]# passwd zhoucb
Changing password 
for user zhoucb.
New UNIX password:
Retype 
new UNIX password:
passwd: all authentication tokens updated successfully.

编辑配置文件
/etc/vsftpd/vsftpd.conf,增加以下选项:
chroot_local_user
=NO
chroot_list_enable
=YES
chroot_list_file
=/etc/vsftpd.chroot_list

编辑
/etc/vsftpd.chroot_list文件,加入zhoucb

重新启动vsftp进程

nruftp:x:
501:0::/data1:/sbin/nologin
nruftp:x:
501:0::/data2:/sbin/nologin

 

posted @ 2010-07-15 16:40  derrck  阅读(186)  评论(0编辑  收藏  举报