FTP模式:
ftp主动模式(port):21(验证,握手),20(数据传输)
ftp被动模式(pasv):21(验证,握手),1024-65535(数据传输),一般的FTP服务器都采用此模式作为默认模式
FTP的客户端:
命令行客户端:ftp/lftp(可以兼容shell的快捷操作)
图形工具: IE/firefox/cute-ftp/filezilla(win/lin)/gftp
gftp:yum -y install gftp
opensource(free) GPL/LGPL/BSD
1.安装
# yum -y install vsftpd
vim /root/ftp/.txt
user1
passwduser1
user2
passwduser2
2. 转换成数据格式
db_load -T -t hash -f /root/ftp.txt /etc/vsftpd/vsftpd_login.db
chmod 600 /etc/vsftpd/vsftpd_login.db
3.增加模块
vim /etc/pam.d/ftp
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login crypt=hash
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login crypt=hash
4.编辑配置文件
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=no
local_enable=YES
#write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=ftp
userlist_enable=YES
userlist_deny=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=www
chroot_list_file=/etc/vsftpd/chroot_list
chroot_local_user=yes
user_config_dir=/etc/vsftpd/ew
max_clients=300
max_per_ip=10
#anon_world_readable_only=NO
#pasv_min_port=30000
#pasv_max_port=30999
5.给不同用户不同的权限,这里就弄一个样例
vim /etc/vsftpd/ew/user1
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
write_enable=YES
virtual_use_local_privs=YES
local_root=/home/www/555.com
7.最后验证
service vsftpd restart
chkconfig vsftpd on
转载于:https://blog.51cto.com/linuxora/960362