您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
马哥linux运维学习笔记-禁锢ftp用户到家目录
发布时间:2019-03-04 17:05:11编辑:雪饮阅读()
没有禁锢ftp到家目录前:
linux端:
[root@mail ~]# touch /home/hadoop/1.txt
windows端:
C:\Users\Administrator>ftp 192.168.1.11
连接到 192.168.1.11。
220 (vsFTPd 2.0.5)
用户(192.168.1.11:(none)): hadoop
331 Please specify the password.
密码:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
1.txt
226 Directory send OK.
ftp: 收到 7 字节,用时 0.00秒 7000.00千字节/秒。
ftp> pwd
257 "/home/hadoop"
ftp> cd /
250 Directory successfully changed.
ftp> pwd
257 "/"
ftp>
可见没有禁锢ftp到家目录前,ftp用户是可以跳出其家目录,很不安全
禁锢ftp用户到家目录
在配置文件/etc/vsftpd/vsftpd.conf中将'chroot_list_enable=YES'和'chroot_list_file=/etc/vsftpd/chroot_list'的注释去除。
配置chroot_list_file=/etc/vsftpd/chroot_list文件如:
[root@mail ~]# cat /etc/vsftpd//chroot_list
hadoop
redis
禁锢ftp用户到家目录后,查看当前路径就是根路径,其实是家目录,也无法跳出家目录。
C:\Users\Administrator>ftp 192.168.1.11
连接到 192.168.1.11。
220 (vsFTPd 2.0.5)
用户(192.168.1.11:(none)): hadoop
331 Please specify the password.
密码:
230 Login successful.
ftp> pwd
257 "/"
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
1.txt
226 Directory send OK.
ftp: 收到 7 字节,用时 0.00秒 7.00千字节/秒。
ftp>
禁锢所有ftp用户到家目录
在配置文件/etc/vsftpd/vsftpd.conf中将'chroot_list_enable=YES'和'chroot_list_file=/etc/vsftpd/chroot_list'的注释重新添加上,并且在'chroot_list_file=/etc/vsftpd/chroot_list'的配置后面添加一行新配置'chroot_local_user=YES'
关键字词:linux,ftp,家目录