OpenSSH sshd on Windows Subsystem for Linux: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:
=Procedure=
=Procedure=


=Organizatorium=
==UsePrivilegeSeparation==
 
Turn [[Sshd_Configuration#UsePrivilegeSeparation|UsePrivilegeSeparation]] off by setting:
 
UsePrivilegeSeparation no
 
This is required to prevent sshd startup error that manifests in logs as:


  chroot("/var/run/sshd"): Function not implemented [preauth]
  chroot("/var/run/sshd"): Function not implemented [preauth]


==Regenerate Server Keys==
Regenerate the server keys following the procedure described here:


Use privilege separation.
{{Internal|Sshd Regenerate Server Keys|Regenerate Server Keys}}


This is required to prevent sshd startup error that manifests in the logs as:


  debug1: list_hostkey_types:
  debug1: list_hostkey_types:
  No supported key exchange algorithms
  No supported key exchange algorithms


Fixed with [[Sshd Regenerate Server Keys]]


* Add the allowed public key in ~/.ssh/authorized_keys
* Add the allowed public key in ~/.ssh/authorized_keys

Revision as of 16:42, 11 July 2017

Internal

Overview

This article contains the procedure to configure a Windows Subsystem for Linux sshd to start at boot and allow ssh access to the Windows host.

Procedure

UsePrivilegeSeparation

Turn UsePrivilegeSeparation off by setting:

UsePrivilegeSeparation no

This is required to prevent sshd startup error that manifests in logs as:

chroot("/var/run/sshd"): Function not implemented [preauth]

Regenerate Server Keys

Regenerate the server keys following the procedure described here:

Regenerate Server Keys

This is required to prevent sshd startup error that manifests in the logs as:

debug1: list_hostkey_types:
No supported key exchange algorithms


  • Add the allowed public key in ~/.ssh/authorized_keys
  • Set acceptable permissions:
cd ~
chmod -R go-rwx .ssh


Start at boot.


visudo


More restrictive if necessary

Status

/etc/init.d/ssh status

Start/Stop

/etc/init.d/ssh start|stop