Setup vsftpd » Historie » Revision 2
Revision 1 (Jeremias Keihsler, 04.07.2020 15:37) → Revision 2/3 (Jeremias Keihsler, 04.07.2020 15:42)
h1. Install <pre><code class="bash"> yum install vsftpd </code></pre> h2. create user <pre><code class="bash"> adduser userftp passwd userftp </code></pre> disable the ssh login and enable just for ftp <pre><code class="bash"> usermod -s /sbin/nologin userftp </code></pre> h2. setup config edit @/etc/vsftpd/vsftpd.conf@ <pre> ... anonymous_enable=NO ... local_enable=YES ... chroot_local_user=YES </pre> h2. enable and start service <pre><code class="bash"> systemctl chkconfig vsftpd on /etc/init.d/vsftpd start vsftpd.service systemctl stop vsftpd.service systemctl enable vsftpd.service </code></pre> h2. setup firewall open port 21 <pre><code class="bash"> iptables --list iptables -I INPUT 1 -p tcp --dport 21 -j ACCEPT /etc/init.d/iptables save </code></pre> h2. troubleshoot if you can connect but get a @500 OOPS: cannot change directory@ most likely this is due to the fact that Selinux doesn't allow access to the users home-directory. You can fix this by: <pre><code class="bash"> setsebool -P ftp_home_dir 1 </code></pre>