1. 程式人生 > >linux xinetd模式下的ftp只允許某使用者切換目錄或只允許某使用者登陸

linux xinetd模式下的ftp只允許某使用者切換目錄或只允許某使用者登陸

一、只允許某使用者登陸
開啟ftp服務:編輯/etc/xinetd.d/vsftpd,將服務開啟 disable = no,重啟xinetd服務
編輯/etc/vsftpd.conf檔案,新增:
userlist_deny=NO #userlist_deny只允許userlist中的使用者訪問ftp
userlist_enable=YES #開啟userlist選項
userlist_file=/etc/user_list #userlist配置檔案的位置(如果沒有需要新建)
重啟服務xinetd服務

二、ftp只允許某使用者切換目錄
編輯:/etc/vsftpd.conf
開啟選項:
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list (沒有的話需要新建)
在/etc/vsftpd/chroot_list新增允許的使用者
重啟xinetd服務