by assigning 775 rights of user to a folder (project) does that impact the files permissions under the folder?
# chown -R root:user1 /var/www/project/
# chmod 775 -R /var/www/project/
Meaning, if /project/config.html
used to have a 664 right does that mean that 664 right disappears and grants 775?
How to avoid this to happen? There are files and folders with different rights under /project/
and I do not want these to be overridden.
Changing permissions with chmod To modify the permission flags on existing files and directories, use the chmod command ("change mode"). It can be used for individual files or it can be run recursively with the -R option to change permissions for all of the subdirectories and files within a directory.
To change directory permissions for everyone, use “u” for users, “g” for group, “o” for others, and “ugo” or “a” (for all). chmod ugo+rwx foldername to give read, write, and execute to everyone. chmod a=r foldername to give only read permission for everyone.
chmod Codes. We can use symbolic code plus (+) to add permissions and use minus (–) to remove permissions. Therefore, to give read permission we use +r. In addition, we use +w to give write permission and +x to give execute permission.
Remove the -R
flag. That means it changes all files and folders in the subdirectory as well.
# chown root:user1 /var/www/project/
# chmod 775 /var/www/project/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With