码迷,mamicode.com
首页 > 其他好文 > 详细

优雅食用WSL

时间:2021-05-24 15:11:12      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:orm   lazy   ros   service   目录   microsoft   containe   preview   安装   

优雅食用WSL

效果展示

技术图片

前置条件

windows10且版本支持WSL

相关软件安装

  1. WSL

在“启用或关闭Windows功能”中 勾选“适用于Linux的Windows子系统”选项,并确认(该操作需要重新启动Windows系统)

  1. Ubuntu termius

在Windows Microsoft Store中搜索并安装“termius”和“Ubuntu”

配置WSL SSH服务

  1. 打开linux虚拟机并等待安装成功

  2. 安装ssh服务

sudo apt-get install openssh-server
  1. 修改配置文件

编辑文件/etc/ssh/sshd_config并添加如下内容

# 端口配置
Port 6666 
UsePrivilegeSeparation no 
# 密码验证 
PasswordAuthentication yes 
# 允许登陆的用户 
AllowUsers name
  1. 开启并验证SSH服务
# 开启服务
sudo service ssh --full-restart
# 验证服务
ps -e | grep sshd

配置termius SSH

创建新的SSH连接并配置host和port为127.0.0.1:6666,并验证是否可以通过SSH正常连接WSL

Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Sat May 15 19:55:50 CST 2021

  System load:    0.52      Processes:              9
  Usage of /home: unknown   Users logged in:        0
  Memory usage:   64%       IPv4 address for wifi0: 192.168.31.63
  Swap usage:     0%

26 updates can be installed immediately.
26 of these updates are security updates.
To see these additional updates run: apt list --upgradable



The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

chiale@LAPTOP-0JIALP82:~$ ls

此时可以看到已经成功配置

参考文章地址

Xshell连接WSL

优雅食用WSL

标签:orm   lazy   ros   service   目录   microsoft   containe   preview   安装   

原文地址:https://www.cnblogs.com/chiale/p/14782167.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!