Linux_Vsftpd 安装笔记

[visitor@bogon ~]$ sudo yum -y install vsftpd ftp

Installed:
  vsftpd.x86_64 0:3.0.2-22.el7

  ftp.x86_64 0:0.17-67.el7                                                                                                         

Complete!

[visitor@bogon ~]$ sudo systemctl start vsftpd

[visitor@bogon ~]$ sudo netstat -nlp | grep vsftpd 

[sudo] password for visitor: 
tcp6       0      0 :::21                   :::*                    LISTEN      18315/vsftpd 

[visitor@bogon ~]$ sudo firewall-cmd --add-service=ftp --permanent

success

[visitor@bogon ~]$ sudo firewall-cmd --reload

success

[visitor@bogon ~]$ sudo firewall-cmd --list-services

ftp dhcpv6-client ssh

[visitor@bogon ~]$ sudo setsebool -P ftpd_full_access on

[visitor@bogon ~]$ getsebool -a | grep ftpd

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

至此ftp服务即可无账号访问了: ftp://ip

[visitor@bogon ~]$ ftp localhost

Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 (vsFTPd 3.0.2)
Name (localhost:visitor): anonymous
331 Please specify the password.
Password: 回车键
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> ls
227 Entering Passive Mode (127,0,0,1,250,10).
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Aug 03  2017 pub
226 Directory send OK.
ftp> passive
Passive mode off.
ftp> passive
Passive mode on.


接下来配置账号访问

[visitor@bogon ~]$ sudo useradd -g ftp -d /var/ftp/pub/liuzhiguo -s /sbin/nologin liuzhiguo

[visitor@bogon ~]$ ll /var/ftp/pub/

total 0
drwx------. 3 liuzhiguo ftp 78 Sep 18 15:07 liuzhiguo

[visitor@bogon ~]$ sudo passwd liuzhiguo

Changing password for user liuzhiguo.
New password: 
BAD PASSWORD: The password contains the user name in some form
Retype new password: 
passwd: all authentication tokens updated successfully.

[visitor@bogon ~]$ sudo vim /etc/vsftpd/vsftpd.conf 

#关闭匿名登录
anonymous_enable=NO

#支持本地账号登录
local_enable=YES
#支持ftp写入权限
write_enable=YES

#加载userlist_file中账号信息
userlist_enable=YES
#限制userlist_file中账号访问
userlist_deny=YES
#userlist_file文件路径
userlist_file=/etc/vsftpd/user_list

#加载chroot_list_file中账号信息
chroot_list_enable=YES
#限制账号访问自身的根目录
chroot_local_user=YES
#chroot_list_file文件路径
chroot_list_file=/etc/vsftpd/chroot_list

[visitor@bogon ~]$ sudo vim /etc/vsftpd/chroot_list

liuzhiguo

至此ftp服务即可账号访问了: ftp://ip


阿里云上部署出现过的问题

新问题

 

 

 

 

 

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值