Linux
Linux中如何添加删除FTP用户并设置权限
在linux中添加ftp用户,并设置相应的权限,操作步骤如下:1.环境:ftp为vsftp。被设置用户名为test。被限制路径为/home/test2.创建建用户:在root用户下:[plain] view plain copy print?useradd -d /home/test test #增加用户test,并制定test用户的主目录为/home/test passwd test #为test用户设置密码
3.更改用户相应的权限设置:
[plain] view plain copy print?usermod -s /sbin/nologin test #限定用户test不能telnet,只能ftp usermod -s /bin/bash test #用户test恢复正常usermod -d /home/test test #更改用户test的主目录为/test
4.限制用户只能访问/home/test,不能访问其他路径
修改/etc/vsftpd/vsftpd.conf如下:
[plain] view plain copy print?chroot_list_enable=YES #限制访问自身目录# (default follows)
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list