Closed Thread
Results 1 to 3 of 3

Thread: SSH Key

  1. #1
    Crop is offline Learning Programmer
    Join Date
    Jan 2007
    Posts
    62
    Rep Power
    0

    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?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    dml1978 is offline Newbie
    Join Date
    May 2008
    Posts
    8
    Rep Power
    0
    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.

  4. #3
    Jordan Guest
    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.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts