wsl-windows subsystem for linux环境搭建

前言

现在windows系统除了装虚拟机运行linux环境之外,还可以创建wsl来运行linux环境。

apt加速

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

也可以用vi命令替换:

:%s#http://archive.ubuntu.com/ubuntu/#http://mirrors.aliyun.com/ubuntu/#g
:%s#http://security.ubuntu.com/ubuntu/#http://mirrors.aliyun.com/ubuntu/#g
sudo apt update
sudo apt upgrade

配置ssh服务

sudo apt install ssh
sudo apt install pdsh
sudo vim /etc/ssh/sshd_config

Port 22
PasswordAuthentication yes # 允许用户名密码方式登录
sudo service ssh restart

你可能感兴趣的:(服务器)