Thread: SSH Key Authentication
01-08-2008, 08:10 PM #1Junior Guru
- Join Date
- Sep 2004
- Sussex, England
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.
01-08-2008, 08:38 PM #2Retired Moderator
- Join Date
- Feb 2005
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
01-08-2008, 11:00 PM #3
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.
Home Directory 711
Keys (id_dsa,id_rsa) 600
Public Keys (id_dsa.pub,id_rsa.pub) 644
01-08-2008, 11:21 PM #4Web Hosting Master
- Join Date
- Nov 2001
- Ann Arbor, MI
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!