VSFTPD SETUP

From rbachwiki
Revision as of 20:45, 8 August 2016 by Bacchas (talk | contribs) (Created page with "== setting up vsftpd users and groups == <pre> Install vsftpd apt-get install vsftpd 4) Create a user group and shared directory. In this case, use /home/ftp-users and a user...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

setting up vsftpd users and groups

Install vsftpd

apt-get install vsftpd
4) Create a user group and shared directory. In this case, use /home/ftp-users and a user group name of ftp-users for the remote users
[root@bigboy tmp]# groupadd ftp-users
[root@bigboy tmp]# mkdir /home/ftp-docs
 5) Make the directory accessible to the ftp-users group.

[root@bigboy tmp]# chmod 750 /home/ftp-docs
[root@bigboy tmp]# chown root:ftp-users /home/ftp-docs
6) Add users, and make their default directory /home/ftp-docs
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user1
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user2
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user3
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user4
[root@bigboy tmp]# passwd user1
[root@bigboy tmp]# passwd user2
[root@bigboy tmp]# passwd user3
[root@bigboy tmp]# passwd user4
 /etc/vsftpd.conf  - configuration file

Local_enable=yes
write_enable=Yes
chroot_list_enable=Yes - this jails users on the list to their home dir
chroot_list_file=/etc/vsftpd.chroot_list

if the vsftpd.chroot_list file does not exist then create it and add the users to that list

To add a user to a specific group

usermod -G name-of-group -a name-of-user

 **/ must be applied otherwise you won't be able to save to dir

 chgrp -R ftp-users /var/www/site 
change the ownership of this directory to group 'ftp-users' and everything inside of it (-R = recursive). The person issuing this command must own all the files or it will fail.

 chmod -R g+rw /var/www/site
give group read write access to this directory, and everything inside of it (-R = recursive)

listing all groups

cat /etc/group

Listing groups a current user belongs to

groups robert

  *** Restart system or vftpd service after changes otherwise it permissions won't work