1.检测系统是否安装vsftpd: rpm -q vsftpd
2.禁掉selinux:
(1)cd /etc/selinux
(2)vi config
#SELINUX=enforcing
SELINUX=disabled
3.关闭防火墙
(1)chkconfig --list|grep ip
ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
(2)service iptables stop
4.vsftpd服务配置文件
(1)vim /etc/vsftdp/vsftpd.conf
(2)anonymous_enable=YES开启匿名账户
anon_upload_enable=yes匿名账户可上传
anon_mkdir_write_enable=yes 匿名账户可创文件夹,写入
(3)末尾添加:
local_root=/var/ftp/pub/usr
普通默认登录目录
anon_root=/var/ftp/pub/anon 匿名用户默认登陆目录
chroot_local_user=YES本地用户切换目录允许
userlist_deny=YES 不允许user_list内的用户登录
(4)想让root用户登陆的话就把文件ftpusers和user_list中的root用户注释掉
(5)其中usr和anon目录权限分别为777和755(ftp不允许anonymous用户的权限是777)
(6)设置vsftpd开机启动:
修改 /etc/rc.local 文件,末尾添加/usr/local/sbin/vsftpd
(7)重启service vsftpd restart
5.在windows上可以直接在dos下ftp ip(你配置的ftp服务器);或者使用可视化界面的ftp上传工具如FlashFXPPortable。
6.put c:/lonfile.txt向Linux 的ftp服务器上传东西; get hahah.txt 从ftp服务器下载东西。