Answer the question
In order to leave comments, you need to log in
How to give access only to a certain folder and nowhere else?
Good day.
I don’t have much experience with servers, but now it became necessary to provide FTP access to a certain folder for editing and nowhere else.
Folder where to give access to /var/www/site_dev/assets.
I made a new user, in the sshd_config folder I registered
Match group newusernamegroup
ChrootDirectory /home/%u/
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
Register in ChrootDirectory /var/www/site_dev/assets. I can't, because many groups of users need write permissions to /var/www/.
There is an option to take files from /home/%u/ with cron every second and shuffle them into the end folder, but this is somehow not correct.
ubuntu server.
Thanks
Answer the question
In order to leave comments, you need to log in
Register in ChrootDirectory /var/www/site_dev/assets. I can't, because many groups of users need write permissions to /var/www/.I do not quite understand how the rights of other users are connected with Chroot'om, in your case ... Well, that's not the point.
There is an option to take files from /home/%u/ with cron every second and shuffle them into the end folder, but this is somehow not correct.Cron initially runs 1 time per minute (minimum) and is not well suited to doing something every second. In this case, it would be easier to write a script with an infinite loop and not croon at least 60 jobs (so that they run in a second). And if it’s more correct, use some kind of synchronization system for this, for example, Rsync .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question