0

How to add an existent security group to a folder with the read/write permissions?

Kalle Richter
  • 6,180
  • 21
  • 70
  • 103

1 Answers1

0

A file or directory can only have one group associated with it.

You change that group from the terminal using this command:

chgrp GROUPNAME FILENAME

Of course you have to replace GROUPNAME with the desired group and FILENAME with the file or directory you want to modify. Depending on your current permissions for this file, you might have to run the command as root (using sudo).

Byte Commander
  • 107,489
  • Thank you very much for your answer. So I assume that the group will be on raw by default? – Med Achref Mar 22 '16 at 17:01
  • I don't know what you mean by "on raw". By default, the owner is the user that created the file and the group is that user's native group (same name as username). – Byte Commander Mar 22 '16 at 17:05
  • And if this answer solves your problem, please accept it by clicking the round grey tick symbol on the left of it to mark your question as solved. – Byte Commander Mar 22 '16 at 17:05
  • Sorry about that, I mean "r/w" not raw. – Med Achref Mar 22 '16 at 17:10
  • The group and the group permissions are slightly different. The group is the actual name of the user group that a file is associated with. The group permissions describe the read/write/execute permissions for this file for members of the associated group. The default group is the native group of the user who created the file. The default group permissions of a new file a normal user creates is 'rwx', when root creates a file it's 'r-x'. You find out what permissions a new file created by your current user would get using the command umask -S. – Byte Commander Mar 22 '16 at 17:16