Jump to content

ssh and run X based program


bsyuni
 Share

Recommended Posts

I have one laptop and one desktop computer.

Tp is my laptop and res3 is my desktop.

I have been used tp as a terminal to connect res3 using ssh. I was able to run any X based program in res3 form tp.

Recently I have some problem and I tried something to fix it but it dose not work. :help:

 

So far connection using ssh is fine but I can not run X based program form tp.

The error message is as follows;

 [yuni@tp yuni]$ ssh -X yuni@res3 
yuni@res3's password: 
[yuni@res3 yuni]$ emacs 
_X11TransSocketINETConnect: Can't get address for localhost 
emacs: Cannot connect to X server localhost:10.0. 
Check the DISPLAY environment variable or use `-d'. 
Also use the `xhost' program to verify that it is set to permit 
connections from your machine.

And xhost does not work.

  [bsyuni@tp bsyuni]$ xhost +res3 
res3 being added to access control list 
[bsyuni@tp bsyuni]$ ssh yuni@res3 
yuni@res3's password: 
[yuni@res3 yuni]$ emacs    
_X11TransSocketINETConnect: Can't get address for localhost 
emacs: Cannot connect to X server localhost:10.0. 
Check the DISPLAY environment variable or use `-d'. 
Also use the `xhost' program to verify that it is set to permit 
connections from your machine. 
[yuni@res3 yuni]$  

 

Thank you in advance.

Edited by bsyuni
Link to comment
Share on other sites

I gave them xhost command as you mentioned above but I still have a same error message.

I can connect tp to k2 which is another machine using ssh and run X based program.

Therefore tp is fine but I do not have any idea what happen in res3 machine. It just suddenly happen.

 

:thanks: again.

Link to comment
Share on other sites

Im not at my computer right now but if I remember correctly X11 fowarding needs to be turned on.

 

Found this on google:

Before establishing the ssh connection the xserver must be started and the environment variable DISPLAY must be set for ssh.

$ DISPLAY=localhost:0.0

$ export DISPLAY

$ ssh -Y remotehost

 

or

 

$ DISPLAY=localhost:0.0 ssh -Y remotehost

 

The parameter -Y enables trusted X11 Forwarding. This is available since OpenSSH 3.8. If you have an older version of ssh you will have to use -X.

 

Make sure you're not starting ssh with the parameter -x (lowercase). This disables X11Forwarding.

 

Check that X11Forwarding is not disabled in the openssh client configuration.

 

The configfiles are by default ~/.ssh/config and /etc/ssh_config. The file in the home directory overrides settings in the global one.

 

The configfile is split into various sections starting with "Host wildcard". The section applies to all hosts where wildcard matches the hostname.

 

If this section contains an entry "ForwardX11 no" then X11Forwarding is disabled. To enable it change the entry to:

 

ForwardX11 yes

 

I ripped the whole thing from a web site try some of that

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...