linux command - lock folder name/rename

Asked

Viewed 472 times

4

need to give access to an ftp user in the /var/www folder but there are folders there that it cannot access/edit/delete

tried a command:

#chmod 000 <pasta>

almost worked, it does not delete, does not access, however it can do Name in the folder, is there a way for it not to do Name ?

2 answers

6


There is a procedure that can solve your problem

chmod 000 chattr +i -R

with chattr +i this code nor root can make changes to its folder and attributes. The -R is to make it recursive.

to undo is the following code

chattr -i -R

some legal links:

5 chattr uteis

Other explanations

0

If he owns the folder he will always be able to rename it, as he will also always be able to change the permissions of the folder. I suggest you change the folder owner to another user and put the permissions you want in a group. Make sure that the user you want to give the permissions belongs to this same group.

  • the owner of the folder is root dou a ls -lha p/ you understand codigo d--------- 2 root root 4.0K Apr 10 09:48 zzz even though the owner is root and even the user is not part of a group he can rename the folder

Browser other questions tagged

You are not signed in. Login or sign up in order to post.