JTK – Notes and Ramblings Things we have found …

1/5/2019

Centos FTP server – vsftpd

Filed under: General,Router/PC Config — taing @ 9:33 pm

Using tutorials from https://linuxize.com/post/how-to-setup-ftp-server-with-vsftpd-on-centos-7/ and https://www.tecmint.com/install-ftp-server-in-centos-7/.

Install vsftpd:

yum install vsftpd

Edit /etc/vsftpd/vsftpd.conf:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
listen_address=192.168.0.1
# ip address of the server
listen_ipv6=NO
pam_service_name=vsftpd
userlist_enable=YES
userlist_file=/etc/vsftpd/vsftpd.userlist
userlist_deny=NO
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/ftp
tcp_wrappers=YES

Create a ftp user, add it to /etc/vsftpd/vsftpduserlist and create directories:

adduser newftpuser
passwd newftpuser

echo "newftpuser" | sudo tee -a /etc/vsftpd/user_list

mkdir -p /home/newftpuser/ftp/upload
chmod 550 /home/newftpuser/ftp
chmod 750 /home/newftpuser/ftp/upload
chown -R newftpuser: /home/newftpuser/ftp

usermod newftpuser -s /bin/nologin

Start the server and enable it to run as a daemon at startup:

systemctl start vsftpd
systemctl enable vsftpd

Things should be up and running. This is not a secure server. We did not create a certificate or enable TLS. User credentials will be sent as plain text. The server is only listening on the one specified interface. We did not make any firewall adjustments.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress