linux6.0开启ftp服务,使用vsftpd 实现 redhat linux6.0 下的ftp服务匿名上传下载功能

># 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 如果没有报错就代表一切正常。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值