Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2561341
  • 博文数量: 245
  • 博客积分: 4125
  • 博客等级: 上校
  • 技术积分: 3113
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-25 23:56
文章分类

全部博文(245)

文章存档

2015年(2)

2014年(26)

2013年(41)

2012年(40)

2011年(134)

2010年(2)

分类: LINUX

2012-02-14 17:27:44


Q. How do I configure and install an FTP server in CentOS / RHEL 5 / Fedora Linux server?

A. CentOS / RHEL server comes with vsftpd which is the Very Secure File Transfer Protocol (FTP) daemon. The server can be launched via a xinetd or as standalone mode, in which case vsftpd itself will listen on the network port 21.

How do I install vsftpd?

Simply type the following command as a superuser (root):
# yum install vsftpd

WARNING! These examples open your computer to insecure ftp protocol. If possible use SFTP ftp secure sever which is inbuilt into OpenSSH SSHD server.
Turn on vsftpd ftp service

Type the following command:
# chkconfig vsftpd on

How do I start vsftpd ftp server?

Type the following command:
# service vsftpd start

How do I stop vsftpd ftp server?

Type the following command:
# service vsftpd stop

How do I restart vsftpd ftp server?

Type the following command:
# service vsftpd restart

Open FTP port

Open /etc/sysconfig/iptables file, enter:
# vi /etc/sysconfig/iptables
Append following line to open ftp port 21 before REJECT line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
Save and close the file. Restart the firewall:
# service iptables start

Test ftp server

Type the following command:
$ ftp localhost
$ ftp ftp.server.com
$ ftp 202.54.1.1

How do I configure vsftpd server?

The default configuration file is /etc/vsftpd/vsftpd.conf file. You can open file with vi text editor:
# vi /etc/vsftpd/vsftpd.conf

1、修改/etc/vsftpd/vsftpd.conf

将底下三行

  1. #chroot_list_enable=YES
  2. # (default follows)
  3. #chroot_list_file=/etc/vsftpd.chroot_list

改为

  1. chroot_list_enable=YES
  2. # (default follows)
  3. chroot_list_file=/etc/vsftpd/chroot_list


See see vsftpd.conf man pages for all configuration options.
$ man vsftpd.conf

阅读(1254) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~