上一篇博客说了。我用vsc的ssh-remote的时候,30秒或者1分钟必断。错误信息一直就类似:
[04:30:38.608] "install" terminal command done
[04:30:38.609] Install terminal quit with output:
[04:31:18.258] SSH Resolver called for "ssh-remote+neatstudio.com", attempt 2
[04:31:18.258] SSH Resolver called for host: neatstudio.com
[04:31:18.259] Setting up SSH remote "neatstudio.com"
[04:31:18.259] Using commit id "f06011ac164ae4dc8e753a3fe7f9549844d15e35" and quality "stable" for server
[04:31:18.263] Running script with connection command: ssh -o ClearAllForwardings=true -o ConnectTimeout=15 neatstudio.com bash
[04:31:18.263] Install and start server if needed
[04:31:35.269] Connecting with SSH timed out
[04:31:35.269] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout"},"measures":{"resolveAttempts":2,"retries":1}}
[04:31:35.269] ------
重连后也是
[04:37:06.477] SSH Resolver called for "ssh-remote+neatstudio.com", attempt 12
[04:37:06.477] SSH Resolver called for host: neatstudio.com
[04:37:06.477] Setting up SSH remote "neatstudio.com"
[04:37:06.478] Using commit id "f06011ac164ae4dc8e753a3fe7f9549844d15e35" and quality "stable" for server
[04:37:06.479] Running script with connection command: ssh -o ClearAllForwardings=true -o ConnectTimeout=15 neatstudio.com bash
[04:37:06.480] Install and start server if needed
[04:37:21.515] > ssh: connect to host 123.176.103.247 port 22: Operation timed out
[04:37:21.515] Got some output, clearing connection timeout
[04:37:21.776] "install" terminal command done
[04:37:21.776] Install terminal quit with output: ssh: connect to host 123.176.103.247 port 22: Operation timed out
[04:37:21.776] Received install output: ssh: connect to host 123.176.103.247 port 22: Operation timed out
[04:37:21.777] The operation timed out
[04:37:21.777] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"OfflineError"},"measures":{"resolveAttempts":12,"retries":1}}
[04:37:21.777] ------
发了ticket给layerstack。他们测试也来没有这个问题。我开始以为是什么openfiles limit的问题。也打开到最大了。
期间调整了一下这个:echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p,因为开始有报inotify max error
直到他们给我发了一个ticket:
Thank you for your patience in this matter.
We have investigated the issue in detail and we are not able to recreate the issue from our end. We have checked the same from multiple locations and find out its working fine.
The reported issue seems to be related to your local ISP, so we suggest you to change the standard port (22) of SSH to some other non standard port like 2222 or 2244, in server and recheck the issue.
Please do have a check on our above suggestion and let us know if you still face any issues in accessing.
所以我就想了一下,直接把PORT改成了2222,2223,2244,然而仍然 失败,最后我用了一个超大端口,居然正常了