In my ubuntu 14.04 lts, I tried setgid command as root user but it give setgid not found, for setuid it says to install and I install . But for setgid it does not give any option. So how can I get this command in linux ubuntu 14.04 LTS
We can use chmod to set the setuid bit. Like with other permissions, it can be done symbolically or using octal values (numbers 0-7). To set the setuid bit symbolically, we can use chmod u+s </path/to/the/file>.
Setting the SUID Bit The u+s symbolic mode sets the SUID bit and the u-s symbolic mode clears the SUID bit.
This bit is present for files which have executable permissions. The setuid bit simply indicates that when running the executable, it will set its permissions to that of the user who created it (owner), instead of setting it to the user who launched it.
The sticky bit can be set using the chmod command and can be set using its octal mode 1000 or by its symbol t (s is already used by the setuid bit). For example, to add the bit on the directory /usr/local/tmp , one would type chmod +t /usr/local/tmp .
When the setgid bit is set on a directory, new sub folders and files within that directory will inherit the group of the owner of the directory. If you do this on a folder, you can force new files and folders to have your group id, even if another user does the creation.
You can turn the setgid bit on by running:
chmod g+s <directory name here>
The user and group can be displayed using in the parent directory.
ls -l
See: http://www.toptip.ca/2010/03/linux-setgid-on-directory.html
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