centos6搭建ftp服务器

时间:2024-10-13 23:20:13

使用centos6搭建FTP服务器关于ftp服务简绍请看 ftp百度百科

工具/原料

centos6服务器

个人电脑或服务器

1、使用ssh连接到服务器

1、使用ssh连接到centos6服务器~# ssh [email protected] 改为自己服务器地址

2、安装ftp服务端vsftpd

1、输入代码# yum -y install vsftpd显示Complete!时为成功

centos6搭建ftp服务器

3、修改vsftpd配置

1、# vi /etc/vsftpd/vsftpd.conf使用vi编辑器修改vsftpd.conf配置文件按i进入编辑模式

centos6搭建ftp服务器

2、将anonymous_enable=YES修改为anonymous_enable=NO

centos6搭建ftp服务器

3、然后按Esc按键退出编辑模式键入:(冒号) 输入wq保存退出

centos6搭建ftp服务器

启动(重启)vsftpd服务

1、#service vsftpd restart

centos6搭建ftp服务器

2、# useradd -d /var/ftp/ftp1 ftp1为ftp创秃赈沙嚣建一个名为ftp1的用户并绑定目录为/var/ftp/ftp1#passwd 熠硒勘唏ftp1 // 为ftp1用户创建密码输入密码后回车 (输入密码时屏幕没有显示,需要重复输入确一次)

centos6搭建ftp服务器
centos6搭建ftp服务器

更新防火墙策略(开启防火墙21端口)

1、# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT添加规则#s髫潋啜缅ervice iptablessave保存规则#service iptables restart重启防火墙

测试

1、在我的电脑输入 ftp://192.168.200.135 //192.168.200.135为自己服务器ip地址然后输入用户名和自己为该用户和设置的密码

centos6搭建ftp服务器

2、如果建新文件夹时出现 550 Create directory operation failed. (550报错)时# vi /etc/s髫潋啜缅elinux/config将 SELINUX=XXX -->XXX 代表级别改为SELINUX=disabled重启服务器后重启vsftpd服务就可以了

© 手抄报圈