Fun with authorized_keys, openssh and window 2k16.

Recently I came across an issue getting ssh keys working from a linux machine to a windows 2016 server running openssh server. I generated the keys are you usually do, copied the public key over to the windows users $HOME/.ssh/authorized_keys. However it didn’t seem to work. After a lot of digging around I found it was related to the permissions on the authorized_keys file, mainly windows not restricting the permissions enough.

I stumbled across this git issue which basically says to set the permissions on the authorized_keys file to be read only, with only the SYSTEM user and the local user you wish to login using as having access to the file. Once this was setup, the keys work nicely :).

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 )

Facebook photo

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

Connecting to %s