OpenSSH sshd on Windows Subsystem for Linux: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 40: Line 40:
  chmod -R go-rwx .ssh
  chmod -R go-rwx .ssh


=Start the sshd Server at Boot=
==Start the sshd Server at Boot==


==Passwordless Sudo==
===Passwordless Sudo===


Give passwordless sudo privileges the user that is supposed to start the server, by editing the sudo configuration file with visudo. More details: [[Sudo#Allow_a_user_to_run_all_commands_as_root_without_a_password| Allow a user to run commands as root without a password]].
Give passwordless sudo privileges the user that is supposed to start the server, by editing the sudo configuration file with visudo. More details: [[Sudo#Allow_a_user_to_run_all_commands_as_root_without_a_password| Allow a user to run commands as root without a password]].

Revision as of 16:47, 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

Configure User Access

Add allowed public keys in ~/.ssh/authorized_keys

Set acceptable permissions:

cd ~
chmod -R go-rwx .ssh

Start the sshd Server at Boot

Passwordless Sudo

Give passwordless sudo privileges the user that is supposed to start the server, by editing the sudo configuration file with visudo. More details: Allow a user to run commands as root without a password.

Status

/etc/init.d/ssh status

Start/Stop

/etc/init.d/ssh start|stop