unable to start ssh-agent service, error :1058 问题的解决方法

Windows 10 启动 ssh-agent 命令时,抛出 unable to start ssh-agent service, error :1058 :

(1)原因分析

ssh-agent 服务的启动类型设置不正确。

(2)问题解决

使用管理员权限运行 Power Shell,然后执行Set-Service -Name ssh-agent -StartupType automatic

Set-Service 命令可以启动、停止、挂起或暂停服务,具体描述如下:

The Set-Service cmdlet changes the properties of a service such as the Status, Description, DisplayName, and StartupType. Set-Service can start, stop, suspend, or pause a service. To identify a service, enter its service name or submit a service object. Or, send a service name or service object down the pipeline to Set-Service.

这里是把 ssh-agent 的启动类型设置为自动方式。

[14:10:59.703] Log Level: 2 [14:10:59.709] SSH Resolver called for "ssh-remote+192.168.124.6", attempt 1 [14:10:59.710] "remote.SSH.useLocalServer": false [14:10:59.710] "remote.SSH.useExecServer": false [14:10:59.710] "remote.SSH.showLoginTerminal": false [14:10:59.710] "remote.SSH.remotePlatform": {} [14:10:59.710] "remote.SSH.path": undefined [14:10:59.710] "remote.SSH.configFile": undefined [14:10:59.710] "remote.SSH.useFlock": true [14:10:59.710] "remote.SSH.lockfilesInTmp": false [14:10:59.710] "remote.SSH.localServerDownload": auto [14:10:59.710] "remote.SSH.remoteServerListenOnSocket": false [14:10:59.710] "remote.SSH.showLoginTerminal": false [14:10:59.710] "remote.SSH.defaultExtensions": [] [14:10:59.710] "remote.SSH.loglevel": 2 [14:10:59.710] "remote.SSH.enableDynamicForwarding": true [14:10:59.710] "remote.SSH.enableRemoteCommand": false [14:10:59.711] "remote.SSH.serverPickPortsFromRange": {} [14:10:59.711] "remote.SSH.serverInstallPath": {} [14:10:59.712] VS Code version: 1.85.2 [14:10:59.712] Remote-SSH version: remote-ssh@0.108.2023112915 [14:10:59.712] win32 x64 [14:10:59.713] SSH Resolver called for host: 192.168.124.6 [14:10:59.713] Setting up SSH remote "192.168.124.6" [14:10:59.716] Using commit id "8b3775030ed1a69b13e4f4c628c612102e30a681" and quality "stable" for server [14:10:59.719] Install and start server if needed [14:11:00.628] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe -V" [14:11:00.630] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe ENOENT [14:11:00.630] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V" [14:11:00.631] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT [14:11:00.631] Checking ssh with "C:\Windows\system32\ssh.exe -V" [14:11:00.632] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [14:11:00.632] Checking ssh with "C:\Windows\ssh.exe -V" [14:11:00.632] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [14:11:00.632] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [14:11:00.633] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [14:11:00.633] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [14:11:00.634] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [14:11:00.634] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [14:11:00.654] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 [14:11:00.657] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58191 "192.168.124.6" bash [14:11:00.658] Terminal shell path: C:\Windows\System32\cmd.exe [14:11:01.076] > root@192.168.124.6's password:]0;C:\Windows\System32\cmd.exe [14:11:01.076] Got some output, clearing connection timeout [14:11:01.077] Showing password prompt [14:11:03.383] Got password response [14:11:03.383] "install" wrote data to terminal: "******" [14:11:03.428] > [14:11:03.987] > 43b74eacbca4: running [14:11:04.112] > Acquiring lock on /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-remote-lock.root.8b3775030ed1a69b13e4f4c628c612102e30a681 [14:11:04.127] > Installing to /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681... [14:11:04.143] > 43b74eacbca4%%1%% [14:11:04.160] > Downloading with wget [14:11:11.206] > wget download failed > wget: unable to resolve host address ‘update.code.visualstudio.com’ > printenv: > SSH_CONNECTION=192.168.124.33 58192 192.168.124.6 22 > LANG=en_US.UTF-8 > XDG_SESSION_ID=1 > USER=root > PWD=/root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681 > HOME=/root > SSH_CLIENT=192.168.124.33 58192 22 > MAIL=/var/mail/root > SHELL=/bin/bash > SHLVL=2 > VSCODE_AGENT_FOLDER=/root/.vscode-server > LOGNAME=root > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus > XDG_RUNTIME_DIR=/run/user/0 > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin > _=/usr/bin/printenv > OLDPWD=/root > Trigger local server download > 43b74eacbca4:trigger_server_download > artifact==server-linux-arm64== > destFolder==/root/.vscode-server/bin/== > destFolder2==/8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-server.tar.gz== > 43b74eacbca4:trigger_server_download_end > Waiting for client to transfer server archive... > Waiting for /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/vs > scode-server.tar.gz.done and vscode-server.tar.gz to exist [14:11:11.206] Got request to download on client for {"artifact":"server-linux-arm64","destPath":"/root/.vscode-server/bin//8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-server.tar.gz"} [14:11:11.206] Downloading VS Code server locally... [14:11:11.221] > > [14:11:11.456] Resolver error: Error: XHR failed at k.onerror (vscode-file://vscode-app/d:/VSC/resources/app/out/vs/workbench/workbench.desktop.main.js:95:2027) [14:11:11.462] ------
最新发布
06-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值