SSH without password in Linux

make keyfiles:
 ssh-keygen -t rsa
press enter all three times. (no passphrase)

go to ~/.ssh/
send the public keyfile to {user} account on {ip}:
 ssh {ip} -l {user} 'cat >> .ssh/authorized_keys' <

remember to keep the id_rsa file secure! It can be used on other machines as well...

To use the key in putty:
Install the entire putty suite (pageant, putty, puttygen).

Open puttygen.
use Conversions -> Import key -> find id_rsa and load it.
When loaded, press 'Save private key'
Save the key as .PPK in a secure place (NTFS permissions ring a bell?)

Now, open pageant
It will load into your system tray.
Double click it, to view installed keys.
Add your newly generated PPK key.

Now you have the abillity to log in via putty, with the keyfile authentication.
Remember to 'Allow agent forwarding' in the putty default settings.
(Connection -> SSH -> Auth)
You can also save a remote host with username.
(Connection -> Auto-login username)

Every time you reboot, you must start pageant, and load the key.
You can of course automate pageant to start, but it will, by design, forget any loaded keys.
Dette indlæg blev udgivet i Knowledge Base, SSH. Bogmærk permalinket.

Skriv et svar