1、 下载vsftpd
# wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.3.2.tar.gz
2、 解压、安装vsftpd
# tar xvfz vsftpd-2.3.2.tar.gz
# cd vsftpd-2.3.2
# make
make命令成功执行后,您将看到vsftpd文件获得当前目录中创建。
# ls -l vsftpd
3、 安装 vsftpd d到 Linux
# make install
在make install,确保vsftpd文件复制到/ usr / local / sbin目录。
# ls -l /usr/local/sbin/vsftpd
4、 复制vsftpd手册页到/usr/share/man/man8,man5
# cp vsftpd.8 /usr/share/man/man8/
# cp vsftpd.conf.5 /usr/share/man/man5/
5、 拷贝vsftpd.cond配置文件
# cp vsftpd.conf /etc
6、 设置Anonymouse FTP访问vsftpd
# mkdir /var/ftp/
# chown root.root /var/ftp
# chmod og-w /var/ftp
ftp localhost
Connected to dotcom.
220 (vsFTPd 2.3.2)
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
在这个阶段,如果你试图登录与任何其他账户(除了匿名,和ftp),它就会失败,如下所示
# ftp localhost
Connected to dotcom.
220 (vsFTPd 2.3.2)
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): ramesh
530 This FTP server is anonymous only.
Login failed.
ftp>
7、 允许LINIX登录使用vsftp
# cp RedHat/vsftpd.pam /etc/pam.d/ftp
#local_enable=YES
# ftp localhost
Connected to dotcom.
220 (vsFTPd 2.3.2)
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): ramesh
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
切记再每次修改完vsftpd.conf文件之后要重启一下vsftpd
# ps -ef | grep vsftpd
# kill -9 {vsftpd-pid}
# /usr/local/sbin/vsftpd &
如果还不能登录成功,那么要关闭系统其他的ftp服务和防火墙
Service xinetd stop
Service iptables stop