Skip to content

Instantly share code, notes, and snippets.

@smothiki
Last active May 29, 2019 20:47
Show Gist options
  • Select an option

  • Save smothiki/4c1330070831810e4609f2e4e9f3571b to your computer and use it in GitHub Desktop.

Select an option

Save smothiki/4c1330070831810e4609f2e4e9f3571b to your computer and use it in GitHub Desktop.
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/dave/.ssh/identity
debug1: Offering public key: /Users/dave/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/dave/.ssh/id_dsa
debug1: Next authentication method: password
dave@new-server.com's password:
Tailing /var/log/secure on the target machine is a lot more useful :
> sudo tail -f /var/log/secure
Sep 14 01:26:31 new-server sshd[22107]: Authentication refused: bad ownership or modes for directory /home/dave/.ssh
Sep 14 01:26:46 new-server sshd[22108]: Connection closed by 98.76.54.32
Finally we’re getting somewhere - bad ownership or modes for directory /home/dave/.ssh.
SSH doesn’t like it if your home or ~/.ssh directories have group write permissions. Your home directory should be writable only by you, ~/.ssh should be 700, and authorized_keys should be 600 :
> chmod g-w /home/your_user
> chmod 700 /home/your_user/.ssh
> chmod 600 /home/your_user/.ssh/authorized_keys
You can also get around this by adding StrictModes off to your ssh_config file, but I’d advise against it - fixing permissions is the way to go.
Back to articles
Github Twitter Email RSS
Copyright © 2018 Dave Perrett
grep -rsh sshd /var/log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment