红联Linux门户
Linux帮助

ssh:connect to host XXX.XXX.XXX.XXX port XX:Connection refus

发布时间:2015-09-16 10:53:06来源:linux网站作者:jamikabin

ubuntu下遇到的问题:ssh :connect to host XXX.XXX.XXX.XXX port XX: Connection refused


1.ping一下 XXX.XXX.XXX.XXX 能否ping通

我ping了之后无法ping通

windows下ping的通,记下ip


2.查看sshd服务是否启动

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

我发现我的ubuntu中根本没有sshd进程

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

通过 sudo apt-get install openssh-server命令安装即可
安装之后运行命令/etc/init.d/ssh -start,启动server

通过ps -e | grep ssh检查 sshd是否已经启动


3.sudo gedit /etc/hosts 将

ip storm

添加到文件中,例如:

172.26.178.93   igerrit

保存文件并logout,然后再登录,错误消失,可以正常repo sync到android代码了。


Ubuntu安装配置SSH(ssh: connect to host localhost port 22: Co:http://www.linuxdiyf.com/linux/10225.html