0

I got this problem...

My machine is a Windows(S1), who needs to connect to a Linux Server(S2) [used like a jumpbox], to connect with Linux Server(S3), which is the target machine.

I got Putty and Xming well configured, since I can open Firefox browser on S2; but when I connect to the S3 via SSH I can't open any X app there. I installed the xclock so I can test it, and I got this message:

Error: Can't open display

My proceedure is: Windows >putty> LinuxS2 >SSH> LinuxS3. Can open X apps on Linux S2, but not on Linux S3.

The networks between Windows and Linux S3 are differente, that's why the Linux S2 exists.

3
  • You can do the equivalent of the *nix ProxyCommand in putty just where you multiple links chained together. In doing this you can make your client act as if you are directly connecting to the far host. mikelococo.com/2008/01/multihop-ssh superuser.com/a/949779/2057 Commented Nov 16, 2017 at 18:27
  • Do you connect with -X from s2 to s3? Commented Nov 16, 2017 at 20:05
  • Yes, I always connect like: ssh -X user@Ip I don't know what to do... on the first server I can open Firefox, but when I connect to the target, I can't open the xclock. Already checked everything, and even so I can't do it =/ Thank you anyway! Commented Nov 17, 2017 at 14:54

1 Answer 1

0

In your Putty session:

1) you need to enable Connection => SSH => X11 Forwarding

2) invoke ssh to S3 with -X option in Connection => SSH => Remote Command , for example : ssh -X user@S3

In S2 and S3, the /etc/ssh/sshd_config need to have X11Forwarding set to yes. (restart sshd when changing this).

The DISPLAY should be set to a value starting from value of X11DisplayOffset in sshd_config of S3.

And hopefully, this should make it work.

5
  • Thanks for your help! I got everything configured like you said... but I don't get the last step very well... What I need to do with DISPLAY? Thanks Commented Nov 17, 2017 at 8:33
  • Actually, you don't need to do anything with DISPLAY except checking it is given a value: "echo $DISPLAY" should show something like "10:0". If it is empty, this means some stuff is missing. Did you get it working? Commented Nov 18, 2017 at 9:47
  • No, not yet... And i got everything configured like you said. When I enter echo $DISPLAY nothing happens on LinuxS3 =S Commented Nov 21, 2017 at 11:36
  • This means for some reason the X11Forwarding is not enabled. Commented Nov 22, 2017 at 12:33
  • 1) check $DISPLAY on intermediate server S2 with a ssh (putty with X11 forwarding option but ithout the second ssh command in). Echo $DISPLAY should show something there. 2) on your server S3, check the sshd log (set LogLevel VERBOSE in /etc/ssh/sshd_config and look in syslog ) 3) maybe you could post your sshd_config: grep -v -E '^\s*#|^\s*$' /etc/ssh/sshd_config Commented Nov 22, 2017 at 12:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.