Centos開啓ftp服務&開放21端口

首先安裝vsftpd,vsftpdvery 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命令是系統服務管理器命令,它實際上將servicechkconfig這兩個命令組合到一塊兒。rest

systemctl stop firewalld
systemctl mask firewalld

安裝iptables-servicecode

yum install iptables-services

啓用iptablesorm

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用戶名稱密碼,映射目錄等便可

相關文章
相關標籤/搜索