VScode remote connection error: The process tried to write to a nonexistent pipe

荒凉一梦 提交于 2020-12-28 06:56:36

问题


I use vscode with remote-ssh to connect my server, after configuring, I want to connect my host, but it failed, the dialog box display:"could not establish connection to XX, The process tried to write to a nonexistent pipe."

output:

[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] ------


回答1:


Add the absolute file path to a custom SSH config file(C:\Users\{USERNAME}\.ssh\config), and my problem is solved.




回答2:


What worked for me was to delete all of the contents of folder: C:\Users\MYNAME.ssh That meant to delete both the config file and known-hosts. The config was probably the most important one to delete.




回答3:


What worked for me:

  1. delete ssh config folder both in C:\Program Data\ssh and C:\<user>\.ssh
  2. In VS Code, press F1, choose Remote-SSH: Connect to Host...
  3. Do NOT enter anything in the prompt, but instead choose + Add New SSH Host..
  4. Enter the full ssh command, including the key (in case of Windows, you may want to enclose the path with double quote mark) ssh -i "C:\path\to\key" user@host. (you need to make sure the key has a limited permission. Remove all inherited permissions, and only give a full control to the owner.)
  5. You will be asked to choose a folder in which a new config file will be created. Choose any of the two options.
  6. There will a prompt notifying that the new config file has been created. Click connect



回答4:


Had an existing(working) configuration and had the same error when I added a new one. What worked for me is instead of just adding a new host configuration, I also commented out the first working config. Didn't know what happened but it worked.




回答5:


If you format/re-install Server OS, but use same IP as before, you may encounter fingerprint mismatched.

You may need to delete old fingerprint in this file: C:\Users\xxx.ssh\known_host

and old IP in the file: C:\Users\xxx.ssh\config

Then try to add host again.




回答6:


In my case I had another setup:

  • Git bash in Windows was configured and I am using the ssh.exe provided by this tool
  • In the "Remote SSH" extension in VSCode, I specified the full path of this ssh.exe
  • I am using multiple servers (with ProxyJump)
  • The error message is the same as the OP but in the logs it was written that the ssh config file was not found, where all the folder names was concatenated (because it did not recognize the windows path separator)

Problem: the ssh.exe is using a different path convention thant VSCode. ssh.exe is using the "/c/Users/..." pattern and VSCode is using the "C:\Users..." pattern.

Solution:

  1. Make sure the SSH config is at a standard place (C:\Users\LOGIN\.ssh\config)
  2. Remove the absolute path of the config file in the "Remote SSH" settings in VSCode

VSCode will still be able to access the settings using the standard path, and the ssh.exe configuration will still look at the same standard path so the connexion is working.

Note:

I have the error only when connecting with multiple ssh servers (using ProxyJump). When connecting only to the first server, the solution of @pszrux and this one are both working for me.




回答7:


Another solution which worked for me was basically, when you make clean install you need to enable password auth again. This should be standard but I am posting for newbies like me;

sudo nano /etc/ssh/sshd_config

change this:

PasswordAuthentication no

to

PasswordAuthentication yes




回答8:


In my case this was an offending key in my known_hosts in Windows (vscode on windows, remote developing via ssh on linux).

The error that comes back in vscode is not explaining in any way.




回答9:


OS: windows 10

In my case there were permission issues. Repeatedly changing inheritance in windows did not solve the issue. Finally this worked

change the folder in which the config file is stored. From C:/users/usr/.ssh/config to D:/config and changed the config path in vscode remote ssh settings.

This worked for me.




回答10:


This is probably something everyone has tried before looking here, but it worked for me. The server I was trying to ssh into was not responding, leading to the nonexistant pipe error. I rebooted the server and everything worked fine.



来源:https://stackoverflow.com/questions/60335069/vscode-remote-connection-error-the-process-tried-to-write-to-a-nonexistent-pipe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!