centos6搭建ftp服务器

2025-10-19 05:13:46

1、使用ssh连接到centos6服务器 

~# ssh root@192.168.200.135

192.168.200.135 改为自己服务器地址

1、输入代码

# yum -y install vsftpd

显示Complete!时为成功

centos6搭建ftp服务器

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服务器

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服务器

1、# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

添加规则

#service iptables save

保存规则

#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/selinux/config

将 SELINUX=XXX -->XXX 代表级别改为SELINUX=disabled 

重启服务器后重启vsftpd服务就可以了

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢