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

相关文章
相关标签/搜索