LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   X Forwarding Timeout? (https://www.linuxquestions.org/questions/suse-opensuse-60/x-forwarding-timeout-4175452772/)

Ianmb 03-05-2013 05:39 AM

X Forwarding Timeout?
 
So I like to ssh into my linux box at work with something like this:

$ ssh -X user@mylinux
I can login and start any X11 apps on my linux box no problem. But after 15 minutes or so, I come back to a session (ssh is still running and connected) and I get:

$ xterm
xterm Xt error: Can't open display: localhost:12.0

I've tried using -o "TCPKeepAlive yes" or -o "ServerAliveInterval 30", but still get the same behavior.

Is there something in my conf that kills X-forwarding after a period of inactivity?

shivaa 03-05-2013 06:51 AM

Could be a problem with display variable. What display variable is set?
Code:

~$ echo $DISPLAY
Also from machine mylinux, once invoke:
Code:

~$ xhost +<localhost>
OR SIMPLY
~$ xhost +

Then try to ssh on mylinux, and try to launch an xterm, as:
Code:

$ ssh -X user@mylinux "xterm &"

goumba 03-05-2013 06:55 AM

Quote:

Originally Posted by shivaa (Post 4905054)
Then try to ssh on mylinux, and try to launch an xterm, as:
Code:

$ ssh -X user@mylinux "xterm &"

You don't need "&".

Code:

$ ssh -f -X user@mylinux xterm

shivaa 03-05-2013 07:38 AM

Quote:

Originally Posted by goumba (Post 4905056)
You don't need "&".

It's optional, but good to use, so process can keep running background.

Ianmb 03-05-2013 10:56 AM

Isn't there something I can out in the sshd_config to increase the Timeout?

shivaa 03-05-2013 11:28 AM

@Ianmb:
Are you sure that it is a time out problem? Timeout means you cannot ssh i.e. ssh connection takes more than specified time, and if it cannot connect, then it will exit.

But in your case, it doesn't seem a timeout pb, but issue with display or xhost +.

Did you try what's said above?

goumba 03-07-2013 08:05 AM

Quote:

Originally Posted by shivaa (Post 4905083)
It's optional, but good to use, so process can keep running background.

Which is what I'm specifying with -f, and there are advantages to doing so. From the man page:

Code:

  -f      Requests ssh to go to background just before command execution.
            This is useful if ssh is going to ask for passwords or
            passphrases, but the user wants it in the background.  This
            implies -n.  The recommended way to start X11 programs at a
            remote site is with something like ssh -f host xterm.

            If the ExitOnForwardFailure configuration option is set to
            ``yes'', then a client started with -f will wait for all remote
            port forwards to be successfully established before placing
            itself in the background.



All times are GMT -5. The time now is 12:00 AM.