FileZilla是一款FTP工具,我們可以使用它在Linux和Window之間傳輸文件。
剛在虛擬機中安裝好Centos7,想使用FileZilla傳輸JDK到Centos中,總是連接不上。
搜索資料發現Centos必須先要有FTP服務才行
使用命令查看是否安裝了FTP服務:
rpm -qa | grep ftp
或
find / -name vsftpd
后者會慢很多,能找到結果就是安裝了,沒找到就是沒安裝。
使用下面命令安裝ftp服務
yum -y install vsftpd
打開ftp服務/停止/重啟
service vsftp start/stop/restart
檢查ftp服務是否開啟:
檢查21端口是否打開
netstat -an | grep '21'
查看進程
ps -ef | grep ftp
查看服務狀態
service vsftpd status
打開vsftpd配置文件
vim /etc/vsftpd/vsftpd.conf
開機啟動ftp服務
chkconfig vsftpd on
防火牆開放21端口
iptables開放21端口
# 開放端口 iptables -I INPUT 5 -p tcp --dport 21 -j ACCEPT # 重啟服務 service iptables restart
firewalld開放21端口
# 開放端口 firewall-cmd --zone=public --add-port=21/tcp --permanent # 重新載入 firewall-cmd --reload # 查看所有開放的端口 firewall-cmd --zone=public --list-ports
最后的解決辦法:
在新建站點中使用sftp協議,然后端口使用22可以連接