I am looking for tips on how to troubleshoot a problem with connecting to a new server via SSH. I am trying to connect using private-key authentication, where SSH uses my local private key to authenticate, without prompting for a password, but running into problems with that.
When I run
ssh root@newserver, the connection succeeds immediately, without prompting me for a password. In contrast, when I run
ssh user@newserver, the private-key authentication attempt fails and it prompts me for a password. I'm stumped about why the latter fails. What should I try, to debug this?
Things I've already tried:
I've carefully checked
/home/user/.ssh/authorized_keys. Both are identical, and both contain my public key.
I've carefully checked the permissions on
newserver. Everything seems fine, and in any case, the permissions are the same for both.
I've tried logging in from two different clients, and see the same behavior on both, so I don't think it is client-specific. I can log into other servers successfully from both of those clients.
I tried running
/usr/sbin/sshd -d -p 2323on the new server and then connecting using
ssh -p 2323 root@newserverand
ssh -p 2323 user@newserver. Here's the brain-twisting part: when I launch
sshdby hand from the command line, I'm able to log in (both to
user) via private-key authentication, but when I try to use the system-standard
sshd, I can only log in to
rootbut not to
uservia private-key authentication.
ssh -v. I don't see any enlightening messages: with
ssh -v root@newserver, I get
debug1: Offering DSA public key: /home/user/.ssh/id_dsa debug1: Server accepts key: pkalg ssh-dss blen 433
ssh -v user@newserver, I get
debug1: Offering DSA public key: /home/daw/.ssh/id_dsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
-v's doesn't lend any insight; with
ssh -vvvvv bingen.cs.berkeley.edu, I get
debug1: Offering DSA public key: /home/daw/.ssh/id_dsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
so no indication of why the attempt to log in via private-key authentication failed.
This is Fedora 21, openssh-6.6.1p1-11.1.fc21.x86_64.