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

Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
Joseph'snewgrpanswer 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 runnewgrpin and which you haven't. It can be simpler/easier to just logout and login again.
– cas
Sep 19 '13 at 1:45
add a comment |
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
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
permissions su
edited Sep 18 '13 at 17:35
Joseph R.
28.1k374114
28.1k374114
asked Sep 18 '13 at 17:12
user4035user4035
5361526
5361526
Joseph'snewgrpanswer 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 runnewgrpin and which you haven't. It can be simpler/easier to just logout and login again.
– cas
Sep 19 '13 at 1:45
add a comment |
Joseph'snewgrpanswer 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 runnewgrpin 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
add a comment |
1 Answer
1
active
oldest
votes
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.
How can I run in in graphical terminal emulator? When I runnewgrp wheelas 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 runsuthere 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
|
show 9 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
How can I run in in graphical terminal emulator? When I runnewgrp wheelas 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 runsuthere 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
|
show 9 more comments
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.
How can I run in in graphical terminal emulator? When I runnewgrp wheelas 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 runsuthere 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
|
show 9 more comments
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.
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.
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 runnewgrp wheelas 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 runsuthere 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
|
show 9 more comments
How can I run in in graphical terminal emulator? When I runnewgrp wheelas 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 runsuthere 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
|
show 9 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Joseph's
newgrpanswer 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 runnewgrpin and which you haven't. It can be simpler/easier to just logout and login again.– cas
Sep 19 '13 at 1:45