Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Location
    Sussex, England
    Posts
    193

    SSH Key Authentication

    I'm running a server where I have my SSH key set up with the root user so I can log in without the password.

    I also have an account called "jmaskell" that I use for everything, and I'm trying to add my SSH key to this. I've done exactly what I did for the root user and have my key in the .ssh/authorized_keys2 file. Unfortunately I'm still prompted for my password everytime I log in.

    Is it possible to have the same SSH key stored for two different users?

    The server is running CentOS 4 with OpenSSH 3.9.

  2. #2
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    I've never tried it but if you look at the end of the private key it's usually [email protected], so I very much doubt that you can use one key for two different users. Just set up a second key.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  3. #3
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Follow the steps in the source server.

    Login as user
    ssh-keygen -t rsa
    press enter for all.
    copy the file content id_rsa.pub.

    On destination server.
    Open a file named /home/username/.ssh/authorized_keys. Paste the content here. Check the permission of the files are like below.

    authorized_keys 600
    .ssh 700
    Home Directory 711
    Keys (id_dsa,id_rsa) 600
    Public Keys (id_dsa.pub,id_rsa.pub) 644
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  4. #4
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,978
    I'm unclear of what you're trying to do. Are you trying to log into the server as root from your jmaskell account, using a key for authorization? This is possible. You just need to generate your ssh key for jmaskell and add it to root's authorized_keys files.

    I'm guessing that if this is what you're trying that you have either made a typo in the key (the line wraps of a long public key usually mess me up), or you're logging in as the wrong user, or edited the wrong user's authorized_keys file.

    BTW, authorized_keys2 has been depecreated since openssh v3.0 (2001).
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

Posting Permissions

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