I
I
Ilya Rodionov2018-07-30 18:31:05
FTP
Ilya Rodionov, 2018-07-30 18:31:05

Ftp access to only one directory?

Actually, the question is in the header.
Is it possible to give FTP access to only one folder on the server? Those. for example only to /var/www/site1? Because so far it turns out like this: even if I give access to the site1 folder, a user without write permissions can still walk through all directories, even in /, /var, /home, etc.
Is it possible to somehow limit this? So that /var/www/site1 is considered the root directory for it? Or is this only possible in docker?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-07-30
@ZloyKishechnik

If you have VSFTPD, then configure your user in etc/vsftpd/vsftpd.conf:
chroot_local_user=NO
chroot_list_enable=YES
Specify the user name in the file
chroot_list_file=/etc/vsftpd.chroot_list the
user will be locked in his home folder.
You can immediately set /etc/passwd to it /var/www/site1 as a home folder
PS If you set chroot_local_user=YES in the FTP server settings, then all users EXCEPT those listed in /etc/vsftpd.chroot_list will be locked in their home directories

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question