PKILL-9

Wayno’s sojourn and solutions through Linux

  • Home
  • About

27

Apr

How to do Certificate Based ssh Authentication

Posted by admin  Published in loni, ssh

THANKS LONI!

How to do — Certificate Based Authentication

1. Go into .ssh directory

cd ~/.ssh

2. create a file config with your favourite editor:

Host simpsons.com dohnuts
User homer
hostname simpsons.com
port 12345

The first line Host, identifies the domain, and the machine in that domain we which to reach.

The second line User, is the username on the host machine. In this case, homer

The third line, is the hostname.

The forth line is the port (usally 22, but for security reasons, we changed it from the default)

3. now do:

ssh-keygen

return on all of the prompts (i.e. take all the defaults)

It will look like this:

ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bart/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/bart/.ssh/id_rsa.
Your public key has been saved in /home/bart/.ssh/id_rsa.pub.
The key fingerprint is:
12:34:56 and so on.
The key’s randomart image is:
+–[ RSA 2048]—-+

4. Enter the following to copy the certificate to the machine:

ssh-copy-id -i ~/.ssh/id_rsa.pub dohnuts

You will get output that looks like:

:~/.ssh$ ssh-copy-id -i ~/.ssh/id_rsa.pub saturn
The authenticity of host ‘[simpsons.com]:12345 ([12.34.56.153]:12345)’ can’t be established.
RSA key fingerprint is ab:59:27:8a.

Are you sure you want to continue connecting (yes/no)? Yes
Warning: Permanently added ‘[simpsons.com]:12345,[12.34.56.153]:12345′ (RSA) to the list of known hosts.

Now try logging into the machine, with “ssh ‘dohnuts’”, and check in:

.ssh/authorized_keys

to make sure we haven’t added extra keys that you weren’t expecting.

5. Now login, using your password to complete.

6. in the future you would type:

ssh dohnuts

Look Ma, no password!

2 comments

Search

About

PKILL-9

Categories

  • apt-get (3)
  • Audio (4)
  • Browsers (4)
  • Compiling Source Code (2)
  • Deposit @ Home (1)
  • DVD (4)
  • filesharing (2)
  • fstab (1)
  • ftp (1)
  • gnome (4)
  • grub (2)
  • Internet Connection Sharing (1)
  • Joe (2)
  • loni (3)
  • Music (3)
  • netbook (1)
  • samba (2)
  • sound (2)
  • ssh (1)
  • Thunderbird (1)
  • Uncategorized (26)
  • ups (1)
  • video (3)
  • wireless (1)
  • word processors (2)
  • X11 (1)

Archives

  • September 2010 (1)
  • July 2010 (7)
  • April 2010 (5)
  • March 2010 (3)
  • February 2010 (7)
  • January 2010 (1)
  • December 2009 (1)
  • October 2009 (4)
  • September 2009 (1)
  • July 2009 (1)
  • June 2009 (3)
  • May 2009 (5)
  • April 2009 (6)
  • March 2009 (3)
  • February 2009 (6)

Blogroll

  • Dynamic Designz - Linux Help Site
  • Plugins

Pages

  • About

Meta

  • Log in
  • Main Entries Rss
  • Comments Rss
September 2010
M T W T F S S
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930  

Recent Posts

  • Recording/Capturing your desktop in Ubuntu/Debian
  • Forcing a Web Browser to Save a File instead of Streaming it
  • Getting Ubuntu 10.04 Video/Audio to work with an Intel 82815 Chipset
  • Recovering Ubuntu/Debian Linux after a Windows Install/Hiccup
  • How to configure Samba in Ubuntu using a gui
  • Removable USB devices and fstab settings
  • Fixing gnome-typing-monitor in Ubuntu 10.04 (lucid lynx)
  • Sorting Bookmarks (alphabetically) in Firefox
  • installing ubuntu-restricted-extras under wubi
  • How to do Certificate Based ssh Authentication

Recent Comments

  • admin in Getting Ubuntu 10.04 Video/Audio to work with an I…
  • Erick in Getting Ubuntu 10.04 Video/Audio to work with an I…
  • admin in Getting Ubuntu 10.04 Video/Audio to work with an I…
  • Erick in Getting Ubuntu 10.04 Video/Audio to work with an I…
  • terry in Getting Ubuntu 10.04 Video/Audio to work with an I…
  • admin in Changing Default Language for Abiword
  • PKILL-9 » Post Topic » … in Recovering after hosing /etc/fstab
  • tux in How to do Certificate Based ssh Authentication
  • tux in How to do Certificate Based ssh Authentication
  • lornix in Thunderbird 3.X Performance Enhancement
© 2007 PKILL-9



Theme by WebRehash | Free WordPress Templates | Valid XHTML | Valid CSS 3.0 | Powered by Wordpress, Installed by Installatron.