linux VS代码SSH远程连接问题

2w3rbyxf  于 2023-01-25  发布在  Linux
关注(0)|答案(7)|浏览(312)

我一直在使用VS代码和远程连接从家里我的MacBookPro上工作的大学项目在过去的一个月,由于某种原因,它将无法连接到计算机实验室服务器了.不知道为什么会发生这种情况,但它今天刚刚停止工作.我尝试重新安装VS代码,也安装在我妻子的计算机上,但它仍然无法通过远程ssh连接.不知道为什么会发生这种情况,但现在我没有办法调试我的代码,只能通过我的mac上的终端应用程序使用emacs编辑一切。我没有做任何更改,从昨晚到今天早上..我仍然可以ssh到计算机实验室服务器从终端罚款。贝娄是一些日志,似乎重复自己,而它试图连接使用扩展:远程ssh。
任何帮助这将是非常感谢,或者有其他IDE的,有点容易通过ssh远程连接可用于Mac?
我的日志:

17:09:21.150] Log Level: 2
[17:09:21.152] remote-ssh@0.55.0
[17:09:21.152] darwin x64
[17:09:21.153] SSH Resolver called for "ssh- remote+7b22686f73744e616d65223a226c696e75782e63732e75736d2e6d61696e652e656475222c2275736572223a22746b7766c6b227d", attempt 1
[17:09:21.154] SSH Resolver called for host: tkwilk@linux.cs.usm.maine.edu
[17:09:21.154] Setting up SSH remote "linux.cs.usm.maine.edu"
[17:09:21.158] Acquiring local install lock: /var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-remote-ssh-tkwilk@linux.cs.usm.maine.edu-install.lock
[17:09:21.192] Looking for existing server data file at /Users/twilk31888 1/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-tkwilk@linux.cs.usm.maine.edu-93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3-0.55.0/data.json
[17:09:21.194] Using commit id "93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3" and quality "stable" for server
[17:09:21.195] Install and start server if needed
[17:09:21.220] Checking ssh with "ssh -V"
[17:09:21.233] > OpenSSH_8.1p1, LibreSSL 2.7.3

[17:09:21.249] askpass server listening on /var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-a45a56dcf061823c964fa6ae7ff720ac39d2477f.sock
[17:09:21.249] Spawning local server with {"ipcHandlePath":"/var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-c1cf58194111018972f9cf0cd413a94b7293bda9.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","54601","-o","ConnectTimeout=15","tkwilk@linux.cs.usm.maine.edu"],"dataFilePath":"/Users/twilk31888 1/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-tkwilk@linux.cs.usm.maine.edu-93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3-0.55.0/data.json"}
[17:09:21.249] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/twilk31888 1/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/twilk31888 1/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-a45a56dcf061823c964fa6ae7ff720ac39d2477f.sock"}
[17:09:21.262] Spawned 4239
[17:09:21.373] > local-server> Spawned ssh: 4240
[17:09:21.379] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[17:09:21.756] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:wny4SU/uVC6y9cUUH5kJnRe5SVWpBhWGABpWSYzMNG0
[17:09:22.132] stderr> Authenticated to linux.cs.usm.maine.edu ([130.111.131.121]:22).
[17:09:22.490] > ready: 946b80caa0f2
[17:09:22.553] > Linux 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020
[17:09:22.554] Platform: linux
[17:09:22.685] > 946b80caa0f2: running
[17:09:22.713] > Acquiring lock on /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
> Installation already in progress...
> 946b80caa0f2##24##
[17:09:22.714] Received install output: 946b80caa0f2##24##
[17:09:22.714] Server installation process already in progress - waiting and retrying
[17:09:22.714] Terminating local server
[17:09:22.740] Local server exit: 15
wsxa1bj1

wsxa1bj11#

行中提供了密钥信息

[17:09:22.713] > Acquiring lock on /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3

如果您可以将ssh导入服务器并通过以下方式删除文件

rm -rf /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3

然后重新启动vscode并尝试连接,应该没问题。

aij0ehis

aij0ehis2#

在两台服务器上遇到相同的问题,但原因不同:

  • 通过参考该问题解决了一个问题:#2805
  • 命令面板-〉选择“远程SSH:终止主机上的VS代码服务器...”
  • 删除远程服务器上的“~/.vscode-server”目录。
  • 另一个问题是由于该服务器上的存储配额耗尽而导致的。当配额增加时,这个问题会自动解决。
eqqqjvef

eqqqjvef3#

我看到的大多数microsoft/vscode-remote-release,像issue 2901一样,都是关于目标服务器上失败的符号链接。
如果可以在命令行中使用ssh,请尝试重命名/home/students/tkwilk/.vscode-server,以便强制通过VSCode完全重新安装SSH远程插件。

mv ~/.vscode-server ~/.vscode-server-old

尝试通过VSCode连接到该服务器,并在尝试重做完整的vscode-server SSH设置时查看问题是否仍然存在。

57hvy0tb

57hvy0tb4#

我找到了一个新的理由,但可能很罕见:
在我发现这个问题之前,我已经更新和修改了远程虚拟机的linux内核,并且修改了位于/include/linux/uts.h中的UTS_SYSNAME;

#define UTS_SYSNAME "Linux Clstilmldy-LZM"
// #define UTS_SYSNAME "Linux"

所以我遇到了这个问题,但始终没有找到可行的解决方案;
我仔细查看了vscode输出,发现vscode远程ssh:Unsupported platform: Linux Clstilmldy LZM ;

[16:38:25.333] SSH Resolver called for host: Ubuntu
[16:38:25.334] Setting up SSH remote "Ubuntu"
...
[16:38:35.555] Got password response
[16:38:35.555] "install" wrote data to terminal: "******"
[16:38:35.574] > 
[16:38:36.069] > ac25402ecd5f: running
[16:38:36.086] > Unsupported platform: Linux Clstilmldy-LZM
[16:38:36.096] > ac25402ecd5f: start

我猜vscode远程ssh无法识别Linux、Mac和Windows以外的系统名称,所以我将这一行改了回去。
我重新编译并安装内核。
okkk,我解决了这个问题。

9w11ddsr

9w11ddsr5#

我也遇到过同样的问题,用VonC的方法解决了,但这只是我的第一步,因为它还不起作用:Vscode需要反复输入密码,但仍然无法登录。
当我重命名vscode文件和链接到互联网时,它工作了。
我想它需要下载一些东西。

piah890a

piah890a6#

我遇到了完全相同的问题,通过临时重命名VS Code在/home目录中创建的.vscode-server目录解决了这个问题。在接下来使用Remote-SSH连接到服务器时,将创建该文件的新版本,并且可以删除重命名的文件。
正如@VonC在上文中所写:)

ht4b089n

ht4b089n7#

VonC的回答也解决了我的问题:“)
只需从终端通过ssh'ing使用以下命令
mv .vscode-server .vscode-server-old
“mv”用于更改目录名称。

相关问题