/etc/ssh/sshd_config#允许root用户登录PermitRootLogin yes#服务端口,为了不和windows及其它WSL子系统冲突,手动指定一个Port 12308#监听地址,如果需要远程机器连接ListenAddress 0.0.0.0到这一步先不要换,记得提升自己的用户权限,chmod +x /etc/init.d/sshd启动sshd,查看服务已经启动/etc/init.d/sshd start...
command字符串""你希望在 WSL 实例启动时运行的命令字符串。 此命令以根用户身份运行。 例如service docker start。 示例wsl.conf 文件 下面的wsl.conf示例文件展示了一些可以使用的配置选项。 在此示例中,分发版为 Ubuntu-20.04,文件路径为\\wsl.localhost\Ubuntu-20.04\etc\wsl.conf。
按照你 WSL 使用的 Linux 发行版创建启动脚本,比如我创建的 Debian.vbs 文件: Setws=CreateObject("Wscript.Shell")ws.run"wsl -d debian -u root /etc/init.wsl start",vbhide 这个脚本就会在你登陆的时候自动在名字为 "debian" 的 wsl 发行版中执行 /etc/init.wsl 启动我们的服务了,如果你用的是 ubuntu...
I, unfortunately, forgot to start logging while I was facing the issue. This is still an issue in the exact same manner. hnsdiag to delete the WSL network just hangs the terminal, and does not cause a fix either. deleting reg entries doesn't produce any effect either. I get the exact...
左右滑动[root@wsl:~]# service ssh status*sshd is not running[root@wsl:~]# service ssh start*Starting OpenBSD Secure Shell server sshdsshd:no hostkeys available--exiting.[fail] 解决方案是通过ssh-keygen -A创建密钥即可: 代码语言:javascript ...
echo"<在第三章中设置的密码>"|sudo-S/usr/sbin/service ssh start 然后在Windows下写一个vbs程序(如wsl.vbs),并放到开机自启动的路径下。 vbs内容如下: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 setws=wscript.createobject("wscript.shell")ws.run"C:\Windows\System32\bash.exe",0ws.run"...
sudo service postgresql start用于开始运行数据库。 sudo service postgresql stop用于停止运行数据库。 默认管理员用户postgres需要分配的密码才能连接到数据库。 要设置密码,请执行以下操作: 输入命令:sudo passwd postgres 系统将提示你输入新密码。 关闭并重新打开终端。
[boot] #启用 systemd systemd=true #开机运行 docker service docker start .wslconfig 和 wsl.conf 的详细参数可以参考官方文档: https://learn.microsoft.com/zh-cn/windows/wsl/wsl-config 安装Docker docker 可以通过发行版的包管理工具安装,比如 Ubuntu(sudo apt install docker docker-compose),也可以用官方...
commandstring""你希望在 WSL 实例启动时运行的命令字符串。 此命令以根用户身份运行。 例如service docker start。 示例wsl.conf 文件 下面的wsl.conf示例文件演示了一些可用的配置选项。 在此示例中,分发版为 Ubuntu-20.04,文件路径为\\wsl.localhost\Ubuntu-20.04\etc\wsl.conf。
按照你 WSL 使用的 Linux 发行版创建启动脚本,比如我创建的 Debian.vbs 文件: Setws=CreateObject("Wscript.Shell")ws.run"wsl -d debian -u root /etc/init.wsl start",vbhide 这个脚本就会在你登陆的时候自动在名字为 "debian" 的 wsl 发行版中执行 /etc/init.wsl 启动我们的服务了,如果你用的是 ubuntu...