Why does ssh X forwarding timeout after a while? Unicorn Meta Zoo #1: Why another podcast? ...

Putting Ant-Man on house arrest

Additive group of local rings

My bank got bought out, am I now going to have to start filing tax returns in a different state?

Protagonist's race is hidden - should I reveal it?

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

Can I criticise the more senior developers around me for not writing clean code?

Error: Syntax error. Missing ')' for CASE Statement

Is a 5 watt UHF/VHF handheld considered QRP?

What is this word supposed to be?

How would I use different systems of magic when they are capable of the same effects?

What's the difference between using dependency injection with a container and using a service locator?

Does Mathematica have an implementation of the Poisson Binomial Distribution?

Implementing 3DES algorithm in Java: is my code secure?

With indentation set to `0em`, when using a line break, there is still an indentation of a size of a space

How to open locks without disable device?

Why isn't everyone flabbergasted about Bran's "gift"?

What is the best way to deal with NPC-NPC combat?

How to avoid introduction cliches

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

How long after the last departure shall the airport stay open for an emergency return?

Is Electric Central Heating worth it if using Solar Panels?

Multiple options vs single option UI

Passing args from the bash script to the function in the script

PIC mathematical operations weird problem



Why does ssh X forwarding timeout after a while?



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraX11 forwarding stops working after a whileSSH X11 Forwarding and Graphical Application LoadingPuTTY Network Error: Software caused connection abortProblem starting gnome-session on x-serverHow to forward X through two SSH tunnels?How do I resolve a ssh connection closed by remote host due to inactivity?GTK apps from remote server look badFedora 20 Gnome session over X11 forwarding not workingWhen/why does SSH close a connection?SSH connection timeout issues frequently on local LAN server, ping works“ssh -X” doesn't open matplotlib figures





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







25















So I have a mac at work which I like to ssh into my linux box with something like this:



$ ssh -Xt 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 ssh or on the Mac or my linux sshd conf that kills X-forwarding after a period of inactivity?










share|improve this question















migrated from stackoverflow.com Apr 1 '12 at 7:56


This question came from our site for professional and enthusiast programmers.



















  • Is the X server still running? Do existing X apps get killed?

    – Ignacio Vazquez-Abrams
    Apr 1 '12 at 8:01


















25















So I have a mac at work which I like to ssh into my linux box with something like this:



$ ssh -Xt 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 ssh or on the Mac or my linux sshd conf that kills X-forwarding after a period of inactivity?










share|improve this question















migrated from stackoverflow.com Apr 1 '12 at 7:56


This question came from our site for professional and enthusiast programmers.



















  • Is the X server still running? Do existing X apps get killed?

    – Ignacio Vazquez-Abrams
    Apr 1 '12 at 8:01














25












25








25


8






So I have a mac at work which I like to ssh into my linux box with something like this:



$ ssh -Xt 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 ssh or on the Mac or my linux sshd conf that kills X-forwarding after a period of inactivity?










share|improve this question
















So I have a mac at work which I like to ssh into my linux box with something like this:



$ ssh -Xt 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 ssh or on the Mac or my linux sshd conf that kills X-forwarding after a period of inactivity?







ssh x11-forwarding






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '16 at 13:32









Nifle

28.3k2395130




28.3k2395130










asked Mar 30 '12 at 14:12









Larry KyralaLarry Kyrala

233138




233138




migrated from stackoverflow.com Apr 1 '12 at 7:56


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Apr 1 '12 at 7:56


This question came from our site for professional and enthusiast programmers.















  • Is the X server still running? Do existing X apps get killed?

    – Ignacio Vazquez-Abrams
    Apr 1 '12 at 8:01



















  • Is the X server still running? Do existing X apps get killed?

    – Ignacio Vazquez-Abrams
    Apr 1 '12 at 8:01

















Is the X server still running? Do existing X apps get killed?

– Ignacio Vazquez-Abrams
Apr 1 '12 at 8:01





Is the X server still running? Do existing X apps get killed?

– Ignacio Vazquez-Abrams
Apr 1 '12 at 8:01










3 Answers
3






active

oldest

votes


















19














Using -X, X11 forwarding is enabled in "Untrusted" mode, making use of various X11 security extensions, including a time-limited Xauth cookie.



Use -Y to enable "Trusted" mode for X11, which will enable complete access to your X11 server.






share|improve this answer































    26














    The default ForwardX11Timeout is 20 minutes for ssh -X, but you can set it to something large (e.g. 7d for 7 days) in .ssh/config



    "Trusted" X11 forwarding via ssh -Y actually enables potentially nasty things like keystroke monitoring and screen grabs.






    share|improve this answer



















    • 3





      man ssh_config for this option documentation :)

      – drAlberT
      May 27 '13 at 16:17





















    0














    (would comment on Bob's 2012-11-18 answer, but it won't let me yet)



    See also https://unix.stackexchange.com/questions/107547/disable-forwardx11timeout-without-forwardx11trusted-in-openssh-client in which we find that you cannot (in 2019) disable this timeout, but you can extend it.



    The maximum timeout is uint_max of milliseconds minus some slack, just over 24 days. OpenSSH_7.4p1 will accept ssh -o ForwardX11Timeout=2147423s -X ... which is the best answer I can make now. ForwardX11Timeout above this may crash the XServer in some version combinations.



    On MacOS with XQuartz, I have seen Warning: untrusted X11 forwarding setup failed: xauth key data not generated and upon digging further, /opt/X11/bin/xauth: timeout in locking authority file /var/folders/..../xauthfile .






    share|improve this answer








    New contributor




    mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f407218%2fwhy-does-ssh-x-forwarding-timeout-after-a-while%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      19














      Using -X, X11 forwarding is enabled in "Untrusted" mode, making use of various X11 security extensions, including a time-limited Xauth cookie.



      Use -Y to enable "Trusted" mode for X11, which will enable complete access to your X11 server.






      share|improve this answer




























        19














        Using -X, X11 forwarding is enabled in "Untrusted" mode, making use of various X11 security extensions, including a time-limited Xauth cookie.



        Use -Y to enable "Trusted" mode for X11, which will enable complete access to your X11 server.






        share|improve this answer


























          19












          19








          19







          Using -X, X11 forwarding is enabled in "Untrusted" mode, making use of various X11 security extensions, including a time-limited Xauth cookie.



          Use -Y to enable "Trusted" mode for X11, which will enable complete access to your X11 server.






          share|improve this answer













          Using -X, X11 forwarding is enabled in "Untrusted" mode, making use of various X11 security extensions, including a time-limited Xauth cookie.



          Use -Y to enable "Trusted" mode for X11, which will enable complete access to your X11 server.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 1 '12 at 9:16









          grawitygrawity

          245k37516576




          245k37516576

























              26














              The default ForwardX11Timeout is 20 minutes for ssh -X, but you can set it to something large (e.g. 7d for 7 days) in .ssh/config



              "Trusted" X11 forwarding via ssh -Y actually enables potentially nasty things like keystroke monitoring and screen grabs.






              share|improve this answer



















              • 3





                man ssh_config for this option documentation :)

                – drAlberT
                May 27 '13 at 16:17


















              26














              The default ForwardX11Timeout is 20 minutes for ssh -X, but you can set it to something large (e.g. 7d for 7 days) in .ssh/config



              "Trusted" X11 forwarding via ssh -Y actually enables potentially nasty things like keystroke monitoring and screen grabs.






              share|improve this answer



















              • 3





                man ssh_config for this option documentation :)

                – drAlberT
                May 27 '13 at 16:17
















              26












              26








              26







              The default ForwardX11Timeout is 20 minutes for ssh -X, but you can set it to something large (e.g. 7d for 7 days) in .ssh/config



              "Trusted" X11 forwarding via ssh -Y actually enables potentially nasty things like keystroke monitoring and screen grabs.






              share|improve this answer













              The default ForwardX11Timeout is 20 minutes for ssh -X, but you can set it to something large (e.g. 7d for 7 days) in .ssh/config



              "Trusted" X11 forwarding via ssh -Y actually enables potentially nasty things like keystroke monitoring and screen grabs.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 18 '12 at 3:08









              BobBob

              26133




              26133








              • 3





                man ssh_config for this option documentation :)

                – drAlberT
                May 27 '13 at 16:17
















              • 3





                man ssh_config for this option documentation :)

                – drAlberT
                May 27 '13 at 16:17










              3




              3





              man ssh_config for this option documentation :)

              – drAlberT
              May 27 '13 at 16:17







              man ssh_config for this option documentation :)

              – drAlberT
              May 27 '13 at 16:17













              0














              (would comment on Bob's 2012-11-18 answer, but it won't let me yet)



              See also https://unix.stackexchange.com/questions/107547/disable-forwardx11timeout-without-forwardx11trusted-in-openssh-client in which we find that you cannot (in 2019) disable this timeout, but you can extend it.



              The maximum timeout is uint_max of milliseconds minus some slack, just over 24 days. OpenSSH_7.4p1 will accept ssh -o ForwardX11Timeout=2147423s -X ... which is the best answer I can make now. ForwardX11Timeout above this may crash the XServer in some version combinations.



              On MacOS with XQuartz, I have seen Warning: untrusted X11 forwarding setup failed: xauth key data not generated and upon digging further, /opt/X11/bin/xauth: timeout in locking authority file /var/folders/..../xauthfile .






              share|improve this answer








              New contributor




              mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                (would comment on Bob's 2012-11-18 answer, but it won't let me yet)



                See also https://unix.stackexchange.com/questions/107547/disable-forwardx11timeout-without-forwardx11trusted-in-openssh-client in which we find that you cannot (in 2019) disable this timeout, but you can extend it.



                The maximum timeout is uint_max of milliseconds minus some slack, just over 24 days. OpenSSH_7.4p1 will accept ssh -o ForwardX11Timeout=2147423s -X ... which is the best answer I can make now. ForwardX11Timeout above this may crash the XServer in some version combinations.



                On MacOS with XQuartz, I have seen Warning: untrusted X11 forwarding setup failed: xauth key data not generated and upon digging further, /opt/X11/bin/xauth: timeout in locking authority file /var/folders/..../xauthfile .






                share|improve this answer








                New contributor




                mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  (would comment on Bob's 2012-11-18 answer, but it won't let me yet)



                  See also https://unix.stackexchange.com/questions/107547/disable-forwardx11timeout-without-forwardx11trusted-in-openssh-client in which we find that you cannot (in 2019) disable this timeout, but you can extend it.



                  The maximum timeout is uint_max of milliseconds minus some slack, just over 24 days. OpenSSH_7.4p1 will accept ssh -o ForwardX11Timeout=2147423s -X ... which is the best answer I can make now. ForwardX11Timeout above this may crash the XServer in some version combinations.



                  On MacOS with XQuartz, I have seen Warning: untrusted X11 forwarding setup failed: xauth key data not generated and upon digging further, /opt/X11/bin/xauth: timeout in locking authority file /var/folders/..../xauthfile .






                  share|improve this answer








                  New contributor




                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  (would comment on Bob's 2012-11-18 answer, but it won't let me yet)



                  See also https://unix.stackexchange.com/questions/107547/disable-forwardx11timeout-without-forwardx11trusted-in-openssh-client in which we find that you cannot (in 2019) disable this timeout, but you can extend it.



                  The maximum timeout is uint_max of milliseconds minus some slack, just over 24 days. OpenSSH_7.4p1 will accept ssh -o ForwardX11Timeout=2147423s -X ... which is the best answer I can make now. ForwardX11Timeout above this may crash the XServer in some version combinations.



                  On MacOS with XQuartz, I have seen Warning: untrusted X11 forwarding setup failed: xauth key data not generated and upon digging further, /opt/X11/bin/xauth: timeout in locking authority file /var/folders/..../xauthfile .







                  share|improve this answer








                  New contributor




                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 16 hours ago









                  mcastmcast

                  1




                  1




                  New contributor




                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  mcast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f407218%2fwhy-does-ssh-x-forwarding-timeout-after-a-while%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                      Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

                      looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...