启用wsl

启用或关闭系统功能-适用于Linux的Windows子系统

1
wsl --update

下载CentOS7.exe安装包:双击安装和启动

避免端口占用(重启生效)

1
2
netsh int ipv4 set dynamic tcp start=49152 num=16384
netsh int ipv6 set dynamic tcp start=49152 num=16384
1
2
3
4
5
6
7
8
9
# 修改ssh配置
vi /etc/ssh/sshd_config
# 检查 SSH 配置文件
sshd -t

sudo ssh-keygen -A

service sshd restart
service sshd status