12

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.

tckmn
  • 57,719
  • 27
  • 114
  • 156
Roman
  • 337
  • 1
  • 3
  • 12

2 Answers2

21

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/
Andy
  • 49,085
  • 60
  • 166
  • 233
7

Yes : -R means recursive. Remove -R

user2196728
  • 2,915
  • 3
  • 16
  • 15