在ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)

转载来自:

http://blog.csdn.net/feliciafay/article/details/6561414

首先谢谢你了,解决了我的问题!


要成功地装ssh需要三步。

第一步,在https://launchpad.net/ubuntu/lucid/i386/openssh-client/1:5.3p1-3ubuntu3下载文件并安装。

第二步,在https://launchpad.net/ubuntu/lucid/i386/openssh-server/1:5.3p1-3ubuntu3下载文件并安装。

第三步,在https://launchpad.net/ubuntu/lucid/i386/ssh/1:5.3p1-3ubuntu3下载文件并安装。

剩下的事儿就好办了。下载安装即可。

下载并安装第一个文件

hadoopr@ubuntu:~/Downloads$ sudo dpkg -i openssh-client_5.3p1-3ubuntu3_i386.deb 
dpkg: warning: downgrading openssh-client from 1:5.3p1-3ubuntu5 to 1:5.3p1-3ubuntu3.

(Reading database ... 127436 files and directories currently installed.)
Preparing to replace openssh-client 1:5.3p1-3ubuntu5 (using openssh-client_5.3p1-3ubuntu3_i386.deb) ...
Unpacking replacement openssh-client ...
Setting up openssh-client (1:5.3p1-3ubuntu3) ...
Processing triggers for man-db ...

下载并安装第二个文件

hadoopr@ubuntu:~/Downloads$ sudo dpkg -i openssh-server_5.3p1-3ubuntu3_i386.deb 
Selecting previously deselected package openssh-server.

(Reading database ... 127436 files and directories currently installed.)
Unpacking openssh-server (from openssh-server_5.3p1-3ubuntu3_i386.deb) ...
Setting up openssh-server (1:5.3p1-3ubuntu3) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
 * Stopping OpenBSD Secure Shell server sshd                                                              [ OK ] 
ssh start/running, process 3822
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw ...
Processing triggers for man-db ...

下载并安装第三个文件

hadoopr@ubuntu:~/Downloads$ sudo dpkg -i ssh_5.3p1-3ubuntu3_all.deb 
(Reading database ... 127454 files and directories currently installed.)

Preparing to replace ssh 1:5.3p1-3ubuntu3 (using ssh_5.3p1-3ubuntu3_all.deb) ...
Unpacking replacement ssh ...
Setting up ssh (1:5.3p1-3ubuntu3) ...

最后试了试,成功。

hadoopr@ubuntu:~/Downloads$ ssh localhost
The authenticity of host 'localhost (::1)' can't be established.

RSA key fingerprint is 0f:f5:b7:32:06:a3:3c:4c:de:fb:04:aa:8a:f2:2d:ee.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值