ssh 安装及登录提示:connection refused(ssh: connect to host XX.XX.XX.XX port 22: Connection refused)的解决办法
ssh 安装及登录提示:connection refused的解决办法
溪西创客小屋
原文出处:http://hi.baidu.com/leejun_2005/blog/item/fbc27c4b20e83d3a08f7ef23.html?timeStamp=1309179713928
from:http://hi.baidu.com/tunaisen/blog/item/85e0a41805ed9fb24bedbcf3.html
如果出现ssh: connect to host XX.XX.XX.XX port 22: Connection refused
请按如下步骤检查:
1、目标主机的ssh server端程序是否安装、服务是否启动,是否在侦听22端口;
检查方法:
june@ubuntu:~$ ps-ef|grep sshd
root 2859 1 020:29? 00:00:00 /usr/sbin/sshd -D
root 2901 2859 020:31? 00:00:00 sshd:june[priv]
june 2971 2901 020:31? 00:00:00 sshd:june@pts/1
june@ubuntu:~$
其中/usr/sbin/sshd为ssh clinet/server中server端的守护进程,如果上述结果中没有sshd出现,那么可能就是你的server端程序没有安装(Ubuntu11.04 默认没有安装ssh server,只安装了sshclient),或者sshd服务没有启动,这两者的解决办法请见下文详述。
2、是否允许该用户登录;
3、本机是否设置了iptables规则,禁止了ssh的连入/连出;
检查方法:
june@ubuntu:~$sudo iptables-L
[sudo] password for june:
Chain INPUT (policy ACCEPT)
target prot optsource destination
ACCEPT tcp -- anywhere anywhere tcpdpt:ssh
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot optsource destination
june@ubuntu:~$
4、查查ssh的配置文件
ls -lrt /etc/ssh
针对第一点没有安装ssh server或者没开启sshd的用户,可以参考这篇:
Ubuntu如何开启SSH服务
SSH分客户端openssh-client和openssh-server |
ssh 安装及登录提示:connection refused(ssh: connect to host XX.XX.XX.XX port 22: Connection refused)的解决办法相关推荐
- Windows登录虚拟机Ubuntu系统登录不成功解决办法(ssh: connect to host 192.168.220.128 port 22: Connection refused)
我在windows端第一次连接自己电脑虚拟机建立的Ubuntu系统时出现如下问题 ssh: connect to host 192.168.220.128 port 22: Connection re ...
- 可以ping通 但ssh: connect to host 192.168.0.2 port 22: Connection refused
目录 问题描述 原因 解决 问题描述 自己在树莓派端通过SCP指令给电脑上ubuntu传输文件发现提示:ssh: connect to host 192.168.0.2 port 22: Connec ...
- ssh连接服务器出现:ssh: connect to host 192.168.1.107 port 22: Connection refused 的解决方法
文章目录: 1 说明遇到问题场景 2 解决方式 1 说明遇到问题场景 1.我的系统环境 windows10 连接的服务器系统为:Mint19.3 2.我使用windows,在局域网下通过ssh连接服务 ...
- ssh: connect to host 192.168.101.34 port 22: Connection timed out
背景: 使用 Cygwin64 登录虚拟机时发现无法远程登录虚拟机中Ubuntu系统(之前可以): $ ssh lc@192.168.101.34 ssh: connect to host 192.1 ...
- connect to host xxx.xxx.xxx.xxx port 22: Connection refused
connect to host xxx.xxx.xxx.xxx port 22: Connection refused 问题:win10使用ssh远程登录VMWare虚拟机上安装的Ubantu系统时连 ...
- LINUX开启ssh服务,报错:ssh: connect to host 192.168.0.101 port 22: Connection refused
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...
- LINUX开启ssh服务,报错:ssh: connect to host 192.168.6.129 port 22: Connection refused
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...
- ssh 错误 ssh: connect to host 192.168.1.106 port 22: Connection refused
感谢这篇文字的主人:http://asyty.iteye.com/blog/1440141 Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host ...
- ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
问题描述: 我在尝试通过 SSH 连接到目标服务器时遇到了问题.具体地说,当我尝试使用 SSH 客户端连接到服务器的 IP 地址时,出现了 "ssh: connect to host [IP ...
- GIT 远程仓库更换ip,导致本地拉取代码报错:ssh: connect to host 192.xxx.0.xxx port 22: Connection timed out fatal: Coul
目录 报错信息 问题产生背景 解决方案 报错信息 git pull origin 1.0.0-develop ssh: connect to host xxx.xxxx.xx.xxx port 22: ...
最新文章
- python从入门到精通书-Python从入门到精通(资源汇总)
- 用word发CSDN blog,免去插图片的烦恼
- mpc 安全多方计算协议_BNC公链 | 不看到数据却能进行计算?一文了解安全多方计算...
- 大人的世界啊,全是屁股!
- Nginx的location区块的作用及设置
- fpga 输入信号除了1和0还有别的状态?
- 【目标检测】目标检测中的多尺度检测(Multi-Scale),FPN,RPN
- git push :unable to write sha1 filename ./bojects/xxxx:权限不够
- springboot集成阿里云直播,低延时直播
- 抗渗等级p6是什么意思_混凝土防水等级S6,P6分别是什么意思
- vscode中怎样格式化js代码_vsCode配置代码格式化
- 经典算法之直接插入排序法
- 3D Touch介绍:电子秤App与快捷操作
- win32编程的经典书籍
- LeetCode376 摇摆序列
- HTML+CSS+JS制作【俄罗斯方块】小游戏
- Spark on YARN - Clinet模式运行spark报错问题
- SDUSTOJ1670 Problem C: 农夫果园
- Sql 判断日期是否在本月内
- APS期刊投稿准备: REVTex格式