Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set setgid in ubuntu

Tags:

linux

ubuntu

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

like image 545
agarwal_achhnera Avatar asked Aug 13 '14 12:08

agarwal_achhnera


People also ask

How do I enable setuid?

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>.

How do you set a SUID bit?

Setting the SUID Bit The u+s symbolic mode sets the SUID bit and the u-s symbolic mode clears the SUID bit.

What is Linux setgid 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.

How do I set sticky bit permissions in Linux?

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 .


1 Answers

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

like image 98
csnate Avatar answered Oct 21 '22 08:10

csnate