ftp 服务器相关

1.  安装 vsftpd

#sudo apt-get install vsftpd

2. 重启

#sudo service vsftpd restart

3. 新建"/home/uftp"目录作为用户主目录

#sudo mkdir /home/uftp

4. 新建用户uftp并设置密码

#sudo useradd -d /home/uftp -s /bin/bash uftp

5. 配置 

/etc/vsftpd.conf文件

userlist_deny=NO

userlist_enable=YES

userlist_file=/etc/allowed_users

seccomp_sandbox=NO

local_enable=YES

/etc/allowed_users文件

加入用户uftp

/etc/ftpusers文件

为不可访问的用户,确保uftp没在列表

6. 问题

a. 如何使用户a可以访问匿名目录

和ftp配置默认配置无关,只需匿名目录权限开放即可

b.如何使用户a只能访问自己的home目录

1. uncommend:chroot_list_file=/etc/vsftpd/chroot_list (/etc/vsftpd/vsftpd.conf)

2. 添加用户a到/etc/vsftpd/chroot_list


//

注1:

以上为ubuntu,

如果centos,好像只需确认/etc/allowed_users文件文件,其他默认ok。

注2:

注意用户根目录访问权限的设置  如uftp目录

注3:

匿名无密码访问需保证:anonymous_enable=YES

默认路径:/var/ftp

c. 更新密码后,如果不重启ftp服务,windows 访问会有以下错误(restart after updating password)

"Windows cannot access this folder.  Make sure you have typed the file name correctly and that you have permission to access the folder."



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值