win10 安装 子系统ubuntu18.04

日萌社

人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)


1.window下的linux的路径
	C:\Users\Administrator\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs

2.linux下的window的路径
	/mnt
	为了方便后续使用,可以在桌面上生成一个快捷方式,以E盘为例,打开terminal输入
	# sudo ln -sT [文件夹路径] [桌面文件夹路径]
	sudo ln -sT /mnt/e /home/usrName/Desktop/E #usrName换成你的用户名

3.更换apt源
	1.因为Linux子系统的apt源使用的是官方源,需要连接到国外的服务器。所以安装一些软件时下载会很慢,我们可以改用国内的镜像apt源。
	  国内的镜像源主要有:
	  阿里源
		deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted
		deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
		deb http://mirrors.aliyun.com/ubuntu/ bionic universe
		deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe
		deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse
		deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse
		deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
		deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
		deb http://security.ubuntu.com/ubuntu/ bionic-security universe
		deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse

	2.设置root密码:sudo passwd root
	  切换为root用户才能修改下面的只读文件:su - root
	  然后使用root用户执行 vim /etc/apt/sources.list文件进行修改。
	  也可以先进行一下备份:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
	  然后再修改:sudo vim  /etc/apt/sources.list

	3.更新软件源和升級软件
		sudo apt-get update 更新软件源
		sudo apt-get upgrade 升級软件

4.配置ssh连接
	1.使用root才能修改只读文件
		sudo passwd root
		su - root
	 
	2.vim /etc/ssh/sshd_config
	  修改配置文件后需要service ssh restart
		#将注释符“#”去掉即可
		Port 22
		#将注释符“#”去掉即可,开放监听IP
		ListenAddress 0.0.0.0
		#开启root用户登录:找下是否有PermitRootLogin no,有的话,将no改为yes,没有的话,就新增一行
		PermitRootLogin yes
		#开启账号密码登录PasswordAuthentication no,no改为yes
		PasswordAuthentication yes
 
	3.查看是否已安装ssh
		dpkg -l | grep ssh
	4.查看ssh服务是否开启
		service ssh status
	5.开启ssh服务
		service ssh start
		#如果提示Could not load host key: /etc/ssh/ssh_host_rsa_key,则执行如下
		dpkg-reconfigure openssh-server 如果弹出选择框的话,选择默认第二项
	6.使用软件进行连接时,设置IP 127.0.0.1,port 22 即可
发布了450 篇原创文章 · 获赞 151 · 访问量 23万+

猜你喜欢

转载自blog.csdn.net/zimiao552147572/article/details/105454591