Enable SSH Login Using Authorised Keys on Admin Account
Windows 10 has since some while ago a OpenSSH client included. There is also an option to install a OpenSSH server. One issue I regularly encounter is that the server is as default setup to not allow my user to login using the authorized_keys
file located at %USERPROFILE%\.ssh\
as my user is a local administrator. Let’s fix this.
Installing OpenSSH Server
This is most conveniently done using Windows Settings.
- Open Windows Settings (WIN+I)
- Navigate to Apps
- Select Apps & Features
- Open Optional features
- Select Add a feature
- Scroll down to OpenSSH Server
- Press Install
Enabling SSH login
- Open a notepad or your favorate text editor as administrator.
- Open
sshd_config
located at:C:\ProgramData\ssh\sshd_config
- Find the following line:
Match Group administrators
, for me this is in the bottom of the file. Comment the following 2 rows:
Match Group administrators AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Restart service
OpenSSH SSH Server