Cursor remote-ssh远程没有密码输入框弹出连接失败问题解决

166 阅读2分钟

 问题描述

使用 cursor ssh连接服务器时,cursor没有弹出密码输入框。 由于不知道配置密码,ssh总是连接失败。报错信息如下:

[info] Resolving ssh remote authority '100.xx.xx.xx' (Unparsed 'ssh-remote+7b22686f73744e616d65223a223130302e31302e3130322e3835227d') (attempt #1)
[info] SSH askpass server listening on port 4125
[debug] hostname: 100.xx.xx.xx, remote platform map: {"39.96.xxx.xxx":"linux","connect.nmb2.seetacloud.com":"linux","100.xx.xx.xx":"linux","192.168.8.xx":"linux"}
[info] Using configured platform linux for remote host 100.xx.xx.xx
[debug] hostname: 100.xx.xx.xx, remote server install map: {}
[info] Using askpass script: c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\scripts\launchSSHAskpass.bat with javascript file c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\scripts\sshAskClient.js. Askpass handle: 4125
[info] Launching SSH server via shell with command: Get-Content -Raw "C:\Users\Admin\AppData\Local\Temp\cursor_remote_install_2ff44b74-004b-4e70-966a-913dc88e86db.sh" | ssh -T -D 4127 100.xx.xx.xx bash --login -c bash
[info] Establishing SSH connection: Get-Content -Raw "C:\Users\Admin\AppData\Local\Temp\cursor_remote_install_2ff44b74-004b-4e70-966a-913dc88e86db.sh" | ssh -T -D 4127 100.xx.xx.xx bash --login -c bash
[info] Started installation script. Waiting for it to finish...
[info] Waiting for server to install...
[info] (ssh_tunnel) stderr: CreateProcessW failed error:2

[info] (ssh_tunnel) stderr: ssh_askpass: posix_spawnp: No such file or directory

[info] (ssh_tunnel) stderr: Permission denied, please try again.

[info] (ssh_tunnel) stderr: CreateProcessW failed error:2

[info] (ssh_tunnel) stderr: ssh_askpass: posix_spawnp: No such file or directory

[info] (ssh_tunnel) stderr: Permission denied, please try again.

[info] (ssh_tunnel) stderr: CreateProcessW failed error:2

[info] (ssh_tunnel) stderr: ssh_askpass: posix_spawnp: No such file or directory

[info] (ssh_tunnel) stderr: root@100.xx.xx.xx: Permission denied (publickey,password).

[error] Error installing server: [Error: Failed to connect to the remote SSH host. Please check the logs for more details.
	at t.installCodeServer (c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\main.js:1:92284)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\main.js:1:146441]
[info] Deleting local script C:\Users\Admin\AppData\Local\Temp\cursor_remote_install_2ff44b74-004b-4e70-966a-913dc88e86db.sh
[error] Error resolving SSH authority [Error: Failed to connect to the remote SSH host. Please check the logs for more details.
	at t.installCodeServer (c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\main.js:1:92284)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async c:\Users\Admin.cursor\extensions\anysphere.remote-ssh-1.0.26\dist\main.js:1:146441]

解决方法

打开 cursor -> extension -> remote-ssh, 点击插件的设置图标进入设置界面

image.png

在设置界面的最底部的 Remote.SSH: Show Login Terminal 选项勾选上即可,后续ssh即可进行输入密码进行登录

image.png 在菜单栏左侧设置进行ssh连接的服务器配置,进行连接。密码框正确弹出,输入密码后连接成功

image.png