centos7配置vsftp,被动连接

修改配置文件

vim /etc/vsftpd/vsftpd.conf
----------
# 在后面追加
# self add 
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO
tcp_wrappers=YES
listen_port=8021
port_enable=NO
pasv_enable=YES
pasv_min_port=8022
pasv_max_port=8025
local_root=/home
user_config_dir=/etc/vsftpd/userconfig

pasv_address=192.168.2.175
# pasv_addr_resolve=YES
# pasv_promiscuous=YES



设置登录用户

[root@88baa4f48b9c /]# cd /etc/vsftpd
[root@88baa4f48b9c vsftpd]# ls
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
  • /etc/vsftpd目录下ftpusers 文件下记录者不许登录ftp的用户
  • user_list 文件中记录者可以登录ftp的用户
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
listen_ipv6=NO

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

# self add

userlist_file=/etc/vsftpd/user_list
userlist_deny=NO
tcp_wrappers=YES
listen_port=8021
port_enable=NO
pasv_enable=YES
pasv_min_port=8022
pasv_max_port=8030
local_root=/home
user_config_dir=/etc/vsftpd/userconfig  # 登录用于的信息设置

pasv_address=192.168.2.175
# pasv_addr_resolve=YES
# pasv_promiscuous=YES

添加的新用户

使用 adduser 命令

sudo adduser <username>

设置用户密码
无论你选择哪种方式创建用户,都可以使用 passwd 命令为用户设置密码:

sudo passwd <username>

/etc/vsftpd//etc/vsftpd/userconfig 文件中添加用户名

设置用户的查看权限

user_config_dir=/etc/vsftpd/userconfig ,这个设置是设置用户的权限
/etc/vsftpd/userconfig目录下创建一个名字与用户名相同的文件,
然后编辑文件如果写入local_root=/home/aaa_ftp,表示用户可以查看/home/aaa_ftp这个目录下的文件

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值