远程登陆Win10自带子系统Ubuntu-22.04
远程登陆Win10自带子系统Ubuntu-22.04

远程登陆Win10自带子系统Ubuntu-22.04

1、Windows端:

单击Windows左下角主菜单,搜索cmd,并以管理员身份运行打开。

执行以下命令,查看Windows的ip地址,假设地址是192.168.0.19

ipconfig

执行以下命令,将Ubuntu子系统的 ssh 端口转发到 Windows系统 的 22222 端口或其它没有被占用的端口

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=22222 connectaddress=192.168.0.19 connectport=22

2、被连接的Ubuntu服务器

开启其他地址的访问权限

sudo vim /etc/hosts.allow #在文档最下方添加 ALL:ALL

安装openssh

sudo apt-get install openssh-server openssh-client

配置ssh服务器

vim /etc/ssh/sshd_config

PasswordAuthentication yes #是否允许密码登陆

PubkeyAuthentication yes #是否允许使用公匙验证,仅适用于ssh版本2

开启ssh服务

sudo /etc/init.d/ssh start

经过以上步骤后,通过命令行ssh -p 22222 登录名@主机ip或者mabaxterm、securCRT等软件即可成功远程登陆WIindows自带子系统Ubuntu了。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Title - Artist
0:00