Setting up SSH/Git on Cygwin yields "Bad permissions on ~/.ssh/config"

Solution 1:

Don't forget the ACLs

Nothing worked for me until I stripped the file of ACLs and reset the permissions.

#remove ACLs
setfacl -b ~/.ssh/config

#reset permissions
chmod 0600 ~/.ssh/config

You can use getfacl to view the current ACL on a file.

getfacl ~/.ssh/config

Before I removed the ACLs (Broken):

# owner: Administrators
# group: None
user::rw-
group::---
group:Authenticated Users:rwx
group:SYSTEM:rwx
mask:rwx
other:---

After: (working)

# file: config
# owner: myusername
# group: None
user::rw-
group::---
other:---

Solution 2:

Iv'e found that this always fixes it:

chown Username:Users ~/.ssh/config
chmod go-rw ~/.ssh/config

Solution 3:

The problem ended up being that the file was owned by group "None". I changed the group to "Users" and then I could freely change the permissions

I figured this out from this related question

Solution 4:

This solution helped me:

cd ~/.ssh
chmod 600 *

Solution 5:

My cygwin64 on win7 running as admin, the chmod/chown/setacl/icacls/copyacls/ didn't help; only this worked: ssh -F ~/.ssh/config ...