This basic configuration allows only users with an account
and a home directory to log in and use the resource. Although it must
be said that if you have SSH up and running then you should use SFTP
(which is pretty much FTP over SSH), as it provides a little bit more
security.
- Install vsftpd:
sudo yum install vsftpd
- Configure our firewall to allow incoming connections:
sudo /sbin/iptables -I RH-Firewall-1-INPUT 4 -p tcp --dport 21 -m state --state NEW -j ACCEPT
sudo /sbin/iptables -I RH-Firewall-1-INPUT 5 -p tcp --dport 20 -m state --state NEW -j ACCEPT
- Check to see if SELinux is up and running (an output of 0 means that it is):
/usr/sbin/selinuxenabled; echo $?
- If SELinux is up and running you need to disable it for the ftp protocol,
or apply a policy to allow FTP to make changes to your local directory:
sudo /usr/sbin/setsebool -P ftpd_disable_trans 1
- Open up the vsftpd configuration file for editing:
sudo vim /etc/vsftpd/vsftpd.conf
- Make the following changes:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
- Start VSFTPD:
sudo /sbin/service vsftpd start
- Turn on FTP on reboot:
sudo /sbin/chkconfig
--levels
235
vsftpd on
References:
No comments:
Post a Comment
Thanks for contributing!! Try to keep on topic and please avoid flame wars!!