0

I have three different users in a Ubuntu Server 18.04.4:

ls -la /home
total 28
drwxr-xr-x  7 root          root          4096 Mar  6 17:17 .
drwxr-xr-x 25 root          root          4096 Mar  4 15:06 ..
drwxr-xr-x  2 Acap          Acap          4096 Mar  6 17:17 Acap
drwxr-xr-x  5 administrator administrator 4096 Mar  6 17:08 administrator
drwxr-xr-x  2 Dgaiec        Dgaiec        4096 Mar  6 17:25 Dgaiec
drwxr-xr-x  4 ipt           ipt           4096 Feb 26 18:34 ipt
drwxr-xr-x  5 sivhappftp    sivhappftp    4096 Mar  6 17:06 sivhappftp

My vsftpd.conf file is the following:

~$ cat /etc/vsftpd.conf      
listen=YES
#listen_ipv6=NO
connect_from_port_20=YES

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_umask=022
user_sub_token=$USER
local_root=/home/$USER/sivh
allow_writeable_chroot=YES
secure_chroot_dir=/var/run/vsftpd/empty

pam_service_name=vsftpd

pasv_enable=YES
pasv_min_port=40000
pasv_max_port=45000

userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

The vsftpd.userlist is:

~$ cat /etc/vsftpd.userlist          
sivhappftp
Dgaiec
Acap

My query is the following, how to I get to allow the Dgaiec and Acap users access the sivhappftp chroot enviroment? I don't want, when they login to the server, to enter their respective chroots environments but to navigate directly into the sivhappftp chroot enviroment.

1 Answer 1

0

I've managed to achieve what I need by mounting the needed directory using the --bind parameter:

mkdir /home/ftp_user/sivh/
sudo mount --bind /home/sivhappftp/sivh/ftp_user/ /home/ftp_user/sivh/

After this each ftp user will be able to see the needed files in his home directory and use them in his ftp client as if they were local files.

Made this configuration permanent including a line, for each, in /etc/fstab:

/home/sivhappftp/sivh/ftp_user/   /home/ftp_user/sivh/      none    bind    0       0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .