centos简单服务器搭建(ftp服务器)

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环境了

在这里插入图片描述

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值