在尝试通过 SSH 从 OS X 连接到带有 WHM 控制面板的 CentOS VPS 时,我不断收到“连接被拒绝”。WHM 中启用了 SSH,并且我已经生成了 SSH 密钥。我还尝试了关闭防火墙的 SSH 一分钟,但没有运气。
仔细阅读其他问题后,我跑了ssh -vv root@xx.xxx.xx.xx
,这给了我:
debug2: ssh_connect: needpriv 0
debug1: connect to address xx.xxx.xx.xx port 22: Connection refused
Run Code Online (Sandbox Code Playgroud)
跑步 nc -zvw 2 xx.xxx.xx.xx 22
给了我
nc: connect to xx.xxx.xx.xx port 22 (tcp) failed: Connection refused
Run Code Online (Sandbox Code Playgroud)
这些到底是什么意思?我还能尝试什么?
该端口似乎已关闭(或已过滤,但您说您已经尝试禁用防火墙 - 您的意思是 VPS 上的防火墙,对吗?)。
如果您可以通过其他方式访问,您能否将此命令的输出发布到 VPS 上?
netstat -ntlp
Run Code Online (Sandbox Code Playgroud)
它应该列出所有打开的端口。如果您有多个,请检查端口 22 是否在正确的 IP 上。
您在 OSX 客户端上有传出流量防火墙规则吗?
编辑:我冒昧地对该主机运行端口扫描,它似乎没有任何防火墙,因为许多端口是打开的(你应该尽可能关闭一些或大部分)。不过 SSH 似乎没有启动:
Starting Nmap 5.00 ( http://nmap.org ) at 2011-04-13 15:36 GMT+3
Interesting ports on ns1.resume-resource.com (72.249.28.26):
Not shown: 958 filtered ports, 31 closed ports
PORT STATE SERVICE
21/tcp open ftp
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp open https
465/tcp open smtps
993/tcp open imaps
995/tcp open pop3s
2200/tcp open unknown
Run Code Online (Sandbox Code Playgroud)
尝试/etc/init.d/sshd restart
并检查/var/log/messages
错误。
归档时间: |
|
查看次数: |
17565 次 |
最近记录: |