T
T
Triglav772020-09-23 10:47:32
linux
Triglav77, 2020-09-23 10:47:32

How to change folder permissions with sudo?

Good afternoon.

There is ssh access, tell me how to change the rights for a certain folder through sudo, since the folders were not made by me and I cannot change the rights. Respectively edit and upload files too.

I used this command: chmod -R ug+rw srv/test/

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
irishmann, 2020-09-23
@irishmann

Sometimes it is enough to google
https://linuxway.ru/pervye-shagi/komanda-chmod-pri...

V
Vladimir, 2020-09-23
@Casufi

sudo chmod

A
Anatoly D, 2020-09-23
@imurd

FOR EXAMPLE sudo chmod -R 777 the folder name //-R is a recursion (the same rights are given to everything nested in this folder).
777 is a combination of permission bits:
read (R=4)
write (W=2)
and execute (X=1)
4+2+1 =7
Why is 7 not one but 3 at once?
The first 7 allows all these actions for a specific user, the second seven for a group of users, and the third for other users. Arbitrary combinations of these parameters are possible, for example 755, 744, 111, etc. Also, sometimes an additional symbol is put in these parameters - stickybit.
Before giving exactly FULL rights (777) to a folder, you need to think very carefully.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question