当我尝试连接到我的VPS时,它有时拒绝连接,有时并不改变configuration。
$ ssh vps -vvvv OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /Users/**/.ssh/config debug1: /Users/**/.ssh/config line 4: Applying options for * debug1: /Users/**/.ssh/config line 8: Applying options for vps debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to **.**.**.** [**.**.**.**] port **. debug1: connect to address **.**.**.** port **: Connection refused ssh: connect to host **.**.**.** port **: Connection refused
然而,虽然它没有响应, sshd本身似乎工作。
$ service --status-all | grep ssh [ + ] ssh $ ps auxf | grep ssh root 8368 0.0 0.0 49272 660 ? Ss 2014 0:00 /usr/sbin/sshd -D $ uptime 22:33:26 up 66 days, 6:34, 6 users, load average: 0.18, 0.24, 0.13
(注意:这些命令不是通过ssh执行的)
另外,像Apache这样的其他服务正在工作,并且能够通过HTTP访问。 任何关于发生什么的想法?
$ sudo iptables -L -n -v Chain INPUT (policy ACCEPT 5156 packets, 4606K bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 1 packets, 231 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 3494 packets, 693K bytes) pkts bytes target prot opt in out source destination $ sudo lsof -i:3843 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 8368 root 3u IPv4 384433104 0t0 TCP *:3843 (LISTEN) sshd 8368 root 4u IPv6 384433106 0t0 TCP *:3843 (LISTEN) $ free -m total used free shared buffers cached Mem: 1024 368 655 0 0 107 -/+ buffers/cache: 261 762 Swap: 1024 92 931 $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION="Ubuntu 10.10" $ tail -500 /var/log/auth.log | grep -i ssh Jan 10 21:27:30 ******** sshd[8368]: Received signal 15; terminating. Jan 10 21:28:41 ******** sshd[229]: Received signal 15; terminating. Jan 10 21:28:41 ******** sshd[304]: Server listening on 0.0.0.0 port 3843. Jan 10 21:28:41 ******** sshd[304]: Server listening on :: port 3843. Jan 10 21:28:43 ******** sshd[304]: Received signal 15; terminating. Jan 10 21:28:43 ******** sshd[391]: Server listening on 0.0.0.0 port 3843. Jan 10 21:28:43 ******** sshd[391]: Server listening on :: port 3843.
$ sudo ufw allow 3843/tcp Traceback (most recent call last): File "/usr/sbin/ufw", line 89, in <module> ui = ufw.frontend.UFWFrontend(pr.dryrun) File "/usr/lib/python2.6/dist-packages/ufw/frontend.py", line 158, in __init__ self.backend = UFWBackendIptables(dryrun) File "/usr/lib/python2.6/dist-packages/ufw/backend_iptables.py", line 45, in __init__ ufw.backend.UFWBackend.__init__(self, "iptables", d, files) File "/usr/lib/python2.6/dist-packages/ufw/backend.py", line 66, in __init__ self.iptables_version = ufw.util.get_iptables_version(self.iptables) File "/usr/lib/python2.6/dist-packages/ufw/util.py", line 644, in get_iptables_version (rc, out) = cmd([exe, '-V']) File "/usr/lib/python2.6/dist-packages/ufw/util.py", line 273, in cmd out = sp.communicate()[0] File "/usr/lib/python2.6/subprocess.py", line 688, in communicate self.wait() File "/usr/lib/python2.6/subprocess.py", line 1182, in wait pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) File "/usr/lib/python2.6/subprocess.py", line 455, in _eintr_retry_call return func(*args) OSError: [Errno 10] No child processes
可能与上游服务提供商有关?
做一个NMAP来查看端口是否打开或过滤,这应该是告诉你,如果它的端口被防火墙或没有。
你也可以做一个嗅探,看看交通如何performance。
“有时”方面给我一个路由问题。 我会采取一个tcpdump的服务器和客户端接口,也看看沿途的ip route 。