How to Troubleshoot SSH Permission Issues

This one is for documentation purposes. Networking issue is usually the rabbit hole that gets deeper and weirder more we find out. My method of approaching networking is to leave the ones that are currently working, as-is. In other words, don’t jinx it.

The problem I encountered was just plain weird. I was spooked by a permission error message on my Mac. I would use SSH routinely on almost all of my machines, so I couldn’t quite pinpoint what must have changed on the system. Eventually I came across the solution while trying pretty much everything I could dig up. Run the following command:

chmod go-w ~/
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys

The idea is simple. It’s to reset permissions and ownerships of the home folder of the current user and the SSH related folders. I’ll update the post if I find out more about it. I was throwing pretty much everything I could try, so I lost track —in my defense, I was in a hurry. This was the one that fixed it, but without encountering —hopefully never— it again, I can’t say for certain how it happened and whether fix is permanent.

Leave a comment