I have the su
executable with the following permissions:
bash-4.2# ls -la /bin/su
-rws--s--- 1 root wheel 59930 Sep 14 2012 ./su
When I am logged in as a user, not in the wheel
group and try to run su
, I get an error, which is correct:
bash-4.2$ su
bash: /bin/su: Permission denied
After that I add this user to wheel
group from root
:
bash-4.2# usermod -a -G wheel user
But for the same terminal session I still can't run su
:
bash-4.2$ su
bash: /bin/su: Permission denied
For the new sessions I can run su
.
How to allow to run su
instantly after I added the user to the appropriate group?
newgrp
answer is correct - but it applies ONLY to the shell that you run it in, so if you have multiple shells running it's easy to forget which you've runnewgrp
in and which you haven't. It can be simpler/easier to just logout and login again. – cas Sep 19 '13 at 01:45