LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices



Reply
 
Search this Thread
Old 03-05-2013, 06:39 AM   #1
Ianmb
LQ Newbie
 
Registered: Apr 2010
Posts: 21

Rep: Reputation: 0
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?
 
Old 03-05-2013, 07:51 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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 &"
 
Old 03-05-2013, 07:55 AM   #3
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 569
Blog Entries: 3

Rep: Reputation: 73
Quote:
Originally Posted by shivaa View Post
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

Last edited by goumba; 03-05-2013 at 07:57 AM. Reason: Actually has nothing to do with the OPs issue, sorry can't help there; however it was relevant to a following post.
 
Old 03-05-2013, 08:38 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by goumba View Post
You don't need "&".
It's optional, but good to use, so process can keep running background.
 
Old 03-05-2013, 11:56 AM   #5
Ianmb
LQ Newbie
 
Registered: Apr 2010
Posts: 21

Original Poster
Rep: Reputation: 0
Isn't there something I can out in the sshd_config to increase the Timeout?
 
Old 03-05-2013, 12:28 PM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
@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?
 
Old 03-07-2013, 09:05 AM   #7
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 569
Blog Entries: 3

Rep: Reputation: 73
Quote:
Originally Posted by shivaa View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPNC seems to timeout quickly- how do I lengthen the timeout? spiffytech Linux - Software 28 01-03-2014 06:45 AM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 05:36 PM
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 01:10 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 11:37 AM


All times are GMT -5. The time now is 07:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration