Google Compute Engine 重启后无法连接

Google Compute Engine 重启后无法连接

由于过度使用,我不得不升级我的机器,这导致机器重启。之后我无法通过 PuTTY 连接,只能使用 Google 控制台。

另外,我的 SVN 存储库在那里,但我也无法连接到它。

我查看了“VPC 网络”中的防火墙规则,它们在重启之前是相同的:

在此处输入图片描述

iptables -L 的输出:

[newuser@google-server ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            
INPUT_direct  all  --  anywhere             anywhere            
INPUT_ZONES_SOURCE  all  --  anywhere             anywhere            
INPUT_ZONES  all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            
FORWARD_direct  all  --  anywhere             anywhere            
FORWARD_IN_ZONES_SOURCE  all  --  anywhere             anywhere            
FORWARD_IN_ZONES  all  --  anywhere             anywhere            
FORWARD_OUT_ZONES_SOURCE  all  --  anywhere             anywhere            
FORWARD_OUT_ZONES  all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
OUTPUT_direct  all  --  anywhere             anywhere            

Chain FORWARD_IN_ZONES (1 references)
target     prot opt source               destination         
FWDI_trusted  all  --  anywhere             anywhere            
FWDI_trusted  all  --  anywhere             anywhere            

Chain FORWARD_IN_ZONES_SOURCE (1 references)
target     prot opt source               destination         

Chain FORWARD_OUT_ZONES (1 references)
target     prot opt source               destination         
FWDO_trusted  all  --  anywhere             anywhere            
FWDO_trusted  all  --  anywhere             anywhere            

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target     prot opt source               destination         

Chain FORWARD_direct (1 references)
target     prot opt source               destination         

Chain FWDI_trusted (2 references)
target     prot opt source               destination         
FWDI_trusted_log  all  --  anywhere             anywhere            
FWDI_trusted_deny  all  --  anywhere             anywhere            
FWDI_trusted_allow  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain FWDI_trusted_allow (1 references)
target     prot opt source               destination         

Chain FWDI_trusted_deny (1 references)
target     prot opt source               destination         

Chain FWDI_trusted_log (1 references)
target     prot opt source               destination         

Chain FWDO_trusted (2 references)
target     prot opt source               destination         
FWDO_trusted_log  all  --  anywhere             anywhere            
FWDO_trusted_deny  all  --  anywhere             anywhere            
FWDO_trusted_allow  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain FWDO_trusted_allow (1 references)
target     prot opt source               destination         

Chain FWDO_trusted_deny (1 references)
target     prot opt source               destination         

Chain FWDO_trusted_log (1 references)
target     prot opt source               destination         

Chain INPUT_ZONES (1 references)
target     prot opt source               destination         
IN_trusted  all  --  anywhere             anywhere            
IN_trusted  all  --  anywhere             anywhere            

Chain INPUT_ZONES_SOURCE (1 references)
target     prot opt source               destination         

Chain INPUT_direct (1 references)
target     prot opt source               destination         

Chain IN_trusted (2 references)
target     prot opt source               destination         
IN_trusted_log  all  --  anywhere             anywhere            
IN_trusted_deny  all  --  anywhere             anywhere            
IN_trusted_allow  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain IN_trusted_allow (1 references)
target     prot opt source               destination         

Chain IN_trusted_deny (1 references)
target     prot opt source               destination         

Chain IN_trusted_log (1 references)
target     prot opt source               destination         

Chain OUTPUT_direct (1 references)
target     prot opt source               destination  

我的 ssh 密钥仍在,.ssh/authorized_keys但是当使用 PuTTY 时,甚至在询问用户之前,它就死机了:

Network error: connection timeout

当我尝试更新我的 SVN 本地副本时,它会死机“因为主机没有响应”。

我已经看过的内容:

  • 因为我使用 Google 控制台的访问非常顺畅,所以不要解决这个问题
  • 两者都不,因为这涉及到首次连接的问题

答案1

问题的原因是重启后 IP 发生变化

我认为最好通知一下,除了重启之外,机器还可能遭受 IP 更改,除非你保留静态外部 IP

幸运的是,这不是我的生产服务器,所以这种变化只是让我沮丧了几个小时,直到我发现了问题。

相关内容