sudo su - anotherusername not prompting for password
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am new to Redhat linux. I am trying to run the following command and would like to know why it is not prompting for password?
Here is what I am doing. I open the terminal window and enter my username and password. After that I run the following command
sudo su - anotherusername
The command runs successfully without prompting for password of anotherusername. I want to know why I don't get password prompt?
Are there any circumstances where I will get password prompt for anotherusername?
Or Is there a different command that will prompt me for anotherusername password?
I mistakenly posted this question in StackOverflow https://stackoverflow.com/questions/46632690/sudo-su-username-not-prompting-for-password
and I was told that if my username is part of sudoers group then I will not get password prompt.
Just want to confirm if that is the only reason or there are other reasons as well for not receiving password prompt.
I will really appreciate your help.
linux shell sudo
add a comment |Â
up vote
1
down vote
favorite
I am new to Redhat linux. I am trying to run the following command and would like to know why it is not prompting for password?
Here is what I am doing. I open the terminal window and enter my username and password. After that I run the following command
sudo su - anotherusername
The command runs successfully without prompting for password of anotherusername. I want to know why I don't get password prompt?
Are there any circumstances where I will get password prompt for anotherusername?
Or Is there a different command that will prompt me for anotherusername password?
I mistakenly posted this question in StackOverflow https://stackoverflow.com/questions/46632690/sudo-su-username-not-prompting-for-password
and I was told that if my username is part of sudoers group then I will not get password prompt.
Just want to confirm if that is the only reason or there are other reasons as well for not receiving password prompt.
I will really appreciate your help.
linux shell sudo
1
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
1
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am new to Redhat linux. I am trying to run the following command and would like to know why it is not prompting for password?
Here is what I am doing. I open the terminal window and enter my username and password. After that I run the following command
sudo su - anotherusername
The command runs successfully without prompting for password of anotherusername. I want to know why I don't get password prompt?
Are there any circumstances where I will get password prompt for anotherusername?
Or Is there a different command that will prompt me for anotherusername password?
I mistakenly posted this question in StackOverflow https://stackoverflow.com/questions/46632690/sudo-su-username-not-prompting-for-password
and I was told that if my username is part of sudoers group then I will not get password prompt.
Just want to confirm if that is the only reason or there are other reasons as well for not receiving password prompt.
I will really appreciate your help.
linux shell sudo
I am new to Redhat linux. I am trying to run the following command and would like to know why it is not prompting for password?
Here is what I am doing. I open the terminal window and enter my username and password. After that I run the following command
sudo su - anotherusername
The command runs successfully without prompting for password of anotherusername. I want to know why I don't get password prompt?
Are there any circumstances where I will get password prompt for anotherusername?
Or Is there a different command that will prompt me for anotherusername password?
I mistakenly posted this question in StackOverflow https://stackoverflow.com/questions/46632690/sudo-su-username-not-prompting-for-password
and I was told that if my username is part of sudoers group then I will not get password prompt.
Just want to confirm if that is the only reason or there are other reasons as well for not receiving password prompt.
I will really appreciate your help.
linux shell sudo
linux shell sudo
edited Oct 9 '17 at 0:12
asked Oct 8 '17 at 16:33
jbl
63
63
1
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
1
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04
add a comment |Â
1
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
1
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04
1
1
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
1
1
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
sudo su
runs su
as root
; thus there is no need for su
to ask a password.
The question might be why sudo
does not ask for a password (the invoking user's or root
's). The output of sudo -l
may explain that. Or sudo
has been invoked before and considers the formerly entered password still valid.
add a comment |Â
up vote
0
down vote
Try searching for the username of the user running the sudo command in /etc/sudoers
:
$ sudo grep yourusername /etc/sudoers
yourusername ALL=(ALL) NOPASSWD: ALL
If the output of that grep
command contains NOPASSWD:
, then use the visudo
command to edit and remove the NOPASSWD:
from that line.
Also, you'll be prompted for the password of the user running the sudo
command, not the password of the account that you're trying to login to.
sudo -iu anotherusername
would be somewhat easier, though
â roaima
Oct 8 '17 at 20:56
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
sudo su
runs su
as root
; thus there is no need for su
to ask a password.
The question might be why sudo
does not ask for a password (the invoking user's or root
's). The output of sudo -l
may explain that. Or sudo
has been invoked before and considers the formerly entered password still valid.
add a comment |Â
up vote
2
down vote
sudo su
runs su
as root
; thus there is no need for su
to ask a password.
The question might be why sudo
does not ask for a password (the invoking user's or root
's). The output of sudo -l
may explain that. Or sudo
has been invoked before and considers the formerly entered password still valid.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
sudo su
runs su
as root
; thus there is no need for su
to ask a password.
The question might be why sudo
does not ask for a password (the invoking user's or root
's). The output of sudo -l
may explain that. Or sudo
has been invoked before and considers the formerly entered password still valid.
sudo su
runs su
as root
; thus there is no need for su
to ask a password.
The question might be why sudo
does not ask for a password (the invoking user's or root
's). The output of sudo -l
may explain that. Or sudo
has been invoked before and considers the formerly entered password still valid.
edited Oct 8 '17 at 17:03
Jeff Schaller
32.3k849109
32.3k849109
answered Oct 8 '17 at 16:38
Hauke Laging
53.7k1282130
53.7k1282130
add a comment |Â
add a comment |Â
up vote
0
down vote
Try searching for the username of the user running the sudo command in /etc/sudoers
:
$ sudo grep yourusername /etc/sudoers
yourusername ALL=(ALL) NOPASSWD: ALL
If the output of that grep
command contains NOPASSWD:
, then use the visudo
command to edit and remove the NOPASSWD:
from that line.
Also, you'll be prompted for the password of the user running the sudo
command, not the password of the account that you're trying to login to.
sudo -iu anotherusername
would be somewhat easier, though
â roaima
Oct 8 '17 at 20:56
add a comment |Â
up vote
0
down vote
Try searching for the username of the user running the sudo command in /etc/sudoers
:
$ sudo grep yourusername /etc/sudoers
yourusername ALL=(ALL) NOPASSWD: ALL
If the output of that grep
command contains NOPASSWD:
, then use the visudo
command to edit and remove the NOPASSWD:
from that line.
Also, you'll be prompted for the password of the user running the sudo
command, not the password of the account that you're trying to login to.
sudo -iu anotherusername
would be somewhat easier, though
â roaima
Oct 8 '17 at 20:56
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Try searching for the username of the user running the sudo command in /etc/sudoers
:
$ sudo grep yourusername /etc/sudoers
yourusername ALL=(ALL) NOPASSWD: ALL
If the output of that grep
command contains NOPASSWD:
, then use the visudo
command to edit and remove the NOPASSWD:
from that line.
Also, you'll be prompted for the password of the user running the sudo
command, not the password of the account that you're trying to login to.
Try searching for the username of the user running the sudo command in /etc/sudoers
:
$ sudo grep yourusername /etc/sudoers
yourusername ALL=(ALL) NOPASSWD: ALL
If the output of that grep
command contains NOPASSWD:
, then use the visudo
command to edit and remove the NOPASSWD:
from that line.
Also, you'll be prompted for the password of the user running the sudo
command, not the password of the account that you're trying to login to.
edited Oct 10 '17 at 1:07
answered Oct 8 '17 at 17:28
L.Ray
1968
1968
sudo -iu anotherusername
would be somewhat easier, though
â roaima
Oct 8 '17 at 20:56
add a comment |Â
sudo -iu anotherusername
would be somewhat easier, though
â roaima
Oct 8 '17 at 20:56
sudo -iu anotherusername
would be somewhat easier, thoughâ roaima
Oct 8 '17 at 20:56
sudo -iu anotherusername
would be somewhat easier, thoughâ roaima
Oct 8 '17 at 20:56
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396868%2fsudo-su-anotherusername-not-prompting-for-password%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
Tangentially related: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Oct 8 '17 at 16:39
1
Possibly: unix.stackexchange.com/q/382060/117549
â Jeff Schaller
Oct 8 '17 at 17:04