ubuntu18–(2)–Windows 10 自带linux子系统-XShell连接

版权声明:编码不易,禁止转载 https://blog.csdn.net/u_ascend/article/details/86010866

我的windows安装的是ubuntu 18.0.4.1

1. 安装ssh

sudo apt-get remove openssh-server
sudo apt-get install openssh-server

如果是最新安装的16.04就会提示已经安装过了,无需再次安装。

2. 配置并连接

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.origin
sudo vim /etc/ssh/sshd_config

# Port 23 # 端口改为23,22端口已被占用
# ListenAddress 0.0.0.0 # 取消注释
# #StrictModes yes # 注释
# PasswordAuthentication yes # 允许密码登录

sudo service ssh --full-restart
# windows弹出允许访问网络,当然是允许啦
# 如果提示sshd error: could not load host key,则用下面的命令重新生成
# sudo rm /etc/ssh/ssh*key
# dpkg-reconfigure openssh-server

现在就可以用 xshell 登陆 ubuntu on windows 了,IP 是 127.0.0.1
用户名和密码是自己设定的UNIX username 和 UNIX password

参考:https://segmentfault.com/q/1010000006239403


看这里,看这里
文章总目录:博客导航
参考文章:https://blog.csdn.net/u_ascend/article/details/86010866

猜你喜欢

转载自blog.csdn.net/u_ascend/article/details/86010866