How to Install and Set up vsftpd (ftp server) on Linux

#Install the vsftpd first

$ sudo yum install vsftpd

#Once installed set up your ftp server by Enabling vsftpd passive and active mode

$ sudo vim /etc/sysconfig/iptables-config

#Navigate to and add two modules

IPTABLES_MODULES=”ip_conntrack_ftp ip_nat_ftp”

#Add Rules to Ipconfig. First edit your ipconfig rules

$ sudo vim /etc/sysconfig/iptables

# then add the following rules to enable communication

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
-A OUTPUT -p tcp –dport 80 -m state –state ESTABLISHED,NEW -j ACCEPT
-A OUTPUT -p tcp –dport 21 -m state –state ESTABLISHED,NEW -j ACCEPT
-A OUTPUT -p tcp –dport 20 -m state –state ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp –dport 50000:60000 -m state –state RELATED,ESTABLISHED -j ACCEPT

#restart the iptables config

$ sudo service iptables restart

iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: nat filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
iptables: Loading additional modules: ip_conntrack_ftp ip_n[ OK ]

#These are two most important thing you need to set up in order to get the basic server up and running
#You can use the exising users or create new ones.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s