Wednesday, September 9, 2015

linux - SSH closes connection when key is accepted



In server's auth.log:





Failed publickey for agladysh from MYIP port 61313 ssh2


In ssh -vvv:




debug1: Offering public key: /Users/agladysh/.ssh/id_rsa
debug3: send_pubkey_test

debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp FINGERPRINT
debug3: sign_and_send_pubkey
Connection closed by SERVER


I triple-checked the authorized_keys.



I also checked:





  • hosts.deny file for my IP

  • AllowUsers in SSH config

  • my default shell on server



Any hints how to debug this?



Server: Ubuntu Server 11.04, client: Ubuntu 10.10 (key is forwarded from OS X, works on other servers).



Answer



The actual problem was that my user was somehow missing from `/etc/shadow.



I will let this question to stay open for sometime so that people can put more troubleshooting advice here.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...