mac,在终端能连接上远程服务器,但是vscode却一直显示超时。报错如下:
Spawned 51042
[16:12:08.369] > local-server-1> Spawned ssh, pid=51049
[16:12:08.372] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[16:12:08.544] stderr> Authenticated to 222.20.95.246 ([222.20.95.246]:22).
[16:12:25.254] Terminating local server
[16:12:25.258] Resolver error: Error: Connecting with SSH timed out
at Function.Timeout (/Users/zhangfan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.82.1/out/extension.js:1:585345)
at Timeout._onTimeout (/Users/zhangfan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.82.1/out/extension.js:1:630524)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
[16:12:25.268] ------
可能是因为服务器太慢,等太久而报错,可以将超时时间设置长一些。步骤如下图,我将超时时间改成了60: