先上图片:

错误信息:The remote system refused the connection.
Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。
然后确认sshserver是否启动了:
ps -e |grep ssh

如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动了。
ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。然后重启SSH服务:
sudo /etc/init.d/ssh resar
1.首先在服务器上安装ssh的服务器端。
$ sudo aptitude install openssh-server
2.启动ssh-server。
$ /etc/init.d/ssh restart
3.确认ssh-server已经正常工作。
$ netstat -tlp

看到上面这一行输出说明ssh-server已经在运行了。
4.在客户端通过ssh登录服务器。
