之前一直用阿里云做跳板连接内网机
节后突然服务器连不上了,显示
Connecting to xxxx...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(阿里云穿透) at 19:26:24.
一步步排查错误,在阿里云上每次点击连接都会弹出错误:
ssh channel 2: open failed: connect failed: Connection refused
这就说明阿里云上的ssh本地转发是没有问题,问题出在从ecs到内网机的autossh连接问题上
这个问题查了很多资料都没法解决我的问题,花了两天时间后,突发奇想,把所有转发端口全部更换看看怎么样。
结果在阿里云上更新了安全组,把连接端口、转发端口,监视端口全部更换后,就没问题了。
特此记录一下,纪念我心烦的两天时间。