D
D
Dextor232020-03-01 14:36:00
linux
Dextor23, 2020-03-01 14:36:00

How to create a sftp user for a specific directory with truncated rights?

Hello. Can you please tell me how to create an ftp or sftp user with limited rights on debian?
The bottom line is, you need to give another user a limited ability to work with (certain files in folders)
In other words, how to make user123 able to connect to a machine that will only have 2 folders available for him
/var/www/site.ru/templete/
/var/www/site.ru/class/
At the same time, everything else is closed and inaccessible to him, and these folders and the contents of these folders are available for editing

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Karpion, 2020-03-02
@Karpion

First, we find out which daemon (or different daemons) is serving these protocols. We read the manuals, find out what options to lock the user in the /var/www/site.ru directory
. Then we create a certain group with an arbitrary name. We start the user user123 in this group. We assign this group to the folders templete (it seems that this word is spelled differently) and class. We give this group permission to write to these folders and to all files inside. We make sure that other folders and files do not give access to either this group or "everyone else - other - the third group of access attributes". But the right to read, it seems to me, he will have to leave.
Or it is possible to make access through ACL. But I didn't, I need to figure it out.

A
Anatoly, 2020-03-02
@Tolly

chown + chmod

R
Reikoemco, 2020-03-05
@Reikoemco

According to this guide, I once did a similar task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question