首先安裝vsftpd
,vsftpd
是very secure FTP daemon
的縮寫,是一個徹底免費的、開放源代碼的ftp服務器軟件。php
yum - y install vsftpd
安裝完後,會有/etc/vsftpd/vsftpd.conf
文件,而且新建了一個ftp用戶和ftp的組linux
cat /etc/passwd|grep ftp ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
默認的ftp服務是沒有啓動的,執行sudo service vsftpd start
啓動服務器
安裝ftp
客戶端組件,phpstorm
yum -y install ftp
嘗試登錄ftp localhost
,輸入用戶名,密碼隨意(容許匿名登錄) 咱們就能夠登錄到ftp
上了tcp
開放21端口開放源代碼
systemctl
命令是系統服務管理器命令,它實際上將service
和chkconfig
這兩個命令組合到一塊兒。rest
systemctl stop firewalld systemctl mask firewalld
安裝iptables-service
code
yum install iptables-services
啓用iptables
orm
systemctl enable iptables
管理iptablse
服務server
systemctl [stop|start|restart] iptables
關閉selinux
,修改/etc/sysconfig/selinux
文件
SELINUX=disabled SELINUXTYPE=targeted
添加21端口在/etc/sysconfig/iptables
下
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
重啓iptables
sudo service iptables restart
在phpstorm設置ftp方式上傳or下載代碼
進入Tools->Deployment->configruation
新建一個server 填寫host
用戶名稱密碼,映射目錄等便可