0
rated 0 times
[
0]
[
0]
/ answers: 1 / hits: 499
/ 1 Year ago, sun, december 11, 2022, 2:43:18
I want to run ssh without asking for password and invoke systemctl without password
i tried doing the following:
ssh -t <user>@<host> "echo <password> | sudo -S systemctl status kubelet"
and:
sshpass -p '$<password>' ssh -t -o 'StrictHostKeyChecking=no' <user>@<host> 'sudo service kubelet restart
also:
echo <password> | ssh -tt <user>@<host> "sudo service kubelet restart"
i added the user to the sudoers and i am able to run systemctl without password
all the commands from above ask for a password except:
sshpass -p '$<password>' ssh -t -o 'StrictHostKeyChecking=no' <user>@<host> 'sudo service kubelet restart
which gives me no prompt and looks like it worked but did nothing.
More From » ssh