- 查看系统环境
[[email protected]rsync_server ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[[email protected]rsync_server ~]# uname -a
Linux web01 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
2.关闭selinux和防火墙
[[email protected]rsync_server ~]# /etc/init.d/iptables stop
[[email protected]rsync_server ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX=disabled
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
3.安装vsftp服务
[[email protected]_server~]# yum list vsftpd
Loaded plugins: fastestmirror, security
Loading mirror speeds from cachedhostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.7 kB 00:00
epel | 4.3 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Installed Packages
vsftpd.x86_64 2.2.2-24.el6 @base
[[email protected]_server~]# yum install vsftpd.x86_64
4. 备份vsftp的配置文件
[[email protected]_server~]# cd /etc/vsftpd/
[[email protected]_servervsftpd]# ls
chroot_list user_list vsftpd.bak vsftpd_conf_migrate.sh
ftpusers vftpuser.db vsftpd.conf
[[email protected]_servervsftpd]# cp vsftpd.conf vsftpd.conf.bak
5. 编辑配置文件
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO #将这个的YES改为NO
userlist_deny=NO #在末尾加上这一句
6.创建认证账号
[[email protected]_servervsftpd]# useradd test-bai
[[email protected]_servervsftpd]# echo "123456"|passwd --stdin test-bai
Changing password for user test-bai.
passwd: all authentication tokensupdated successfully.
7.添加用户到user_list中
[[email protected]_servervsftpd]# echo test-bai >>/etc/vsftpd/user_list
8.启动vsftp服务
[[email protected]_server vsftpd]# /etc/init.d/vsftpd start
Starting vsftpd for vsftpd: [ OK ]
9.连接vsftp
10.传输文件