% sudo chmod g+s $(which id)
% id -g
0
% sudo chmod g-s $(which id)
% id -g
100
On 29.08.2016 11:33 AM, Sivachidambaram Somu wrote:
> My bad. I have given below the output of the mount command on my machine.
>
> %mount
>
> /dev/xvda1 on / type auto (rw,noatime)
>
> proc on /proc type proc (rw)
>
> sysfs on /sys type sysfs (rw)
>
> devpts on /dev/pts type devpts (rw,gid=5,mode=620)
>
> tmpfs on /dev/shm type tmpfs (rw)
>
> /dev/mapper/ephemeralVG-ephemeral on /local type ext4 (rw) Okay, no "nosuid" option in there, so that's also ruled out.
>
> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
>
> fusectl on /sys/fs/fuse/connections type fusectl (rw)
As a test, set the setgid bit on the id binary like this:
sudo chmod g+s $(which id)
then, as a non-root user(!) run:
id -g
Make sure to disable the setgit bit again with:
sudo chmod g-s $(which id)
If the previous id -g call returned an effective group ID of 0, that means that
setgid functionality should be working on your system. If it's not 0, the reason
for your problems are likely that setgid on files is not working correctly on
your system.
Mihai