Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X forwarding for SSH connection #10683

Closed
Y-Grigoriy opened this issue Jul 16, 2021 · 9 comments
Closed

X forwarding for SSH connection #10683

Y-Grigoriy opened this issue Jul 16, 2021 · 9 comments
Labels
Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase

Comments

@Y-Grigoriy
Copy link

Y-Grigoriy commented Jul 16, 2021

I try to perform X forwarding for SSH connection, using Windows terminal. I want to connect to remote machine with Red Hat operation system. Following the instructions and using ssh user_name@my-server I can connect to remote machine. However, when after connection I use command export DISPLAY=localhost:0.0 and xhost +local:user_name, I get the following message: xhost: unable to open display "localhost:0.0". Also I tried to use following advice: #2785 (comment), but I got the following error:

CreateProcessW failed error:2
ssh_askpass: posix_spawn: No such file or directory
Permission denied, please try again.
CreateProcessW failed error:2
ssh_askpass: posix_spawn: No such file or directory
Permission denied, please try again.
CreateProcessW failed error:2
ssh_askpass: posix_spawn: No such file or directory
user_name@my-server: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

[process exited with code 255]

UPDATED:
This problem was solved as follows:

  1. It is necessary to modify config file (C:\Users\username\ .ssh):
Host host_name
  HostName my-server 
  User user_name 
  XAuthLocation "C:/Program Files/VcXsrv/xauth.exe"
  ForwardX11 yes
  ForwardX11Trusted yes
  1. Check or/and add environment variables (This Computer -> Properties -> Advanced System Settings -> Environment Variables):
DISPLAY=localhost:0.0
HOME=C:\Users\username
TMPDIR=%USERPROFILE%\AppData\Local\Temp
PATH=C:\Program Files\VcXsrv
  1. Write command in cmd:
    xauth generate localhost:0.0 . trusted
  2. Checking the previous command:
    xauth list
  3. In settings of Windows terminal:
    "commandline": "ssh host_name",

But now I have problem with the key combination ctrl+С. It terminates ssh-connection. Could someone help me with it?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 16, 2021
@WSLUser

This comment has been minimized.

@Y-Grigoriy
Copy link
Author

Y-Grigoriy commented Jul 17, 2021

Sorry, may be you not clearly understand me. Initially, I checked ssh-connection to remote station with red hat and I don't have problem with ctrl + C. After configuration of X-forwarding (as it is written after UPDATED in my first comment) I got problem with ctrl + C. And of cause I need to use this combination at least for killing program at Linux. Thus, the question: what could have changed after configuration of X-forwarding?
Also, I don't understand your question, but I am sure that I do not use Cygwin. But I have the installed WSL on my computer.

@zadjii-msft
Copy link
Member

@Y-Grigoriy Which version of ssh are you using? Does this repro in the vintage console window (cmd.exe), or does it only repro in the Windows Terminal?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 19, 2021
@Y-Grigoriy
Copy link
Author

@zadjii-msft, I used cmd.exe, version: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 22, 2021
@zadjii-msft
Copy link
Member

If this repros in just a cmd.exe window, without the Terminal involved at all, then I'm betting that this is an OpenSSH issue, not a Terminal one. PowerShell/Win32-OpenSSH#1803 looks fairly related

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 22, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jul 26, 2021
@ghost
Copy link

ghost commented Jul 26, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@Y-Grigoriy
Copy link
Author

@zadjii-msft, Should I close this issue or can we leave it open until the question on your link to be answered?

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 27, 2021
@zadjii-msft
Copy link
Member

Lost this one in the triage queue. Yea, let's call this /dup PowerShell/Win32-OpenSSH#1803 until proven otherwise.

@ghost
Copy link

ghost commented Sep 18, 2021

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

@ghost ghost closed this as completed Sep 18, 2021
@ghost ghost added Resolution-External For issues that are outside this codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 18, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants