BUG:WSL 的 ssh server 无法启动
2024-08-26 17:28:18
BUG
使用 sudo service ssh start
启动 ssh 服务,提示:
* Restarting OpenBSD Secure Shell server sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
[ OK ]
然后使用 powershell 连接,提示 refused:
PS C:\Users\suyua> ssh ryan@localhost
ssh: connect to host localhost port 22: Connection refused
FIX
卸载重装 openssh-server:
sudo apt-get purge openssh-server # purge 是卸载并删除配置文件
sudo apt-get install openssh-server
然后修改 /etc/ssh/sshd_config
的下列几行参数:
#Port 22 # 如果端口冲突,就需要修改这个
ListenAddress localhost # 只接受本地请求
PasswordAuthentication yes # 允许密码登录
重启 ssh 服务:
sudo service ssh restart
然后连接:
PS C:\Users\suyua> ssh ryan@localhost
ryan@localhost's password:
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.4.0-17763-Microsoft x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
......
问题解决。
参考
最新文章
- html+css+js 模拟win7桌面
- Spring中servletFileUpload完成上传文件以及文本的处理
- Android数据存储五种方式总结
- MFC 打开链接的方法
- vim的编码设置
- linux终端-console
- Babelfish
- 武汉科技大学ACM :1003: 零起点学算法67——统计字母数字等个数
- asp.net session的原理
- C# 分析搜索引擎url 得到搜索关键字
- 编译安装gimp插件之Mathmap(流水记录)
- Java并发,看到了,就记录下呗
- 前端基于JQgrid实现自定义列头展示
- Mysql中的in和find_in_set的区别?
- Tomcat学习
- 想玩 Android 开发板?这些常用命令你不知不行!
- react图工具集成
- ORACLE 根据 sql_id 查询绑定变量的传入值
- delphi中 panel如何在Form实现鼠标移动拖放
- v-html对于↵转义的问题
热门文章
- scrapy 一些坑
- Jenkins定时任务的配置
- 【JDBC】仅输入表名和要插入的记录数,自动检测表的字段和类型,然后插入数据的全自动程序(Oracle版)
- MySQL 正则(Regular Expression) 邮箱(Email)
- SNAT场景模拟
- django实战总结2
- ISO/IEC 9899:2011 条款6.5.4——投射操作符
- 008-SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required
- Spring cloud微服务安全实战-4-11Zuul网关安全开发(四)
- 头文件里声明和定义,Qt编译不过问题