dou*_*uyu 57 ssh ssh-keys visual-studio-code vscode-settings vscode-remote
我用vscode和remote-ssh连接我的服务器,配置后,我想连接我的主机,但失败了,对话框显示:“无法建立与XX的连接,进程试图写入一个不存在的管道。”
输出:
[16:45:20.916] Log Level: 3
[16:45:20.936] remote-ssh@0.49.0
[16:45:20.936] win32 x64
[16:45:20.944] SSH Resolver called for "ssh-remote+aliyun", attempt 1
[16:45:20.945] SSH Resolver called for host: aliyun
[16:45:20.945] Setting up SSH remote "aliyun"
[16:45:21.012] Using commit id "c47d83b293181d9be64f27ff093689e8e7aed054" and quality "stable" for server
[16:45:21.014] Install and start server if needed
[16:45:21.019] Checking ssh with "ssh -V"
[16:45:21.144] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[16:45:21.214] Running script with connection command: ssh -T -D 5023 aliyun bash
[16:45:21.221] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:45:21.504] >
>
>
> ]0;C:\WINDOWS\System32\cmd.exe
[16:45:21.505] Got some output, clearing connection timeout
[16:45:21.577] >
>
>
>
[16:45:21.592] > Bad owner or permissions on C:\\Users\\DY/.ssh/config
>
[16:45:21.689] > The process tried to write to a nonexistent pipe.
>
[16:45:22.091] "install" terminal command done
[16:45:22.092] Install terminal quit with output: The process tried to write to a nonexistent pipe.
[16:45:22.093] Received install output: The process tried to write to a nonexistent pipe.
[16:45:22.096] Resolver error: The process tried to write to a nonexistent pipe
[16:45:22.107] ------
Run Code Online (Sandbox Code Playgroud)
dou*_*uyu 75
将绝对文件路径添加到自定义SSH配置文件(C:\Users\{USERNAME}\.ssh\config),我的问题就解决了。
小智 25
如果您格式化/重新安装服务器操作系统,但使用与以前相同的 IP,您可能会遇到指纹不匹配的情况。
您可能需要删除此文件中的旧指纹:C:\Users\xxx.ssh\known_host
和文件中的旧 IP:C:\Users\xxx.ssh\config
然后再次尝试添加主机。
Leo*_* AB 13
对我有用的:
C:\Program Data\ssh和中的 ssh config 文件夹C:\<user>\.sshF1,选择Remote-SSH: Connect to Host...+ Add New SSH Host.. ssh -i "C:\path\to\key" user@host。(您需要确保该密钥具有有限的权限。删除所有继承的权限,仅将完全控制权授予所有者。)connectGon*_*ica 12
至少可能发生三件事:
选项1
配置文件的位置不是绝对位置,这意味着您可能正在使用配置文件所在的文件夹的位置。
如果是这种情况,请访问 VSCode 中的用户设置。滚动到Extensions> Remote - SSH。并config在自定义 SSH 配置文件的绝对文件路径末尾添加。在 Windows 中,可以是
C:\Users\user\.ssh\config
Run Code Online (Sandbox Code Playgroud)
见下图
选项2
身份验证问题。
如果是这种情况,可以解决的问题之一就是生成新的 SSH 密钥。
在 Windows 中,为此,我建议使用MobaXterm。
在 MobaXterm 中,打开一个新终端并写入
ssh-keygen -b 4096 -t rsa
Run Code Online (Sandbox Code Playgroud)
然后,在配置文件中,确保 指向IdentityFile密钥的位置。MobaXterm 的主目录通常是C:\Users\user\Documents\MobaXterm. 如果方便的话,可以将密钥复制/移动到C:\Users\user\.ssh配置文件中,然后添加IdentityFile ~/.ssh/KEY_rsa(其中KEY_rsa是[公共]密钥的名称)。
请注意,如果您使用PuTTY生成密钥,则在服务器 OpenSSHauthorized_keys 文件中,不需要保存的公钥,而是显示在顶部的公钥(见下图):
选项3
你的config文件可能有错。
配置文件通常如下所示。仔细检查字段是否包含建立连接所需的信息。
Host Test # This is the name we want to give the host
User user # This is the username
Hostname blabla.com # This is the hostname
PreferredAuthentications publickey
IdentityFile ~/.ssh/KEY_rsa # This is the location of the key
IdentitiesOnly yes
Port 50 # This varies
Run Code Online (Sandbox Code Playgroud)
对我有用的是删除文件夹的所有内容:C:\Users\MYNAME.ssh 这意味着删除配置文件和已知主机。配置可能是要删除的最重要的配置。
| 归档时间: |
|
| 查看次数: |
66383 次 |
| 最近记录: |