Thread: SSH Key-Gen

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Dela-Where?
    Posts
    42
    Rep Power
    8

    SSH Key-Gen


    Hello,

    I am trying to set up a SSH key between servers so no password is required when I have to "scp" files between the two.

    This is what I have tried so far but still requires a password:

    Code:
    ssh-keygen -t rsa
    scp /home/<user>/.ssh/id_rsa <server2.com>:/home/<user>/.ssh/athorized_keys
    When I scp after this I wasn't expecting to need a password but it is still prompting. Now I have used this same method before and it has worked great. The only difference this time is server2 is not in the same cage.

    Is there something I might be doing wrong?

    Thanks
    "Bart Stop Pestering Satan!" - Marge Simpson
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,484
    Rep Power
    1752
    Code:
    ~/.ssh/id_rsa.pub
                 Contains the protocol version 2 RSA public key for authentica-
                 tion.  The contents of this file should be added to
                 ~/.ssh/authorized_keys on all machines where the user wishes to
                 log in using public key authentication.  There is no need to keep
                 the contents of this file secret.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Dela-Where?
    Posts
    42
    Rep Power
    8
    Originally Posted by SimonJM
    Code:
    ~/.ssh/id_rsa.pub
                 Contains the protocol version 2 RSA public key for authentica-
                 tion.  The contents of this file should be added to
                 ~/.ssh/authorized_keys on all machines where the user wishes to
                 log in using public key authentication.  There is no need to keep
                 the contents of this file secret.
    I have verified that the key is in the authorized_keys file. When I turn on debugging for scp it shows it offering the rsa public keys but then proceeds to the next step like it was not accepted.
    "Bart Stop Pestering Satan!" - Marge Simpson
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    Just out of curiosity, did you generate your key to require a passphrase? I usually don't, and haven't had the problem you describe.

    I usually use a script that Fedora provides 'ssh-copy-id' to install the key on the remote machine too, if you have that script you might give it a try.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Dela-Where?
    Posts
    42
    Rep Power
    8
    Originally Posted by Doug G
    Just out of curiosity, did you generate your key to require a passphrase? I usually don't, and haven't had the problem you describe.

    I usually use a script that Fedora provides 'ssh-copy-id' to install the key on the remote machine too, if you have that script you might give it a try.
    Actually I discovered the issue had nothing to do with the key. The remote server had a permission issue which prevented the keys from being read. Fixed the permission and bingo it worked.
    "Bart Stop Pestering Satan!" - Marge Simpson

IMN logo majestic logo threadwatch logo seochat tools logo