ssh: connect to host xxx.xxx.xxx.xxx port 22:Connection refused(以Ubuntu12.04替例)
ssh: connect to host xxx.xxx.xxx.xxx port 22:Connection refused(以Ubuntu12.04为例)
如果没有sshd进程,则使用如下命令:
使用ssh时出现错误提示connect to host xxx.xxx.xxx.xxx port 22:Connection refused。
引起这个错误的原因是ssh-server没有启动或者没有安装(Ubuntu12.04默认只安装了openssh-client,没有安装openssh-server)。
1.查看openssh-sever是否启动
运行命令:
ps -e | grep sshd
如果没有sshd进程,则使用如下命令:
sudo /etc/init.d/ssh start
如果提示ssh不存在,说明openssh-server没有安装,通过如下命令安装openssh-server。
sudo apt-get install openssh-server