Posts Tagged "chroot local user=YES chroot list enable=YES"

vsftpd Ubuntu 12.04 Install and Add Secure User

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

[cc]sudo apt-get install vsftpd[/cc]

[cc]sudo nano /etc/vsftpd.conf[/cc]

Uncomment the Following:
[cc]
write_enable=YES
local_umask=022
[/cc]

Add to end of the file:

[cc]

# 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[/cc]

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

[cc]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
[/cc]

Add new user to vsftpd

[cc]
nano /etc/vsftpd.userlist[/cc]

Add “ftpuser” to this file

[cc]nano /etc/shells[/cc]

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

[cc]addgroup ftpusers

sudo usermod -Gftpusers ftpuser

service vsftpd restart
[/cc]

BONUS:

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

[cc]
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
[/cc]

Add “ftpuser” to this file

[cc]nano /etc/vsftpd.chroot[/cc]

Questions?  Hit up the comments.

 

Read More