How to allow to run su instantly after I added the user to the appropriate group

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












7















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?










share|improve this question
























  • Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

    – cas
    Sep 19 '13 at 1:45















7















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?










share|improve this question
























  • Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

    – cas
    Sep 19 '13 at 1:45













7












7








7








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?










share|improve this question
















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?







permissions su






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 18 '13 at 17:35









Joseph R.

28.1k374114




28.1k374114










asked Sep 18 '13 at 17:12









user4035user4035

5361526




5361526












  • Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

    – cas
    Sep 19 '13 at 1:45

















  • Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

    – cas
    Sep 19 '13 at 1:45
















Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

– cas
Sep 19 '13 at 1:45





Joseph's 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 run newgrp in and which you haven't. It can be simpler/easier to just logout and login again.

– cas
Sep 19 '13 at 1:45










1 Answer
1






active

oldest

votes


















8














Simply have the user run



newgrp wheel


This will start a new shell with the group ID changed to that of wheel. If you want to start a new shell and kill off the previous one, use



exec newgrp wheel


instead.



This is because the kernel still has the previous groupset associated with the currently running processes.






share|improve this answer

























  • How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

    – user4035
    Sep 18 '13 at 18:09












  • @user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

    – Joseph R.
    Sep 18 '13 at 18:21











  • No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

    – user4035
    Sep 18 '13 at 18:29












  • @user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

    – Nils
    Sep 18 '13 at 20:57











  • @Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

    – Joseph R.
    Sep 18 '13 at 21:00










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f91271%2fhow-to-allow-to-run-su-instantly-after-i-added-the-user-to-the-appropriate-group%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









8














Simply have the user run



newgrp wheel


This will start a new shell with the group ID changed to that of wheel. If you want to start a new shell and kill off the previous one, use



exec newgrp wheel


instead.



This is because the kernel still has the previous groupset associated with the currently running processes.






share|improve this answer

























  • How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

    – user4035
    Sep 18 '13 at 18:09












  • @user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

    – Joseph R.
    Sep 18 '13 at 18:21











  • No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

    – user4035
    Sep 18 '13 at 18:29












  • @user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

    – Nils
    Sep 18 '13 at 20:57











  • @Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

    – Joseph R.
    Sep 18 '13 at 21:00















8














Simply have the user run



newgrp wheel


This will start a new shell with the group ID changed to that of wheel. If you want to start a new shell and kill off the previous one, use



exec newgrp wheel


instead.



This is because the kernel still has the previous groupset associated with the currently running processes.






share|improve this answer

























  • How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

    – user4035
    Sep 18 '13 at 18:09












  • @user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

    – Joseph R.
    Sep 18 '13 at 18:21











  • No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

    – user4035
    Sep 18 '13 at 18:29












  • @user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

    – Nils
    Sep 18 '13 at 20:57











  • @Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

    – Joseph R.
    Sep 18 '13 at 21:00













8












8








8







Simply have the user run



newgrp wheel


This will start a new shell with the group ID changed to that of wheel. If you want to start a new shell and kill off the previous one, use



exec newgrp wheel


instead.



This is because the kernel still has the previous groupset associated with the currently running processes.






share|improve this answer















Simply have the user run



newgrp wheel


This will start a new shell with the group ID changed to that of wheel. If you want to start a new shell and kill off the previous one, use



exec newgrp wheel


instead.



This is because the kernel still has the previous groupset associated with the currently running processes.







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 18 '13 at 17:57









peterph

23.4k24457




23.4k24457










answered Sep 18 '13 at 17:19









Joseph R.Joseph R.

28.1k374114




28.1k374114












  • How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

    – user4035
    Sep 18 '13 at 18:09












  • @user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

    – Joseph R.
    Sep 18 '13 at 18:21











  • No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

    – user4035
    Sep 18 '13 at 18:29












  • @user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

    – Nils
    Sep 18 '13 at 20:57











  • @Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

    – Joseph R.
    Sep 18 '13 at 21:00

















  • How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

    – user4035
    Sep 18 '13 at 18:09












  • @user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

    – Joseph R.
    Sep 18 '13 at 18:21











  • No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

    – user4035
    Sep 18 '13 at 18:29












  • @user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

    – Nils
    Sep 18 '13 at 20:57











  • @Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

    – Joseph R.
    Sep 18 '13 at 21:00
















How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

– user4035
Sep 18 '13 at 18:09






How can I run in in graphical terminal emulator? When I run newgrp wheel as a user, it asks for some password. Even when I type root password, it says: Invalid password

– user4035
Sep 18 '13 at 18:09














@user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

– Joseph R.
Sep 18 '13 at 18:21





@user4035 Are we by any chance talking about a networked environment with an authentication mechanism like NIS/LDAP? If that's the case, it may be that the new group associations were not properly propagated to the client machine(s) yet.

– Joseph R.
Sep 18 '13 at 18:21













No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

– user4035
Sep 18 '13 at 18:29






No, it's my local machine. I login as user, then run X Session, then start a terminal and run su there to switch to root. I tried to run "newgrp wheel", but it asks for some password: bash-4.2$ newgrp wheel Password: root password doesn't work

– user4035
Sep 18 '13 at 18:29














@user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

– Nils
Sep 18 '13 at 20:57





@user4035 According to the man-page this will be the password of the user - not the password for root. This is logical, since this is basically the same as a new login.

– Nils
Sep 18 '13 at 20:57













@Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

– Joseph R.
Sep 18 '13 at 21:00





@Nils but a new authentication wouldn't be required if the user account was properly added to the group. At least that's how it is on my Debian box(es).

– Joseph R.
Sep 18 '13 at 21:00

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f91271%2fhow-to-allow-to-run-su-instantly-after-i-added-the-user-to-the-appropriate-group%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)