Tag

cc nano /etc/vsftpd.userlist

vsftpd Ubuntu 12.04 Install and Add Secure User

By | Sample Work | No Comments

60 Second Install. 3 – 2 – 1 – GO!

sudo apt-get install vsftpd

sudo nano /etc/vsftpd.conf

Uncomment the Following:

write_enable=YES
local_umask=022

Add to end of the file:


# the list of users to give access
userlist_file=/etc/vsftpd.userlist
# this list is on
userlist_enable=YES
# It is not a list of users to deny ftp access
userlist_deny=NO

Setup the user, replace /path/to/your/dir

useradd -d /path/to/your/dir -s /usr/sbin/nologin ftpuser
passwd ftpuser
chown -R ftpuser /path/to/your/dir
chmod 775 /path/to/your/dir

Add new user to vsftpd

nano /etc/vsftpd.userlist

Add “ftpuser” to this file

nano /etc/shells

Add “/usr/sbin/nologin” to this file

addgroup ftpusers

sudo usermod -Gftpusers ftpuser

service vsftpd restart

BONUS:

You can chroot users by uncommenting this section of vsftpd.conf file:

chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

Add “ftpuser” to this file

nano /etc/vsftpd.chroot

Questions?  Hit up the comments.