小试wsl

安装

管理员权限运行powershell,执行如下命令:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

或者:控制面板->程序和功能->启用或关闭Windows功能->勾选 适用于Linux的Windows子系统

然后重启电脑,打开应用商城搜索“WSL”,就可以安装Linux子系统了

管理wsl

设置默认运行的linux系统

wslconfig /setdefault <DistributionName>

卸载linux系统

wslconfig /unregister <DistributionName>

查看已安装的linux系统

wslconfig /list

设置默认登陆用户

以ubuntu为例:

ubuntu config --default-user root

配置ssh

重新安装 openssh-server,编辑配置文件 /etc/ssh/sshd_config

Port 2333
UsePrivilegeSeparation no

如果设置登录用户为root,加上:

PermitRootLogin yes
AllowUsers root

重启ssh服务

sudo service ssh --full-restart

猜你喜欢

转载自www.cnblogs.com/antisamael/p/9710621.html
wsl