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

ssh -X #1438

Closed
nicksunyang opened this issue Aug 29, 2019 · 8 comments
Closed

ssh -X #1438

nicksunyang opened this issue Aug 29, 2019 · 8 comments

Comments

@nicksunyang
Copy link

when I use ssh -X
then error occurred
i input xclock
Error: Can't open display:

@WSLUser
Copy link

WSLUser commented Aug 30, 2019

That's due to Windows not having a X server. If you look at the ssh(1) from the Linux man page. You'll see

-X' Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.
For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config(5) for more information.

-x' Disables X11 forwarding.

Install a third party X server such as VcxSrv or X410 and then use it with something that can work with it such as WSL.

@nicksunyang
Copy link
Author

nicksunyang commented Sep 1, 2019

but when I use 'ssh -X' to connect remote linux, then
echo $DISPLAY
DISPLAY=none
PS C:\Users\SUNYY> ssh -Y [email protected] -p 10022
[email protected]'s password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-62-generic x86_64)

Last login: Sun Sep 1 09:57:49 2019 from 10.180.8.164
sunyy@ImageLab:~$ echo $DISPLAY

sunyy@ImageLab:~$ gvim
gvim: /home/sunyy/anaconda3/lib/libuuid.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libSM.so.6)
E233: cannot open display

Press ENTER or type command to continue
and meanwhile
when I open xshell to login
DISPLAY=localhost:10.0
then I input gvim in powershell ,it works.
Connecting to 10.212.45.147:10022...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-62-generic x86_64)

Last login: Sun Sep 1 10:20:04 2019 from 10.180.8.164
sunyy@ImageLab:$ echo $DISPLAY
localhost:10.0
sunyy@ImageLab:
$ gvim
gvim: /home/sunyy/anaconda3/lib/libuuid.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libSM.so.6)
sunyy@ImageLab:~$

Vcxsrc is opend all the time.

Why doesn't it work like xshell or in Mac?

@nicksunyang
Copy link
Author

when xshell keeps on
in powershell I input
export DISPLAY=localhost:11.0
gvim works
sunyy@ImageLab:$ export DISPLAY=localhost:11.0
sunyy@ImageLab:
$ gvim
gvim: /home/sunyy/anaconda3/lib/libuuid.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libSM.so.6)
sunyy@ImageLab:~$

@nicksunyang
Copy link
Author

There is no ssh configuration file on Windows
The program may be missing some features。

@WSLUser
Copy link

WSLUser commented Sep 4, 2019

Did you install using the built-in feature or from the Release Page? Keep in mind that the Release page can contain a newer version than your OS has available. I suggest uninstalling the feature and install from Github instead. You can automate this install with Chocolatey if you use it.

Also, the install won't create the config file. It is generated when you ssh. There is plenty of documentation to manually create it for Windows.

@nicksunyang
Copy link
Author

nicksunyang commented Sep 4, 2019

I use Chocolatey to install openssh , then input ssh -X or ssh -Y , it's still invalid. Could you give a tutorial?

@manojampalam
Copy link
Contributor

Haven't explored X11 forwarding on Windows yet. Its currently not in scope. If you feel its an easy feature to add, please propose on how it could be done. A PR with changes would be helpful.

@nicksunyang
Copy link
Author

I solve the issue,
my local host ip : 10.212.45.145
remote host ip: 10.212.45.138
then i open powershell and input:
ssh -Y [email protected] -p 10022
next , open xlaunch, set display number : 0, enable Disable access control
in the remote machine shell input
export DISPLAY=10.212.45.145:0
gvim
it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants