Ubuntu无法登录SSH问题-ssh: connect to host localhost port 22: Connection refused

Ubuntu无法登录SSH问题-ssh: connect to host localhost port 22: Connection refused


1. 错误状态

在这里插入图片描述
出现这个问题是因为Ubuntu默认没有安装openssh-server


2. 解决办法

检查是否安装了openssh-server,使用命令

$ ps -e| grep sshd

如果出现了sshd,则说明安装了,反之则没安装

开始安装openssh-server

sudo apt-get install openssh-server

再次检查

$ ps -e| grep sshd

在这里插入图片描述
然后尝试连接到本地

ssh localhost 

在这里插入图片描述
解决问题


谢谢

发布了242 篇原创文章 · 获赞 327 · 访问量 305万+

猜你喜欢

转载自blog.csdn.net/qq_32618327/article/details/104353036