Go Back   Linux Forums by TotalPenguin! Get linux Help! > Linux > Linux Networking

Linux Networking This forum is for Linux Networking Only. Routing, servers, etc.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-2008, 01:20 PM
Member
 
Join Date: Jan 2007
Posts: 59
Crop is on a distinguished road
Default SSH Key

Where/How do I place the SSH Key in my Linux system to enable SSH Key login?

I've got the key on the server and can use Putty from Windows (ewww) to connect. Where do I put my key in Linux though?
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-01-2008, 08:06 PM
Junior Member
 
Join Date: May 2008
Posts: 8
dml1978 is on a distinguished road
Default

Click Start, then Run, then enter puttygen in the command-line box. This displays the main dialog box. Select the key parameters, then click Generate. One can choose either an RSA or a DSA key, but do not create an SSH version 1 key of any kind: they're not secure.
You'll be prompted to create some randomness by moving the mouse around: this gives the system some additional entropy which helps create better keys. This takes just a few seconds to fully generate the keypair. Now the keypair has been generated, but exists only in PuTTYgen's memory: it has to be saved to disk to be of any use. Though the public key contains no sensitive information and will be installed on remote systems, the private key must be protected vigorously: anyone knowing the private key has full run of all remote systems. The private key is typically protected with a passphrase, and this phrase is entered twice in the fields indicated. The comment is optional but is customarily the email address of the key owner. It could also just be the owner's name.Do not forget the passphrase; the keypair is useless without it.
The key generated must now be saved, and this is done in three parts: Save Public Key and Save Private Key both prompt for a filename, and the private key (with .ppk extension) should be saved in a safe place. The public key is in a standard format and can be used directly or indirectly by other software, and it looks like this: ---- BEGIN SSH2 PUBLIC KEY ----
Comment: "steve@unixwiz.net"
AAAAB3NzaC1yc2EAAAABJQAAAIBtZzfrF2AOpwvvU/0ikNgOsFWfP9zW8GlT5iGg
c487S3ooA+OY0u882r8/T/dwc6EHJM+QhRdTlv1NBLCmz46R4F5draFhibHEWuKA
Qg/UutZbMkC6rpd0H2DBXTTCcZ2y4FL3u5kOV1+XWqmmII568+/twEGAO6MS0HDv
OYK+BQ==
---- END SSH2 PUBLIC KEY ----
The private key is in a PuTTY-specific format which can't be used by any other software. It won't ever be looked at directly by the operator.
*****INSTALLING PUBLIC KEY ON LINUX SYSTEM
With puttygen still open, highlight the entire "Public Key for pasting into OpenSSH authorized_keys file" area and type control-C to copy to the local system's clipboard. This is essentially the same data as found in the saved public-key file, but it's in a form which can be directly used on the Linux system.
Login to the Linux computer using the account's password, create the .ssh directory if necessary, then edit the file .ssh/authorized_keys2. This will be a text file, and the clipboard should be pasted into it. Note: the file authorized_keys is for an older format; we're using authorized_keys2. The public key will be just one long line, and it's really easy to paste the data in a way which truncates the first few characters. This renders the key inoperable, so be sure that the key begins ssh-rsa or ssh-dsa. Save the file.
Reply With Quote
  #3 (permalink)  
Old 05-01-2008, 11:45 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 533
Jordan is on a distinguished road
Default

Nice post dml1978. If you are trying to connect from Linux (to Linux) using an ssh key just add it in ~/.ssh/

Also make sure it is in your ~/.ssh/authorized_keys2 file on the remote computer you are trying to authenticate with.
Reply With Quote
Reply

Tags
ssh key

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:50 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.