ubuntu能ping通却ssh不上(connect to localhost port 22: Connection refused)解决办法

1. 问题描述:

ssh 192.168.144.130
ssh: connect to host 192.168.144.130 port 22: Connection refused
这里写图片描述

2. 原因

因为Ubuntu默认没有安装openssh-server

  • 检查是否安装:
$ ps -e|grep ssh

如果输出没有或者只有一个ssh-agent就说没没安装.

这里写图片描述

3.解决办法

  • 安装openssh-server
$ sudo apt-get install openssh-server
  • 检查是否安装成功
$ ssh localhost
//或者用
$ ps -e|grep ssh
  • 如果要输密码就说明成功
    ubuntu能ping通却ssh不上(connect to localhost port 22: Connection refused)解决办法_第1张图片

  • 如有其他问题欢迎留言探讨!!

你可能感兴趣的:(Linux)