Find the answer to your Linux question:
Results 1 to 6 of 6
Hello, I have generated on my local machine ssh RSA key (id_rsa and id_rsa.pub). Using: Code: ssh-keygen -b 1024 -t rsa Then I copied id_rsa.pub key to remote server and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    26

    public ssh key not working one server


    Hello,

    I have generated on my local machine ssh RSA key (id_rsa and id_rsa.pub). Using:
    Code:
    ssh-keygen -b 1024 -t rsa
    Then I copied id_rsa.pub key to remote server and placed it in /home/user/.ssh
    Then I run:
    Code:
    cat id_rsa.pub >> authorized_keys
    authorized_keys file was created and on the server with Fedora I was able to log in without entering password.

    I did the same with another server on RedHat and it is asking me for password.
    I have also changed permissions for:
    Code:
    chmod 700 home/user/.ssh
    chmod 600 home/user/.ssh/authorized_keys
    I am not sure what I am missing.
    Please help me out.

    Thanks, Tom

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    when SSHing to the RHEL server, on the ssh client, use "-v" (or "-vv") to get additional output. maybe a clue is there.

    on the remote server (the ssh server), try symlinking ~/.ssh/authorized_keys to ~/.ssh/authorized_keys2, as sometimes that file is looked for instead.

  3. #3
    Just Joined!
    Join Date
    Jan 2012
    Posts
    26
    Thanks for mentioning "symlinking". I have realized that default directory for user was changed in etc/passwd file. It was pointing to different directory than /home/user/.ssh

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2012
    Posts
    26
    I have another question concerning generation of RSA key.

    When I run this command:
    Code:
    ssh-keygen -t rsa
    and do not enter my own name for RSA key pair, system automatically creates id_rsa and id_rsa.pub.
    If I copy public key to remote host and create authorized_keys everything works ok.

    If I create RSA key pair with my own name it is not working.
    Does any one know why?

    Thanks, T

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,754
    See the man page for this command: sss_ssh_authorizedkeys
    It explains how to create the authorized keys file that you will place in the server user's .ssh directory for named users.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by zibrnp View Post
    When I run this command:
    Code:
    ssh-keygen -t rsa
    and do not enter my own name for RSA key pair, system automatically creates id_rsa and id_rsa.pub.
    If I copy public key to remote host and create authorized_keys everything works ok.

    If I create RSA key pair with my own name it is not working.
    what do you mean by using your own name? In the path to the rsa files?

Posting Permissions

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