centos配置vsftp,ftp服务

一、安装vsftplinux

1.一、安装vsftp,测试安装的vsftpd的版本是:vsftpd.x86_64 0:3.0.2-11.el7_2服务器

yum -y install vsftpd

1.二、修改配置文件测试

vi /etc/vsftpd/vsftpd.conf

    保证下面3项为YES3d

    anonymous_enable=YEScode

    anon_upload_enable=YESblog

    anon_mkdir_write_enable=YESci

1.三、设置vsftpd开机启动it

systemctl enable vsftpd.service

1.四、启动并查看vsftpd服务状态,systemctl启动服务成功不会有任何提示,绿色的active表示服务正在运行class

systemctl start vsftpd.service
systemctl status vsftpd.service

 

二、本地验证ftp是否能够正常访问百度

2.一、安装ftp

yum -y install ftp

2.二、使用anonymous登录,无需密码

ftp localhost

220表示服务正常,能够登录;230表示登录成功。

2.三、查看FTP服务器文件夹信息

 

三、  外部证ftp是否能够正常访问

3.一、关闭防火墙(也能够设置防火墙规则,得再百度了)

systemctl stop firewalld.service

  为防止机器重启后防火墙服务从新开启,可将防火墙服务永久关闭。

systemctl disable firewalld.service

3.二、在window上输入ftp://IP地址,可看到ftp下的目录(pub为系统预设的)

四、文件读写。

     到上面为止,咱们发现ftp目录下并不能读写文件,这是由文件夹权限和selinux引发的。

4.一、设置文件夹权限,将pub文件夹的权限设置为777

chmod 777 -R /var/ftp/pub

4.一、关闭selinux服务

vi /etc/selinux/config

    将SELINUX=enforcing改成:SELINUX=disabled

4.三、系统重启,让配置生效

shutdown -r now

4.四、上传文件

相关文章
相关标签/搜索