Difference between revisions of "windows ssh server guide"

From thelinuxwiki
Jump to: navigation, search
(Created page with "==supported windows versions== OpenSSH can be used to connect Window 10 clients to Windows Server 2019. OpenSSH Client is available to install on Windows 10 build 1809 and lat...")
 
(sshd_config)
Line 9: Line 9:
  
 
===sshd_config===
 
===sshd_config===
 +
 +
edit sshd_config
 +
 
location %programdata%\ssh\sshd_config i.e. C:\ProgramData\ssh\sshd_config
 
location %programdata%\ssh\sshd_config i.e. C:\ProgramData\ssh\sshd_config
  
  vi /cygdrive/c/ProgramData/ssh/sshd_config
+
add allow and/or deny directive lines to the file
 +
 
 +
a simple example...
 +
 
 +
  AllowUsers mydomain\johnsmith@*
 +
 
 +
this will allow the domain account johnsmith to ssh in from any IP address (due to the * after the @)
 +
 
 +
and because I hate Event viewer, I want ssh to log to a file
 +
 
 +
to configure, add or modify a line as follows...
 +
 
 +
SyslogFacility LOCAL0
  
 +
RESTART ssh service after every change for it to take effect!!!
  
 
==service startup==
 
==service startup==

Revision as of 17:18, 17 April 2021

Contents

supported windows versions

OpenSSH can be used to connect Window 10 clients to Windows Server 2019. OpenSSH Client is available to install on Windows 10 build 1809 and later, while OpenSSH Server is available to install on Windows Server 2019 and later.

intallation

goto Settings, select Apps > Apps & Features > Manage Optional Features > Add a feature > OpenSSH Server > Install



sshd_config

edit sshd_config

location %programdata%\ssh\sshd_config i.e. C:\ProgramData\ssh\sshd_config

add allow and/or deny directive lines to the file

a simple example...

AllowUsers mydomain\johnsmith@*

this will allow the domain account johnsmith to ssh in from any IP address (due to the * after the @)

and because I hate Event viewer, I want ssh to log to a file

to configure, add or modify a line as follows...

SyslogFacility LOCAL0

RESTART ssh service after every change for it to take effect!!!

service startup

for automatic start on boot...

go to Computer Management > Services > OpenSSH SSH Server

set startup type to Automatic.

also, start the service if you want to start using it.