wsl --set-default-version 1 wsl --shutdown wsl --set-version Ubuntu-22.04 2 wsl --set-default-version 2 wsl -l -v
,今天小编就来聊一聊关于ubuntu server 18配置?接下来我们就一起去研究一下吧!
ubuntu server 18配置
wsl Ubuntu Error: 0x8027025a解决方法
wsl --set-default-version 1 wsl --shutdown wsl --set-version Ubuntu-22.04 2 wsl --set-default-version 2 wsl -l -v
1. 微软商店中查找Ubuntu22.04
2. 默认安装到C盘
3. 下载完成之后,进入powershell命令窗口
cp C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuXXXXonWindows_79rhkp1fndgsc\* F:\ubuntu\
4. 进入F:\ubuntu,点击UbuntuXXXX.exe安装
5. 进入windows开始界面,选择UbuntuXXXX的图标,点击卸载,就能删除C盘中Ubuntu
修改默认用户root
# Powershell(admin)
cd F:\ubuntu
ubuntu2204.exe config --default-user root
# 关闭服务
net stop LxssManager
# 启动服务
net start LxssManager
# 修改sources.list配置文件
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# 更新缓存
apt-get update
apt-get upgrade
1. 卸载原有的ssh
apt-get remove openssh-server
apt-get autoclean
2. 安装ssh
apt-get install openssh-server
3. 配置ssh服务
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bk
vi /etc/ssh/sshd_config
Port 22 #远程端口为22 默认
ListenAddress 0.0.0.0 #监听地址为0.0.0.0表示监听所有来访的ip
PasswordAuthentication yes #允许用户通过密码登陆
PermitRootLogin yes #允许root用户登陆
4. 启动ssh服务
service ssh start