Centos开启ftp服务&开放21端口

首先安装vsftpd,vsftpdvery secure FTP daemon的缩写,是一个完全免费的、开放源代码的ftp服务器软件。

yum - y install vsftpd

安装完后,会有/etc/vsftpd/vsftpd.conf文件,并且新建了一个ftp用户和ftp的组

cat /etc/passwd|grep ftp
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

默认的ftp服务是没有启动的,执行sudo service vsftpd start启动

安装ftp客户端组件,

yum -y install ftp

尝试登陆ftp localhost,输入用户名,密码随意(允许匿名登陆) 我们就可以登陆到ftp上了

开放21端口

systemctl命令是系统服务管理器命令,它实际上将servicechkconfig这两个命令组合到一起。

systemctl stop firewalld
systemctl mask firewalld

安装iptables-service

yum install iptables-services

启用iptables

systemctl enable iptables

管理iptablse 服务

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用户名称密码,映射目录等即可

相关文章

#使用军哥的lnmp配置虚拟主机,需要注意的是要配置hosts文件(...
一、配置编译环境 yum update && yum upgra...
一、下载repo文件 二、备份并替换系统的repo文件 三、执行yu...
LAMP -- Linux Apache MySQL PHP 在CentOS安装的顺序,我一般...
一、下载nginx安装包,官网下载中心http://nginx.org/downlo...
1.下载composer curl -sS https://getcomposer.org/installe...