paulmellors dot net

Youtuber | Gamer | Tech Head | Twitch

SSH Password less Login

All my servers are linux based, on the KVM machines I use virtual machine manager to create vm’s and shut them down, reboot them etc, but it got annoying that when I kept trying to connect to the host, it was constantly asking me for a password. There must be a better way than this.

Well there is and it’s a called keys.

This is how I setup a key, it’s not the best way as I’m not using passwords, but it’ll give you a starting point.

On the machine you’re going to use to connect to the servers.

ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/paulmellors/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in xxxxx.
Your public key has been saved in
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx paulmellors@xxxxxx
The key’s randomart image is:
+–[ RSA 2048]—-+
| |
| |
| |
| |
| S |
| . . . |
|o . ooo o |
|+= ooB=. . . |
|o.*o=o+Eo |


To copy the keys to the target machine, use the program ssh-copy-id

ssh-copy-id -i ~/.ssh/ xxxxxx@

You’ll need the password for the username on the host, but once it’s done you’ll have keys on the server in a file called authorised_keys. Any one that has that key on the local machine can connect to the server without a password.

In my case I’m not worried about passwords as it’s not a publicly accessible machine, but I certainly would recommend using them.

Updated: May 23, 2015 — 7:46 am

Leave a Reply

Your email address will not be published. Required fields are marked *

five + thirteen =

paulmellors dot net © 2017 Frontier Theme

paulmellors dot net is Stephen Fry proof thanks to caching by WP Super Cache