I need to ssh (as root) to a remote server and perform some root level operations. I will be sshing from a local server where I don't have root privileges. Given this option, is it possible to perform passwordless ssh to remote system using (rsa) keys ?
Local and remote servers run linux.
BTW, I generated keys (ssh-keygen -t rsa) on the local server. Copied the public key to remote server's .ssh/authorized_keys file. However it still keeps prompting for password. The same setup works fine, if the local and remote username (non-root) matches.
In ~/.ssh/config:
Then:
Then you can do:
1 check that your /etc/ssh/sshd_config file have "PermitRootLogin yes".
2 Store the following Shell code into nopasswd.sh:
3 Use it by these steps:
Yes. SSH does not make a connection between account names on different systems, so you can ssh as non-root to root if you have a valid key pair.