Skip to content

FTP Server

FTP Server

File Transfer Protocol is a way of transferring files over the Internet from one computer to another. You can connect to a FTP server, browse directories and transfer files. Red Hat Linux comes with different or updated version of FTP daemon with each release. Newer versions of Red Hat no longer support the wu-ftpd, instead vsftpd had been used.

Vsftpd FTP server

  1. vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure, extremely fast and trusted solution. Vsftpd can be downloadable from http://vsftpd.beasts.org/

  2. By default, Vsftpd is not configured to start everytime the server reboot. To enable this, use chkconfig to configure the run level of this service.

    chkconfig –level 2 vsftpd on
    chkconfig –level 3 vsftpd on
    chkconfig –level 4 vsftpd on
    chkconfig –level 5 vsftpd on

  3. vi /etc/vsftpd/vsftpd.conf

    anonymous_enable=NO
    tcp_wrappers=NO
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd.chroot_list
    pasv_min_port=10100
    pasv_max_port=10199

  4. touch /etc/vsftpd.chroot_list

    vi /etc/vsftpd.chroot_list, this is a list of local user that will be chroot() jail. For new FTP account, please remember to add the username in this list.

  5. Restart vsftpd service, /etc/rc.d/init.d/vsftpd restart

  6. Update iptables to allow passive connection to port 10100-10199

    vi /etc/sysconfig/iptables, append the new rules in appropriate line

    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 10100:10199 -j ACCEPT

    Restart iptables, /etc/rc.d/init.d/iptables restart

  7. Setup new FTP account:

    1. groupadd <group>
    2. useradd <username> -M -g <group>
    3. passwd <username>
    4. mkdir /home/<username>
    5. mkdir /home/<username>/web
    6. mkdir /home/<username>/web/stats
    7. chown -R <username >.site /home/<username>
    8. vi /etc/vsftpd.chroot_list, and add <username> in new line
    9. /etc/rc.d/init.d/vsftpd restart

Categories: Lesson, Linux, Server, Solution, Web Hosting.

Comment Feed

No Responses (yet)



Some HTML is OK

or, reply to this post via trackback.