Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I use chmod to change the permission from -rwsr-xr-x to -rwsr-sr-x?

share|improve this question

migrated from Jul 19 '10 at 21:15

This question came from our site for system and network administrators.

chmod g+s filename
share|improve this answer

yes....the chmod command to use is

 chmod 6755 file1 ... filen
share|improve this answer

Yes, chmod allows any permissions changes on any file you own on a writable medium, including adding setgid. To do this, use:

chmod g+s <file>

The g+s sets the setgid bit on the file.

You can also specify the full permissions of the file:

chmod 6755 <file>

This changes the permissions of the file to -rwsr-sr-x.

In both cases, replace <file> with the actual name of the file. You can perform this operation on multiple files by putting more than one file name on the command line in place of <file>.

For more information on chmod and UNIX filesystem permissions, see the Wikipedia articles on chmod and filesystem permissions.

share|improve this answer

You must log in to answer this question.