># yum install vsftpd lftp -y ### yum 安装 vsftpd lftp
/etc/init.d/vsftpd start ### 启动vsftpd服务
chkconfig vsftpd on ### 设置开机自启动
cd /var
ll -Zd ftp ### 查看服务目录的安全上下文
chcon -R -t public_content_rw_t ftp/ ### 修改安全上下文为可写
chgrp ftp ftp/ -R ### 修改 服务目录的拥有组为 ftp
getsebool -a | grep ftp ###查看 ftp 服务的selinux 布尔值
.
.
.
setsebool allow_ftpd_anon_write on -P ### 修改 匿名可写 的布尔值为 on ,"-P" 为永久生效。
chown root ftp/ ### 修改ftp的拥有者为root
vim /etc/vsftpd/vsftpd.conf /*27 row */ ### 查看vsftpd 服务的主配置文件,并按样板修改。
.
.
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
anon_world_readable_only=NO
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES ###修改完后,保存退出
.
.
/etc/init.d/vsftpd restart ### 重启服务,这样你的个人ftp服务器就搭建好了,这是最基本的搭建方法,实现了匿名用户的上传下载。
># lftp 192.168.0.5 ###从本地登录上去进行测试。
># cd pub ### 进入pub目录
># put /etc/passwd ### 上传/etc/passwd 文件
># get passwd ### 下载passwd 如果没有报错就代表一切正常。
转载于:https://blog.51cto.com/lnlnnn/846151