建立受限的ftp方法

建立受限的ftp方法:
在系统中添加只具有ftp权限而没有telnet权限的帐户:
[root@ip-06 /]# useradd -d /export/home/zhoucb -s /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
在系统中添加只具有ftp权限而没有telnet权限的帐户:
[root@ip-06 /]# useradd -d /export/home/zhoucb -s /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