Allowing `sudo su` without password over Ubuntu [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
Allowing a user to use sudo without a password
2 answers
This question is answered a number of times in the net, but none of those answer resulted useful in my case.
The problem
Accessing a remote machine using private key, I usually require root permissions, which imply writing a long password and is annoying.
For the purpose of having sudo su
, I tried following steps:
- Ensure the line
<user> ALL=(ALL) NOPASSWD: ALL
is in /etc/sudoers - Ensure the user is in
sudo
user group:$groups <user>
-> sudo
But trying sudo su
will just prompt me for my own password: [sudo] password for <user>:
The question
How to have password-less sudo su
?
sudo password
marked as duplicate by Kiwy, Jesse_b, Jeff Schaller, G-Man, SatÃ
 Katsura Feb 27 at 7:55
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
 |Â
show 1 more comment
up vote
0
down vote
favorite
This question already has an answer here:
Allowing a user to use sudo without a password
2 answers
This question is answered a number of times in the net, but none of those answer resulted useful in my case.
The problem
Accessing a remote machine using private key, I usually require root permissions, which imply writing a long password and is annoying.
For the purpose of having sudo su
, I tried following steps:
- Ensure the line
<user> ALL=(ALL) NOPASSWD: ALL
is in /etc/sudoers - Ensure the user is in
sudo
user group:$groups <user>
-> sudo
But trying sudo su
will just prompt me for my own password: [sudo] password for <user>:
The question
How to have password-less sudo su
?
sudo password
marked as duplicate by Kiwy, Jesse_b, Jeff Schaller, G-Man, SatÃ
 Katsura Feb 27 at 7:55
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
did you restart the Ubuntu machine or at least thesudo service
(something likesudo service sudo restart
) after you updated the the config file?
â Yaron
Feb 26 at 10:27
2
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
never use ` sudo su` please use eithersudo -i
orsudo su -
if you usesudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward.sudo -i
andsudo su -
will unload you profil and load only root env variable
â Kiwy
Feb 26 at 10:32
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Related, aboutsudo su
: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Feb 26 at 10:53
 |Â
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
Allowing a user to use sudo without a password
2 answers
This question is answered a number of times in the net, but none of those answer resulted useful in my case.
The problem
Accessing a remote machine using private key, I usually require root permissions, which imply writing a long password and is annoying.
For the purpose of having sudo su
, I tried following steps:
- Ensure the line
<user> ALL=(ALL) NOPASSWD: ALL
is in /etc/sudoers - Ensure the user is in
sudo
user group:$groups <user>
-> sudo
But trying sudo su
will just prompt me for my own password: [sudo] password for <user>:
The question
How to have password-less sudo su
?
sudo password
This question already has an answer here:
Allowing a user to use sudo without a password
2 answers
This question is answered a number of times in the net, but none of those answer resulted useful in my case.
The problem
Accessing a remote machine using private key, I usually require root permissions, which imply writing a long password and is annoying.
For the purpose of having sudo su
, I tried following steps:
- Ensure the line
<user> ALL=(ALL) NOPASSWD: ALL
is in /etc/sudoers - Ensure the user is in
sudo
user group:$groups <user>
-> sudo
But trying sudo su
will just prompt me for my own password: [sudo] password for <user>:
The question
How to have password-less sudo su
?
This question already has an answer here:
Allowing a user to use sudo without a password
2 answers
sudo password
edited Feb 26 at 11:25
asked Feb 26 at 10:21
Adrian Maire
294417
294417
marked as duplicate by Kiwy, Jesse_b, Jeff Schaller, G-Man, SatÃ
 Katsura Feb 27 at 7:55
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Kiwy, Jesse_b, Jeff Schaller, G-Man, SatÃ
 Katsura Feb 27 at 7:55
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
did you restart the Ubuntu machine or at least thesudo service
(something likesudo service sudo restart
) after you updated the the config file?
â Yaron
Feb 26 at 10:27
2
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
never use ` sudo su` please use eithersudo -i
orsudo su -
if you usesudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward.sudo -i
andsudo su -
will unload you profil and load only root env variable
â Kiwy
Feb 26 at 10:32
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Related, aboutsudo su
: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Feb 26 at 10:53
 |Â
show 1 more comment
did you restart the Ubuntu machine or at least thesudo service
(something likesudo service sudo restart
) after you updated the the config file?
â Yaron
Feb 26 at 10:27
2
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
never use ` sudo su` please use eithersudo -i
orsudo su -
if you usesudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward.sudo -i
andsudo su -
will unload you profil and load only root env variable
â Kiwy
Feb 26 at 10:32
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Related, aboutsudo su
: unix.stackexchange.com/questions/218169/â¦
â Kusalananda
Feb 26 at 10:53
did you restart the Ubuntu machine or at least the
sudo service
(something like sudo service sudo restart
) after you updated the the config file?â Yaron
Feb 26 at 10:27
did you restart the Ubuntu machine or at least the
sudo service
(something like sudo service sudo restart
) after you updated the the config file?â Yaron
Feb 26 at 10:27
2
2
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
never use ` sudo su` please use either
sudo -i
or sudo su -
if you use sudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward. sudo -i
and sudo su -
will unload you profil and load only root env variableâ Kiwy
Feb 26 at 10:32
never use ` sudo su` please use either
sudo -i
or sudo su -
if you use sudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward. sudo -i
and sudo su -
will unload you profil and load only root env variableâ Kiwy
Feb 26 at 10:32
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Related, about
sudo su
: unix.stackexchange.com/questions/218169/â¦â Kusalananda
Feb 26 at 10:53
Related, about
sudo su
: unix.stackexchange.com/questions/218169/â¦â Kusalananda
Feb 26 at 10:53
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
1
down vote
I often place it below the line
# User privilege specification
root ALL=(ALL:ALL) ALL
+++ myuser ALL=(ALL) NOPASSWD: ALL
The better way is to use an own file in /etc/sudoers.d with the line above.
If you would like to use the group policy, you need to modify the line for your group
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Otherwise the group policy will overwrite your user policy and you will be asked for the password.
And an other hint:
Please don't use "sudo su". Instead use sudo su -
or sudo -i
. This will unload your env and load the one of root, avoiding to use bad env variable from your account with root.
add a comment |Â
up vote
1
down vote
Your sudoers file has something that already grants you the ability to run sudo su
(or possibly any commands), but does not include the NOPASSWD:
option.
Ordering within the sudoers file is important: last match wins.
You can use sudo -l
to list all the sudo Defaults
options and all the allowed commands for your user account.
sudo -l return :(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I often place it below the line
# User privilege specification
root ALL=(ALL:ALL) ALL
+++ myuser ALL=(ALL) NOPASSWD: ALL
The better way is to use an own file in /etc/sudoers.d with the line above.
If you would like to use the group policy, you need to modify the line for your group
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Otherwise the group policy will overwrite your user policy and you will be asked for the password.
And an other hint:
Please don't use "sudo su". Instead use sudo su -
or sudo -i
. This will unload your env and load the one of root, avoiding to use bad env variable from your account with root.
add a comment |Â
up vote
1
down vote
I often place it below the line
# User privilege specification
root ALL=(ALL:ALL) ALL
+++ myuser ALL=(ALL) NOPASSWD: ALL
The better way is to use an own file in /etc/sudoers.d with the line above.
If you would like to use the group policy, you need to modify the line for your group
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Otherwise the group policy will overwrite your user policy and you will be asked for the password.
And an other hint:
Please don't use "sudo su". Instead use sudo su -
or sudo -i
. This will unload your env and load the one of root, avoiding to use bad env variable from your account with root.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I often place it below the line
# User privilege specification
root ALL=(ALL:ALL) ALL
+++ myuser ALL=(ALL) NOPASSWD: ALL
The better way is to use an own file in /etc/sudoers.d with the line above.
If you would like to use the group policy, you need to modify the line for your group
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Otherwise the group policy will overwrite your user policy and you will be asked for the password.
And an other hint:
Please don't use "sudo su". Instead use sudo su -
or sudo -i
. This will unload your env and load the one of root, avoiding to use bad env variable from your account with root.
I often place it below the line
# User privilege specification
root ALL=(ALL:ALL) ALL
+++ myuser ALL=(ALL) NOPASSWD: ALL
The better way is to use an own file in /etc/sudoers.d with the line above.
If you would like to use the group policy, you need to modify the line for your group
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Otherwise the group policy will overwrite your user policy and you will be asked for the password.
And an other hint:
Please don't use "sudo su". Instead use sudo su -
or sudo -i
. This will unload your env and load the one of root, avoiding to use bad env variable from your account with root.
edited Feb 26 at 10:35
Kiwy
5,36743350
5,36743350
answered Feb 26 at 10:29
Marc
3343
3343
add a comment |Â
add a comment |Â
up vote
1
down vote
Your sudoers file has something that already grants you the ability to run sudo su
(or possibly any commands), but does not include the NOPASSWD:
option.
Ordering within the sudoers file is important: last match wins.
You can use sudo -l
to list all the sudo Defaults
options and all the allowed commands for your user account.
sudo -l return :(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
add a comment |Â
up vote
1
down vote
Your sudoers file has something that already grants you the ability to run sudo su
(or possibly any commands), but does not include the NOPASSWD:
option.
Ordering within the sudoers file is important: last match wins.
You can use sudo -l
to list all the sudo Defaults
options and all the allowed commands for your user account.
sudo -l return :(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Your sudoers file has something that already grants you the ability to run sudo su
(or possibly any commands), but does not include the NOPASSWD:
option.
Ordering within the sudoers file is important: last match wins.
You can use sudo -l
to list all the sudo Defaults
options and all the allowed commands for your user account.
Your sudoers file has something that already grants you the ability to run sudo su
(or possibly any commands), but does not include the NOPASSWD:
option.
Ordering within the sudoers file is important: last match wins.
You can use sudo -l
to list all the sudo Defaults
options and all the allowed commands for your user account.
answered Feb 26 at 10:47
telcoM
10.7k11132
10.7k11132
sudo -l return :(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
add a comment |Â
sudo -l return :(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
sudo -l return :
(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
sudo -l return :
(ALL : ALL) ALL
â Adrian Maire
Feb 26 at 11:20
add a comment |Â
did you restart the Ubuntu machine or at least the
sudo service
(something likesudo service sudo restart
) after you updated the the config file?â Yaron
Feb 26 at 10:27
2
It is a bad idea to have no password for sudo?
â George Udosen
Feb 26 at 10:28
never use ` sudo su` please use either
sudo -i
orsudo su -
if you usesudo su
your user variable such as PATH or aliases are more likely to be corrupted will be usable as root. If someone can corrupt your profil it might inject some env variable able to give him root access afterward.sudo -i
andsudo su -
will unload you profil and load only root env variableâ Kiwy
Feb 26 at 10:32
Its a common way for automated processes, so why not? Yeah, you could make it only for special commands, but for development its okay. As long as there is no security audit ;)
â Marc
Feb 26 at 10:33
Related, about
sudo su
: unix.stackexchange.com/questions/218169/â¦â Kusalananda
Feb 26 at 10:53