Skip to content

Instantly share code, notes, and snippets.

@sharl
Last active June 29, 2020 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharl/59a7d47715bb7d9b42994e249fe9b7b0 to your computer and use it in GitHub Desktop.
Save sharl/59a7d47715bb7d9b42994e249fe9b7b0 to your computer and use it in GitHub Desktop.
WSL sshd startup

WSL1向け

/etc/ssh/ssh_host_rsa_key

ホストキーがないので生成

$ sudo ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key

/etc/ssh/sshd_config

Port 22
PasswordAuthentication yes

distro別にPortを設定する。ひとまずパスワード認証許可で。

/etc/sudoers

%sudo   ALL=(ALL:ALL) NOPASSWD: ALL

sshd.vbs

set ws=wscript.createobject("wscript.shell")
ws.run "Ubuntu -c 'sudo /usr/sbin/sshd -D'",0

sshd1804.vbs

set ws=wscript.createobject("wscript.shell")
ws.run "Ubuntu1804 -c 'sudo /usr/sbin/sshd -D'",0

shell:startup で開くスタートアップフォルダに置く。

これでいいはず

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment