centos环境服务器千千万,我们先来最容易获得成就感的操作,搭建ftp服务器。
在没搭建起ftp服务器时,cmd使用ftp命令会这样
此时我们先回到centos环境,将用户切换成root用户,然后去配置selinux,它是部署在 Linux 系统中的安全增强功能模块;
vi /etc/selinux/config
SELINUX=1
配置完成后,接着必须重启linux,不重启是没办法立刻开启selinux的
紧接着继续使用root用户,进入正题
1.安装vsftpd服务#
##1、安装vsftpd:
yum install vsftpd -y
##2、启动vsftpd:
systemctl start vsftpd
##3、设置开机启动:
systemctl enable vsftpd
2,关闭防火墙
systemctl stop firewalld 停止防火墙运行
systemctl disable firewalld 禁止开机启动
3,添加访问用户
systemctl stop firewalld 停止防火墙运行
systemctl disable firewalld 禁止开机启动
4,配置ftp内容,此处会看到很多服务是关闭的
[root@localhost 20190425]# getsebool -a | grep ftp
ftp_home_dir --> on
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> on
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
sftpd_anon_write --> off
sftpd_enable_homedirs --> off
sftpd_full_access --> off
sftpd_write_ssh_home --> off
tftp_anon_write --> off
tftp_home_dir --> off
#修改ftp_home_dir和sftpd_full_access状态,可通过一下命令执行
setsebool -P allow_ftpd_full_access on #允许ftp访问外网
setsebool -P tftp_home_dir on #允许ftp访问home
配置完成后,到这里就已经可以用在windows下用ftp访问centos环境了