win10下Linux子系统开启ssh服务

简介: 原文:win10下Linux子系统开启ssh服务 为了便于交流共同学习,博主QQ群242629020(stm32-MCU认认真真交流群) 欢迎批评指导!!!电梯:https://jq.
原文: win10下Linux子系统开启ssh服务

为了便于交流共同学习,博主QQ群242629020stm32-MCU认认真真交流群) 欢迎批评指导!!!电梯:https://jq.qq.com/?_wv=1027&k=5n1AfYq 

参考:https://www.jianshu.com/p/36440b7df56a

虽然win10自带的bash功能已经很丰富,操作也简便,不过习惯了用xshell, 还是选择用xshell来操作

直接用xshell连接127.0.0.1 端口22 提示连接失败。说明应该是ubuntu的sshd服务设置有问题:

解决方案如下:

安装ssh

sudo apt intsall openssh-server openssh-client

备份sshd配置文件

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

修改内容:

#PermitRootLogin prohibit-password    #注释
PermitRootLogin yes    #添加这行
#StrictModes yes # 注释
PasswordAuthentication yes # 允许密码登录

启动ssh

sudo service ssh start
或者
sudo service ssh restart

如果提示sshd error: could not load host key,则用下面的命令重新生成

sudo rm /etc/ssh/ssh*key
dpkg-reconfigure openssh-server

大功告成

为了便于交流共同学习,博主QQ群242629020stm32-MCU认认真真交流群) 欢迎批评指导!!!电梯:https://jq.qq.com/?_wv=1027&k=5n1AfYq  

目录
相关文章
|
29天前
|
安全 Shell Linux
【Shell 命令集合 文件管理】Linux ssh 远程主机之间复制文件 scp 命令使用教程
【Shell 命令集合 文件管理】Linux ssh 远程主机之间复制文件 scp 命令使用教程
34 0
|
10天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
22 1
|
2天前
|
网络协议 安全 Shell
配置ssh服务
配置ssh服务
|
1月前
|
网络协议 Ubuntu Linux
「远程开发」VSCode使用SSH远程linux服务器 - 公网远程连接
「远程开发」VSCode使用SSH远程linux服务器 - 公网远程连接
114 0
|
1月前
|
安全 Linux Shell
|
2月前
|
安全 网络协议 Linux
|
2月前
|
存储 Linux 网络安全
如何在 Linux 中删除 SSL 证书和 SSH 密码?
如何在 Linux 中删除 SSL 证书和 SSH 密码?
79 1
如何在 Linux 中删除 SSL 证书和 SSH 密码?
QGS
|
3月前
|
安全 Java Linux
浅谈springboot整合ganymed-ssh2远程访问linux
浅谈springboot整合ganymed-ssh2远程访问linux
QGS
36 1
|
3月前
|
Linux Windows Ubuntu
Windows 使用 Linux 子系统,轻轻松松安装多个linux
Windows 使用 Linux 子系统,轻轻松松安装多个linux
50 0
Windows 使用 Linux 子系统,轻轻松松安装多个linux
|
3月前
|
安全 Linux Shell
Linux服务器配置SSH免密码登录后,登录仍提示输入密码(一次真实的问题排查解决记录)
Linux服务器配置SSH免密码登录后,登录仍提示输入密码(一次真实的问题排查解决记录)
85 0