centos安裝ftp服務器

  1. 安裝 vsftpd:
[root@localhost ~]# yum -y install vsftpd
[root@localhost ~]# touch /etc/vsftpd/chroot_list
[root@localhost ~]# chkconfig vsftpd on
  1. 打開/etc/vsftpd/vsftpd.conf,做如下配置:
chroot_local_user=YES  
chroot_list_enable=YES  
chroot_list_file=/etc/vsftpd/chroot_list

注意:如果/etc/vsftpd/chroot_list文件不存在,則需要手動建立,在/etc/vsftpd/chroot_list文件中寫入加入登陸用戶的名字,我的服務器上有一個root用戶和一個hexon用戶,因此我填入root和hexon在該文件內,每個用戶占用一行

  1. 移除ftpusers 裡面的帳號
    vim /etc/vsftpd/ftpusers
    找到root 前面加上#號註解
[root@localhost ~]# vim /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftpbin
#root
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[root@localhost ~]#
  1. 移除user_list裡面的帳號
vim /etc/vsftpd/user_list
一樣找到root 前面加上#號註解
[root@localhost ~]# vim /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.bin
#root
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[root@localhost ~]#
  1. 重新啟動VSFTPd
[root@localhost ~]# /etc/init.d/vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
  1. 然后使用ftp工具登錄服務器
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容