W
W
WbdT2014-10-25 22:35:06
linux
WbdT, 2014-10-25 22:35:06

How to give a specific user write and read permissions to a specific folder?

How to give a specific user write and read permissions to a specific folder?
That is, so that the user usr1 can read and write only to the / usr1 folder

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Filimonov, 2014-10-25
@DmitryPhilimonov

I'm afraid there's more to your question than you want to hear.
The default access system in Linux is DAC. https://ru.wikipedia.org/wiki/%C8%E7%E1%E8%F0%E0%F...
In your case, you need to grant rights to this folder to this user: chown user:group /usr1.
And assign the ability to change / read it: chmod 700 /usr1
In this case, the group will not be able to read / write there, like everyone else, but the user can. However, this user will be able to access any other resources if they have the appropriate rights.
In your case, paying attention to the question and the name of the directory (usr1), most likely you want to do something strange and with the wrong tool. Maybe you should read about SELinux, maybe chroot will help you (unsafe in certain cases), maybe you need to look towards cgroups / LXC or virtualization.
Write what you want to do. :)

B
bromzh, 2014-10-25
@bromzh

chmod/chown

A
Alexey Cheremisin, 2014-10-26
@leahch

I think that if you need to provide only and exclusively one directory, then it is better to drive this user into a chroot, and for example, lzx, docker or openvz containers will help with this.
Well, for a simple chmod/chown/setattr/setfattr/setfacl, here is an article on the last two and Google to help www.techrepublic.com/blog/linux-and-open-source/le...

P
Pavel, 2016-06-25
@Pavellog

Killed 4 hours to identify the problem, why it was not possible to grant rights to the user. Here I share with you the solution: www.articls.ru/category/linux/ssh_user_access_righ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question