Windows Subsystem for Linux(简称WSL)是一个在Windows 10上能够运行原生Linux二进制可执行文件(ELF格式)的兼容层,WSL即Windows下的Linux子系统。 | 启用开发者模式
打开设置 
点击更新和安全 
点击开发者选项,选择开发人员模式  更改系统功能
使用Win+X快捷键调出系统管理菜单后点击应用和功能,然后拉到底,选择程序和功能 

点击启用或关闭 Windows 功能 
勾选适用于 Linux 的 Windows 子系统,然后确认并重启 Windows 系统 
 安装 Linux 子系统
重启 Windows 系统后还没有安装好 Linux 子系统,需要通过 Microsoft Store 来安装 
搜索 WSL 
选择 Ubuntu 18.04 LTS 
点击获取 
点击安装 
正在下载Ubuntu 18.04 LTS 

点击启动 
 新建用户并设置用户密码,执行 sudo -s 切换到 root 用户

 换源,更新源
cp /etc/apt/sources.list /etc/apt/sources.list.bakvim /etc/apt/sources.listdeb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverseapt-get update
 安装测试软件

Linux老司机开火车 
 设置环境变量



老铁,双击666 快速登录 Linux 子系统
WIN + R bash 
 配置SSH
SSH 连接 Win10 Linux 子系统 查看是否开启SSH服务 ps -ef | grep ssh安装SSH服务 apt-get remove openssh-serverapt-get install openssh-server修改配置端口为22,开启允许密码登录 vim /etc/ssh/sshd_configPort 22PasswordAuthentication yes重启服务 service ssh restart或者service ssh --full-restart通过 SecureCRT 连接 Win10 Linux 子系统


 输入 sudo -s 切换到 root 用户 解除 Ubuntu 禁止 root 远程登录的限制
在 /etc/ssh/sshd_config 配置文件中添加 PermitRootLogin yesroot@T62YP5MBBDL7ZEB:~# vim /etc/ssh/sshd_config26 # Authentication:27 LoginGraceTime 12028 #PermitRootLogin without-password29 PermitRootLogin yesroot@T62YP5MBBDL7ZEB:~# service ssh restart通过 SecureCRT 用 root 登录 Win10 Linux 子系统 

本文原创地址:https://www.linuxprobe.com/win10-linux-subsystem.html编辑:传棋,审核员:薛颢
|