Archive

Posts Tagged ‘ssh’

SSH logins using Keys (not passwords!)

November 4th, 2008

CREATE KEY ON CLIENT

jesterj@jesterj-laptop:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jesterj/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/jesterj/.ssh/id_rsa.
Your public key has been saved in /home/jesterj/.ssh/id_rsa.pub.
The key fingerprint is:
b3:82:51:f6:14:71:d1:48:bf:26:65:60:50:3e:a3:44 jesterj@jesterj-laptop
The key’s randomart image is:
+–[ RSA 2048]—-+
|        E=B+     |
|       . =.o.    |
|      o o + +    |
|     o + . = .   |
|    .   S . o    |
|     o   o o     |
|    . . .        |
|       .         |
|                 |
+—————–+

COPY PUB KEY TO SERVER

jesterj@jesterj-laptop:$ scp ~/.ssh/id_rsa.pub jesterj@donkey.dnsdojo.com:/home/jesterj/

ON REMOTE SERVER, ADD PUB KEY TO AUTHORIZED KEYS

root@donkey:~# cat id_rsa.pub >> .ssh/authorized_keys
root@donkey:~# tail .ssh/authorized_keys
….
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsW9ypBuq/Xj1c6HNp8m45H8Kc3ZkZQanP3QLQWGDFLpdtnUCWfAe4dzQBL+ZaMjX7WRX/9i/YUCxB+589tRRXBLqoQ4OxaqUugdgfa2iBSDo9wMuGqfWhTcVKu0gTpKnocdQQKB2W7KjvEpJYjz4LFMwWvRnpAcy0Pmmd9KP9X9LDfRyLCjn8qYBzZ69eoJgQc8zA7gD6Cj0nGiQNlFo3yKvonyZEFO/hXja3SIM4XttYG+CLHCR2q1Itstdw9K8ZjhCXyxUl0K78AysT1nzZ5DRLoPb4GZ27oHcGQuS2127UEiMYUszDZRluXTZik679BZQlhZyGQdtEZMw/jt11Q== jesterj@jesterj-laptop

TEST FROM CLIENT

jesterj@jesterj-laptop:~/.ssh$ ssh jesterj@donkey.dnsdojo.com
Linux donkey.dnsdojo.com 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 18:57:07 UTC 2009 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

Last login: Tue Jan 12 14:31:21 2010 from 206-169-197-253.static.twtelecom.net
jesterj@donkey:~$

SUCCESS!

Linux ,