一、检查FTP 是否存在
方法1、
[root@print-server /]# service vsftpd start
如果没有安装的话会提示:vsftpd: 未被识别的服务
方法2、(如果是用rpm包安装的)
[root@print-server /]#rpm -q vsftpd
已安装提示: ftp的版本信息
未安装提示:package vsftpd is notinstalled
二、安装FTP
这里是用的yum命令安装(比较省力~~),下面是执行过程
[root@print-server /]#yum -y install vsftpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: data.nicehosting.co.kr
* extras: data.nicehosting.co.kr
* updates: data.nicehosting.co.kr
http://data.nicehosting.co.kr/os/CentOS/6.0/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 : http://data.nicehosting.co.kr/os/CentOS/6.0/os/x86_64/repodata/repomd.xml
Trying other mirror.
base | 3.7 kB 00:00
http://data.nicehosting.co.kr/os/CentOS/6.0/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 : http://data.nicehosting.co.kr/os/CentOS/6.0/extras/x86_64/repodata/repomd.xml
Trying other mirror.
extras | 951 B 00:00
http://data.nicehosting.co.kr/os/CentOS/6.0/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 : http://data.nicehosting.co.kr/os/CentOS/6.0/updates/x86_64/repodata/repomd.xml
Trying other mirror.
updates | 3.5 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-6.el6_0.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
vsftpd x86_64 2.2.2-6.el6_0.1 updates 150 k
Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 150 k
Installed size: 331 k
Downloading Packages:
vsftpd-2.2.2-6.el6_0.1.x86_64.rpm | 150 kB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vsftpd-2.2.2-6.el6_0.1.x86_64 1/1
Installed:
vsftpd.x86_64 0:2.2.2-6.el6_0.1
Complete!到这里FTP已经安装完了
三、配置FTP
到现在为止我们已经成功的安装了FTP,但是还需要一些简单的配置才可以正常的运行。
1、将/etc/vsftpd/user_list文件和/etc/vsftpd/ftpusers文件中的root这一行注释掉
2、执行以下命令
[root@print-server /]# setsebool -Pftpd_disable_trans=1
3、修改/etc/vsftpd/vsftpd.conf,在最后一行处添加local_root=/
4、重启ftp (在修改完ftp的配置文件后一定重启ftp服务)
[root@print-server /]# service vsftpd restart
重启完之后就可以正常使用了。
四、附录
FTP相关配置文件详解:http://blog.csdn.net/liuensong/article/details/6728518