Debugging SSH

Debugging ssh is monotonous shit ‘cos you get reams of messages which don’t tell you why you can’t connect.

E.g.

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED

Actual error message should be:

YOU'VE PROBABLY REPLACED YOUR HOST AND YOUR EXISTING KEY IN ~/.ssh/known_hosts DOES NOT MATCH

Delete your key on line 293.

Permission denied (publickey).

Your keys aren’t on the server. i.e. your Public Key isn’t in the ~/.ssh/authorized_keys file of the user you’re trying to login with.

Use ssh -v to debug. Ignore the 20 odd lines of useless information that get output and focus on:

debug1: Offering public key: RSA SHA256:hash /Users/snowcrash/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering public key: RSA SHA256:hash /Users/snowcrash/.ssh/another_key
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
snowcrash@1.2.3.4: Permission denied (publickey).

 

Leave a Reply

Your email address will not be published. Required fields are marked *