
1.下载源代码--vsftpd-2.3.4.tar.gz
2.编译源代码
#tar xvzf vsftpd-2.3.4.tar.gz //解压缩包
#cd vsftpd-2.3.4 //进入解包后的vsftpd-2.2.0目录
#make //编译生成二进制数据
#make install //进行安装
3.复制配置文件
#cd vsftpd-2.3.4
#cp vsftpd.conf /etc/ //vsftpd.conf是配置文件
#cp RedHat/vsftpd.pam /etc/pam.d/ftp
注:*.pam文件是客户认证模块,对用户进行身份识别,ftp是vsftp下默认的,不能改为其它文件名
4、创建ftp文件夹
#mkdir /var/ftp //建立ftp服务器的home目录
5.编辑配置文件 /etc/vsftpd.conf
#vi /etc/vsftpd.conf
在vsftpd.conf文件中修改或追加listen=YES //让服务器自己监听,保存退出。
6.启动服务器
#/usr/local/sbin/vsftpd & //手动启动服务器,并让其工作在后台
7.测试服务器的运行
#netstat –tnl //检查一下,看机器有没有开端口是21的服务器,结果如下
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
[root@rac1 var]# ftp localhost
Trying ::1...
ftp: connect to address ::1Connection refused
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 (vsFTPd 2.3.4)
Name (localhost:root): anonymous //用户名为anonymous
331 Please specify the password.
Password: //密码为空
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
8.修改服务器自动运行脚本
[root@rac1 ~]# vi /etc/rc.local //让电脑开机自动启动vsftp服务器
进入rc.local 脚本文件
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/local/sbin/vsftpd & //该行是我们自己追加的
9、查看vsftpd进程是否存在
#pgrep vsftpd
10、查看vsftpd的版本
#vsftpd -v
