How to Login with Passwordless SSH Keys
This post was last updated on June 3rd, 2020 at 03:49 pm
More on SSH: How to do passwordless SSH:
ssh-keygen -t dsa
You will get 2 keys a private one (id_dsa) and a public one (id_dsa.pub). You can take the public one and cat that into ~/.ssh/authorized_keys2 on the remote server like this:
cat ~/.ssh/id_dsa.pub | ssh [email protected] “cat – >> .ssh/authorized_keys2”
and then you can run remote commands on that system without giving the password each time. This ties in some how with ssh-agent which will keep track of the security for you.
Of course you may need to use either the ~/.ssh directory or the ~/.ssh2 directory, depending on which SSH software you are using.
The following script will assist in ssh key stuffing and remote command execution. It is not required because you can do these steps on your own. The main reason for this script is to assist me in automated testing where there is some initial manual input to stuff the keys in the first place. control-unit.tgz