secureCRT连接ubuntu问题- The remote system refused the connection  http://jxyang.iteye.com/blog/1484915



解决方案:


1.安装openssh-server

Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用sudo apt-get install openssh-server安装上即可。


1.1输入命令:sudo apt-get install openssh-server


1.2确认openssh-server是否启动了:

      ps -e |grep ssh

正常情况下结果为:

1584 ?        00:00:00 ssh-agent

2299 ?       00:00:00 sshd


1.3如果只有ssh-agent,则openssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明openssh-server已经启动了。


2.ssh-server配置文件位于/etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。然后重启SSH服务:


sudo /etc/init.d/ssh restart


====================================================

FOR CENTOS:

[root@localhost ~]# ssh 192.168.0.78

ssh: connect to host 192.168.0.78 port 22: Connection refused

[root@localhost ~]# ps -e|grep ssh

...no result


[root@localhost ~]# yum install openssh-server

...install infomation

[root@localhost ~]# service sshd start

Starting sshd:                                             [  OK  ]


[root@localhost ~]# ps -ef|grep ssh

root      19262      1  0 15:32 ?        00:00:00 /usr/sbin/sshd

root      19267  18566  0 15:33 pts/0    00:00:00 grep ssh


====================================================