I am running Centos 8.
I have used various instructional documents, such as the below:
https://www.cyberciti.biz/faq/how-to-sudo-without-password-on-centos-linux/
in an attempt to be able to ssh to an account, and then get to root without having to use a password. I am accessing my machine via passwordless ssh with a key that requires a passphrase.
Once I have logged in, with my account, I want to be able to sudo to root without a password.
Is that even possible?
What I have done is logged in as root (Which DOES require my account password) and then:
visudo
And added this line here for the account for "Keith".
keithchegwin ALL=(ALL) NOPASSWD:ALL
Now, for "good measure" I have started sshd again, and logged back in as keithchegwin
fully expecting to be able to do:
su root
With no password, but it still asks for a password for the account I am logged in as. I want it to stop!
What am I doing wrong? Thanks.
I did see his other question here, but that refers to running a specific script or program, not accessing an account with no password so I do not think this is a duplicate:
How to run a specific program as root without a password prompt?
sudo -i
is recommemded. WIthsudo -s
you may not get the extra system path for root. – GMaster Feb 17 '22 at 03:14