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

Notices


Reply
  Search this Thread
Old 03-05-2013, 05: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, 06:51 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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, 06:55 AM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
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 06: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, 07:38 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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, 10: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, 11:28 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
@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, 08:05 AM   #7
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
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



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 30 10-05-2018 04:04 AM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 12:10 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 11:49 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration