ssh returns “Bad owner or permissions on ~/.ssh/config”

I needed to have rw for user only permissions on config. This fixed it.

chmod 600 ~/.ssh/config

As others have noted below, it could be the file owner. (upvote them!)

chown $USER ~/.ssh/config

If your whole folder has invalid permissions here’s a table of possible permissions:

Path Permission
.ssh directory (code) 0700 (drwx——)
private keys (ex: id_rsa) (code) 0600 (-rw——-)
config 0600 (-rw——-)
public keys (*.pub ex: id_rsa.pub) 0644 (-rw-r–r–)
authorized_keys (code) 0644 (-rw-r–r–)
known_hosts 0644 (-rw-r–r–)

Sources:

Leave a Comment