How to Troubleshoot SSH Permission Issues
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.