Enable Key based SSH (for machine to machine talking (backup, etc))

Thanks to Dan for expediting this one!

mikrodots@MikroDroplet:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mikrodots/.ssh/id_rsa):
Created directory ‘/home/mikrodots/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mikrodots/.ssh/id_rsa.
Your public key has been saved in /home/mikrodots/.ssh/id_rsa.pub.
The key fingerprint is:
7c:26:48:c8:6f:62:c1:a2:93:f7:03:bc:38:5d:7f:f1 mikrodots@MikroDroplet
The key’s randomart image is:
+–[ RSA 2048]—-+
| .o |
| *.= |
| =.*.= |
| .o.= o |
| . o S o |
| …o.o |
| . o o |
| . . . E |
| . |
+—————–+
mikrodots@MikroDroplet:~$ scp -P 9876 /home/mikrodots/.ssh/id_rsa.pub colin@remoteip:/home/colin/
The authenticity of host ‘[remoteip]:9876 ([remoteip]:9876)’ can’t be established.
ECDSA key fingerprint is 1d:c8:a4:1c:fb:41:d7:a4:e2:a5:32:eb:24:8b:a8:f0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘[remoteip]:9876’ (ECDSA) to the list of known hosts.
Password for colin@superBSD:
id_rsa.pub 100% 404 0.4KB/s 00:00

mikrodots@MikroDroplet:~$ ssh -p 9876 remoteip
Password for colin@superBSD:
Last login: Tue Apr 1 10:54:42 2014 from publicip
FreeBSD 10.0-RELEASE-p4 (GENERIC) #0: Tue Jan 14 20:48:07 UTC 2014

Welcome to FreeBSD!

[colin@superBSD] ~% cat /home/colin/id_rsa.pub >> /home/colin/.ssh/authorized_keys
[colin@superBSD] ~% exit
logout
Connection to remoteip closed.

mikrodots@MikroDroplet:~$ ssh -p 9876 -i .ssh/id_rsa colin@remoteip
Last login: Tue Apr 1 10:56:30 2014 from publicip
FreeBSD 10.0-RELEASE-p4 (GENERIC) #0: Tue Jan 14 20:48:07 UTC 2014

Welcome to FreeBSD!

[colin@superBSD] ~% exit

(Celebrate!!)

Leave a Reply

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