安裝 ftp
1 ssh登錄服務(wù)器 首先檢查有沒(méi)有安裝運(yùn)行 ps -ef |grep vsftpd 2 yum安裝vsftpd yum安裝 yum install vsftpd -y
3 修改配置 、增加開(kāi)機(jī)啟動(dòng) vi /etc/vsftpd/vsftpd.conf anonymous_enable=YES改成NO 保存退出
查看vsftpd又沒(méi)有被設(shè)置為開(kāi)機(jī)自啟動(dòng) chkconfig --list 加入開(kāi)機(jī)啟動(dòng) chkconfig --level 35 vsftpd on
4 增加FTP用戶、并設(shè)置密碼 cd alidata mkdir www useradd ftpadmin -s /sbin/nologin -d /alidata/www passwd ftpadmin chown ftpadmin www 或者 chmod 777 www 5 啟動(dòng)ftp service vsftpd start
來(lái)自視頻:http://help.aliyun.com/view/11108189_13495137.html?spm=5176.7224473.1997282753.6.6VPxgo
發(fā)現(xiàn)這樣配置后:可以再windows系統(tǒng)的dos下使用ftp命令登錄。 但是不能使用ftp工具列出文件列表。這是怎么回事?
解決ftp無(wú)法list目錄,配置主動(dòng)、被動(dòng)模式
FTP as PRotocol is a bit of an odd duck. It uses two TCP connections, rather than just the one most protocols use. You have port 21, the command and login connection, and a second connection, the data connection. With passive FTP the second connection is to a randomly assigned available TCP port above 1024. You problems seem to indicate you don't have that second port open in your firewall. There's multiple ways to deal with that: Fixed the PASV port(-range) One solution is to configure VSFTPD to use a small range of ports, or just a single port and create a firewall rule to open those ports: # /etc/vsftpd/vsftpd.conf# reserve TCP ports 2121-2142 for passive FTPpasv_min_port=2121pasv_max_port=2142And then open the port range in your firewall. (The multiport module allows for a port range rather than 20 lines each opening a single port): # iptables -I INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 2121:2142 -j ACCEPT# service iptables save# service iptables restart摘自:http://serverfault.com/questions/555541/failed-to-retrieve-directory-listing-in-filezilla-connecting-to-vsftpd 關(guān)于 ftp主動(dòng)模式和被動(dòng)模式 可以參考:http://jackiechen.blog.51cto.com/196075/193883/ 案例:ftp被動(dòng)模式端口相同導(dǎo)致無(wú)法登錄:http://u2l.info/3n6kav |
6 /etc/vsftpd/vsftpd.conf詳解
可以參考 http://blog.chinaunix.net/uid-24625974-id-2845256.html(有案例)
鳥(niǎo)哥的私房菜 對(duì)vsftpd的介紹http://linux.vbird.org/linux_server/0410vsftpd/0410vsftpd.php
可以連接但是無(wú)法列舉目錄 問(wèn)題解決:
現(xiàn)象:
命令: LIST錯(cuò)誤: 無(wú)法打開(kāi)傳輸通道。原因:由于連接方在一段時(shí)間后沒(méi)有正確答復(fù)或連接的主機(jī)沒(méi)有反應(yīng),連接嘗試失敗。錯(cuò)誤: 無(wú)法取得目錄列表命令: REST 0
解決:
1 關(guān)閉selinux
#vi/etc/selinux/config
SELINUX=disabled
需要重啟才能生效,重啟命令是 #reboot
2 進(jìn)行下面的設(shè)置
# /etc/vsftpd/vsftpd.conf# reserve TCP ports 2121-2142 for passive FTPpasv_min_port=2121pasv_max_port=2142# iptables -I INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 2121:2142 -j ACCEPT# service iptables save# service iptables restart
|
新聞熱點(diǎn)
疑難解答
圖片精選