Fix Cygwin SSH error: `Ignored authorized keys: bad ownership or modes for directory`

This error always gets me when I change my Cygwin home directory to my Windows home directory and I’m using Cygwin SSH with StrictModes enabled. Then, I have to go digging around the web for the solution. So the error looks like this:

$ ssh -v YOUR_REMOTE_HOST
### some stuff happening ###
debug1: Remote: Ignored authorized keys: bad ownership or modes for directory /cygdrive/c/Users/YOUR_USERNAME

For some reason, Windows makes user directories group-readable and StrictModes doesn’t like that. So you’ll have to do some permission editing:

chown YOUR_USERNAME:None /cygdrive/c/Users/YOUR_USERNAME
chmod 700 /cygdrive/c/Users/YOUR_USERNAME

There. Now you should be able to log in with pubkey authentication. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s