左右滑动 C:\Users\username>wsl -l Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https:///wslstore
C:\Users\username>wsl --install -d ubuntu Downloading: Ubuntu Installing: Ubuntu Ubuntu has been installed. Launching Ubuntu...
左右滑动 [root@wsl:~]# service ssh status * sshd is not running [root@wsl:~]# service ssh start * Starting OpenBSD Secure Shell server sshd sshd: no hostkeys available -- exiting. [fail]
解决方案是通过ssh-keygen -A创建密钥即可:
左右滑动 [root@wsl:~]# ssh-keygen -A ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 [root@wsl:~]# [root@wsl:~]# service ssh start * Starting OpenBSD Secure Shell server sshd [ OK ] [root@wsl:~]#
-A 对于不存在主机密钥的每种密钥类型(rsa、dsa、ecdsa 和 ed25519),生成具有默认密钥文件路径、空密码、密钥类型的默认位和默认注释的主机密钥。
左右滑动 [root@wsl:~]# python -V Command 'python' not found, did you mean: command'python3' from deb python3 command'python' from deb python-is-python3 [root@wsl:~]#