1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WSL2なUbuntu20.04でSSHサーバを立てる

Posted at

はじめに

WSL2なUbuntu20.04でSSHサーバを立てようとしてハマったので、解決方法をご紹介します

なにがいけないのか

  • systemctlを受け付けない
  • OpenSSH Server自体も変

解決方法

トラブルシューティングは無視して入れなおしてしまいましょう

$ sudo apt purge openssh-server
$ sudo apt install openssh-server

systemctlは使わず、serviceを使って起動しましょう

$ sudo service ssh start
 * Starting OpenBSD Secure Shell server sshd                                                                     [ OK ]

無事TCP22番ポートが開きました

$ sudo ss -autoSnp
Netid   State       Recv-Q   Send-Q      Local Address:Port       Peer Address:Port   Process
tcp     LISTEN      0        128               0.0.0.0:22              0.0.0.0:*       users:(("sshd",pid=2067,fd=3))
tcp     LISTEN      0        128                  [::]:22                 [::]:*       users:(("sshd",pid=2067,fd=4))

最後に

まさかsystemctlが使えないとは
やられました

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?