CentOS系統下安裝配置ftp服務

來源:互聯網
上載者:User

標籤:

安裝配置步驟:

rpm -ivh /opt/bak/vsftpd-2.2.2-11.el6.x86_64.rpm --本地安裝vsftpd

ll /etc/vsftpd/  --查看vsftpd的設定檔

裡面一共有四個設定檔:

vsftpd.conf 為主設定檔,

ftpusers為黑名單使用者設定檔,通常我們的系統使用者還有根使用者都是放在這個設定檔裡面的,因為這些使用者的許可權很大,如果使用ftp服務可能造成一些問題,

user_list為使用者列表檔案(可以通過在設定檔vsftpd.conf中配置userlist_deny參數決定user_list檔案中的使用者可否使用ftp,參數不寫時的預設值是userlist_deny=YES, 即此使用者檔案中的使用者不可使用ftp)。

vsftpd_conf_migrate.sh為ftp服務遷移指令碼。

 

ll /var/ftp --查看ftp共用資料夾

 

useradd -d /var/ftp/test ftpUser --建立一個使用者來訪問FTP,並指定該使用者的FTP目錄為/var/ftp/test

passwd ftpUserpwd -- 為ftpUser設定密碼

chkconfig --list vsftpd --查看vsftpd 啟動狀態

chkconfig --level 5 vsftpd on --設定多使用者層級5 狀態為on

/etc/init.d/iptables status --查看防火牆狀態

/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT --添加開放ftp 的 21號連接埠

iptables -A INPUT -p tcp --dport 21: -m state --state ESTABLISHED,RELATED -j ACCEPT --添加規則ftp串連保持的被動訪問。

/etc/init.d/iptables status --查看防火牆狀態驗證上面的規則是否添加成功

 /etc/rc.d/init.d/iptables save --儲存上面的規則到iptables設定檔,防止系統重啟丟失。

service iptables restart --重啟防火牆

Sestatus --查看selinux

setsebool -P allow_ftpd_full_access 1 --設定允許ftp可通過

setsebool -P ftp_home_dir on --設定允許ftp可通過

 

載入FTP額外模組:

lsmod | grep ftp --查看是否載入ftp模組

modprobe ip_nat_ftp --載入ftp模組

modprobe ip_conntrack_ftp --載入ftp模組

 

 vi /etc/sysconfig/iptables-config --加入下面兩行,防止系統重啟ftp模組載入丟失

IPTABLES_MODULES="ip_conntrack_ftp"

IPTABLES_MODULES="ip_nat_ftp"

 

參考的文檔:

FTP服務原理及vsfptd的安裝、配置

http://www.cnblogs.com/xiaoluo501395377/archive/2013/06/09/3127899.html

Linux FTP 伺服器配置簡單說明

http://www.cnblogs.com/hnrainll/archive/2011/02/16/1956539.html

為開放ftp配置iptables

http://blog.csdn.net/highball/article/details/8521954

 

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.