centos下開啟ftp服務

來源:互聯網
上載者:User

標籤:res   檢查   style   upload   rdb   blog   images   編輯   賬戶   

  如果要ftp訪問linux需要安裝ftp服務,vsftpd是Linux下比較好的的FTP伺服器。

  一、檢查安裝vsftp

1 //檢查是否安裝vsftpd2  rpm -qa | grep vsftpd3 //沒有就安裝vsftpd4  yum -y install vsftpd5 chkconfig vsftpd on

  二、編輯vsftp配置項

    配置開啟虛擬賬戶(只能登陸ftp,不能登陸系統)以及設定訪問目錄

 1 vim   /etc/vsftpd/vsftpd.conf 2 anonymous_enable=NO //設定不允許匿名訪問 3 local_enable=YES //設定本機使用者可以訪問。 4 chroot_list_enable=YES //使用者不能離開主目錄 5 ascii_upload_enable=YES 6 ascii_download_enable=YES //設定支援ASCII模式的上傳和下載功能 7 pam_service_name=vsftpd //PAM認證檔案名稱。PAM將根據/etc/pam.d/vsftpd進行認證 8  9 // 手動添加10 guest_enable=YES //設定啟用虛擬使用者功能11 12 user_config_dir=/etc/vsftpd/vuser_conf //設定虛擬使用者個人vsftp的CentOS FTP服務檔案存放路徑13 //進行認證14 chroot_list_file=/etc/vsftpd/vuser_passwd.txt15 16 local_root=/   //設定訪問目錄  不配置預設是 /var/ftp 

  三、安裝Berkeley DB工具(檔案資料庫,我們用檔案存放虛擬使用者的帳號密碼)

yum install db4 db4-utils

  四、建立使用者密碼文本/etc/vsftpd/vuser_passwd.txt ,奇行是使用者名稱,偶行是密碼

1 vim /etc/vsftpd/vuser_passwd.txt
2 test3 123456

  五、產生虛擬虛擬使用者帳號密碼的db檔案,並關聯資料db檔案

1 db_load -T -t hash -f /etc/vsftpd/vuser_passwd.txt /etc/vsftpd/vuser_passwd.db

  編輯認證檔案/etc/pam.d/vsftpd,全部注釋掉原來語句,再增加以下兩句

1 auth required pam_userdb.so db=/etc/vsftpd/vuser_passwd2 account required pam_userdb.so db=/etc/vsftpd/vuser_passwd

 

  六、重啟vsftpd服務

1 service vsftpd restart

 最後建立ftp串連到ftp伺服器

  

 

centos下開啟ftp服務

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.