ITeye博客

Ubuntu下 ssh : connect to host localhost port 22:Connection refused

asyty · 2012-03-05 13:19 · NOSQL · 开源软件 · Markdown

Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused

 

造成这个错误的原因可能是ssh-server未安装或者未启动。ubuntu 11.10 默认安装openssh-client,但是木有安装server

 

运行 ps -e | grep ssh,查看是否有sshd进程

 

如果没有,说明server没启动,通过 /etc/init.d/ssh -start 启动server进程,如果提示ssh不存在 那么就是没安装server

 

通过 sudo apt-get install openssh-server命令安装即可

 

 

 

转载请注明源 http://asyty.iteye.com/blog/1440141

评论(2)

  1. #2 楼 · asyty · 2012-10-25 18:20

    xiaoyao3857 writes:

    但如果显示连Ubuntu都找不到package openssh-server呢?那该怎么办?

    一般是网络或者你的源有问题,/etc/apt/sources.list或者直接通过更新管理器 修改一下源。。

  2. #1 楼 · xiaoyao3857 · 2012-10-24 17:37

    但如果显示连Ubuntu都找不到package openssh-server呢?那该怎么办?

评论功能维护中,当前仅展示历史评论。