当前位置: 移动技术网 > 网络运营>服务器>ftp服务器 > centos 搭建ftp服务器详解及简单介绍

centos 搭建ftp服务器详解及简单介绍

2019年04月17日  | 移动技术网网络运营  | 我要评论

centos 搭建ftp服务器

1.安装vsftpd

sudo yum install vsftpd

2.配置vsftpd.conf


# allow anonymous ftp? (beware - allowed by default if you comment this out).
anonymous_enable=no

# when selinux is enforcing check for se bool ftp_home_dir
local_enable=yes


write_enable=yes

# 本地的ftp目录地址
local_root=/var/ftp

3.添加ftp用户

#创建用户
adduser -d /var/ftp -g ftp -s /sbin/nologin *_ftp

#修改密码
passwd *_ftp


4.上传权限

# 修改上传路径权限 777  更具个人喜好设置权限
sudo chmod -r 777 /var/ftp

# 查看 ftp 设置
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、ftpd_full_access 为 on
setsebool -p ftp_home_dir=on ftpd_full_access=on

5.设置vsftp 开机启动

chkconfig vsftpd on

6.添加防火墙

firewall-cmd --permanent --add-service=ftp

firewall-cmd --reload

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网