ssh returns message “X11 forwarding request failed on channel 1”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
26
down vote

favorite
9












When I ssh into a remote server that's not running any type of X11 desktop environment I get the following message.



$ ssh user@server
X11 forwarding request failed

$ ssh user@server ls
X11 forwarding request failed on channel 1
file1
file2
...


How can I get rid of these messages?










share|improve this question

























    up vote
    26
    down vote

    favorite
    9












    When I ssh into a remote server that's not running any type of X11 desktop environment I get the following message.



    $ ssh user@server
    X11 forwarding request failed

    $ ssh user@server ls
    X11 forwarding request failed on channel 1
    file1
    file2
    ...


    How can I get rid of these messages?










    share|improve this question























      up vote
      26
      down vote

      favorite
      9









      up vote
      26
      down vote

      favorite
      9






      9





      When I ssh into a remote server that's not running any type of X11 desktop environment I get the following message.



      $ ssh user@server
      X11 forwarding request failed

      $ ssh user@server ls
      X11 forwarding request failed on channel 1
      file1
      file2
      ...


      How can I get rid of these messages?










      share|improve this question













      When I ssh into a remote server that's not running any type of X11 desktop environment I get the following message.



      $ ssh user@server
      X11 forwarding request failed

      $ ssh user@server ls
      X11 forwarding request failed on channel 1
      file1
      file2
      ...


      How can I get rid of these messages?







      ssh x11






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 29 '14 at 18:23









      slm♦

      240k65496665




      240k65496665




















          8 Answers
          8






          active

          oldest

          votes

















          up vote
          31
          down vote



          accepted










          These messages can be eliminated through 1 of 3 methods, using just SSH options. You can always send messages to /dev/null too but these methods try to deal with the message through configuration, rather than just trapping and dumping them.



          Method #1 - install xauth



          The server you're remoting into is complaining that it cannot create an entry in the user's .Xauthority file, because xauth is not installed. So you can install it on each server to get rid of this annoying message.



          On Fedora 19 you install xauth like so:



          $ sudo yum install xorg-x11-xauth


          If you then attempt to ssh into the server you'll see a message that an entry is being created in the user's .Xauthority file.



          $ ssh root@server
          /usr/bin/xauth: creating new authority file /root/.Xauthority
          $


          Subsequent logins will no longer show this message.



          Method #2 - disable it via ForwardX11



          You can instruct the ssh client to not attempt to enable X11 forwarding by inclusion of the SSH parameter ForwardX11.



          $ ssh -o ForwardX11=no root@server


          You can do the same thing with the -x switch:



          $ ssh -x root@server


          This will only temporarily disable this message, but is a good option if you're not able to or unwilling to install xauth on the remote server.



          Method #3 - disable it via sshd_config



          This is typically the default but in case it isn't, you can setup your sshd server so that X11Forwarding is off, in /etc/ssh/sshd_config.



          X11Forwarding no


          Of the 3 methods I generally use #2, because I'll often want X11Forwarding on for most of my servers, but then don't want to see the X11.... warnings



          $HOME/.ssh/config



          Much of the time these message won't even show up. They're usually only present when you have the following entries in your $HOME/.ssh/config file, at the top.



          ServerAliveInterval 15
          ForwardX11 yes
          ForwardAgent yes
          ForwardX11Trusted yes

          GatewayPorts yes


          So it's this setup, which is ultimately driving the generation of those X11.. messages, so again, method #2 would seem to be the most appropriate if you want to operate with ForwardX11 yes on by default, but then selectively disable it for certain connections from the ssh client's perspective.



          Security



          It's generally ill-advised to run with ForwardX11 yes on at all times. So if you're wanting to operate your SSH connections in the most secure manor possible, it's best to do the following:



          1. Don't include ForwardX11 yes in your $HOME/.ssh/config file

          2. Only use ForwardingX11 when you need to via ssh -X user@server

          3. If you can, disable X11Forwarding completely on the server so it's disallowed

          References



          • SSH: The Secure Shell - The Definitive Guide - 9.3. X Forwarding





          share|improve this answer






















          • Can you help me with unix.stackexchange.com/questions/470331/…?
            – overexchange
            Sep 20 at 17:44

















          up vote
          10
          down vote













          In my case adding this string to /etc/ssh/sshd_config solved the problem:



          X11UseLocalhost no





          share|improve this answer




















          • This worked for me (the server already had xauth installed). Thanks.
            – Paul Higgins
            Aug 27 '15 at 16:30










          • This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
            – Kyle Strand
            Oct 28 '16 at 18:27

















          up vote
          10
          down vote













          Ran across this today and beat my head for a while until I stumbled across an ssh setting:



          If it's RHEL 7 (centOS, OEL, etc), and it has ipv6 disabled, it needs:



          AddressFamily inet


          set in /etc/ssh/sshd_config.






          share|improve this answer




















          • This helped me. Thank you very much!
            – guettli
            Jun 16 '16 at 8:41










          • Seconded, very helpful tip. Thanks.
            – a coder
            Dec 8 '16 at 18:43










          • if only the error message related to this...
            – Jack Wasey
            Aug 2 at 20:51

















          up vote
          2
          down vote













          Another slight variation would be if you wanted to stop seeing this message (i.e. stop trying to forward X11) for certain servers but yet keep the default to ForwardX11 yes for all other connections.



          For this scenario, you could disable X11 forwarding for a specific host (or range) in your ~/.ssh/config. Something like this:



          host 10.1.1.*
          ForwardX11 no


          Acknowledgment: This is a slight embellishment to the existing (and very complete) existing answer - since I couldn't comment!






          share|improve this answer



























            up vote
            2
            down vote













            If running the client in verbose mode (ssh -v user@host) gives you



            debug1: Remote: No xauth program; cannot forward with spoofing.


            but xauth is indeed installed on the server, then it is probably because sshd looks for xauth executable in wrong location (/usr/X11R6/bin/xauth usually). One can fix that by setting



            XAuthLocation /usr/bin/xauth


            in /etc/sshd/sshd_config (or whatever your server is configured with).






            share|improve this answer




















            • This worked for me on CentOS 7. That's the exact error message I was seeing.
              – Brian Minton
              Apr 6 '17 at 16:07











            • This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
              – Leon Avery
              May 30 at 22:36


















            up vote
            0
            down vote













            One important point to note after making the configuration changes is that you'll have to kill sshd so that it picks up the changes:



            cat /var/run/sshd.pid | xargs kill -1


            being the root user.






            share|improve this answer



























              up vote
              0
              down vote













              Configuring X11 forwarding on a per host basis



              In addition to all of the excellent answers already here, you can configure ForwardX11 on a per host basis, so if only server fails like this, you can add an entry to your ~/.ssh/config file of the following form:



              Host server server.domain.dom
              ForwardX11 no


              You can even use entries like this as alliases for whole sets of configurations



              Host my.server
              HostName server.domain.dom
              User user
              Port 1234
              ForwardX11 no


              This is especially useful if you have set up Autocomplete server names for SSH and SCP.






              share|improve this answer



























                up vote
                -2
                down vote














                1. Set the following 2 options in /etc/ssh/sshd_config in your RHEL host



                  X11Forwarding yes
                  X11UseLocalhost no



                2. sudo /etc/init.d/sshd reload


                3. sudo yum install xauth

                4. ssh back to your RHEL host with -X switch:
                  ssh -X yourname@rhelbox





                share|improve this answer






















                  Your Answer







                  StackExchange.ready(function()
                  var channelOptions =
                  tags: "".split(" "),
                  id: "106"
                  ;
                  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',
                  convertImagesToLinks: false,
                  noModals: false,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: null,
                  bindNavPrevention: true,
                  postfix: "",
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  );



                  );













                   

                  draft saved


                  draft discarded


















                  StackExchange.ready(
                  function ()
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f111519%2fssh-returns-message-x11-forwarding-request-failed-on-channel-1%23new-answer', 'question_page');

                  );

                  Post as a guest






























                  8 Answers
                  8






                  active

                  oldest

                  votes








                  8 Answers
                  8






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  31
                  down vote



                  accepted










                  These messages can be eliminated through 1 of 3 methods, using just SSH options. You can always send messages to /dev/null too but these methods try to deal with the message through configuration, rather than just trapping and dumping them.



                  Method #1 - install xauth



                  The server you're remoting into is complaining that it cannot create an entry in the user's .Xauthority file, because xauth is not installed. So you can install it on each server to get rid of this annoying message.



                  On Fedora 19 you install xauth like so:



                  $ sudo yum install xorg-x11-xauth


                  If you then attempt to ssh into the server you'll see a message that an entry is being created in the user's .Xauthority file.



                  $ ssh root@server
                  /usr/bin/xauth: creating new authority file /root/.Xauthority
                  $


                  Subsequent logins will no longer show this message.



                  Method #2 - disable it via ForwardX11



                  You can instruct the ssh client to not attempt to enable X11 forwarding by inclusion of the SSH parameter ForwardX11.



                  $ ssh -o ForwardX11=no root@server


                  You can do the same thing with the -x switch:



                  $ ssh -x root@server


                  This will only temporarily disable this message, but is a good option if you're not able to or unwilling to install xauth on the remote server.



                  Method #3 - disable it via sshd_config



                  This is typically the default but in case it isn't, you can setup your sshd server so that X11Forwarding is off, in /etc/ssh/sshd_config.



                  X11Forwarding no


                  Of the 3 methods I generally use #2, because I'll often want X11Forwarding on for most of my servers, but then don't want to see the X11.... warnings



                  $HOME/.ssh/config



                  Much of the time these message won't even show up. They're usually only present when you have the following entries in your $HOME/.ssh/config file, at the top.



                  ServerAliveInterval 15
                  ForwardX11 yes
                  ForwardAgent yes
                  ForwardX11Trusted yes

                  GatewayPorts yes


                  So it's this setup, which is ultimately driving the generation of those X11.. messages, so again, method #2 would seem to be the most appropriate if you want to operate with ForwardX11 yes on by default, but then selectively disable it for certain connections from the ssh client's perspective.



                  Security



                  It's generally ill-advised to run with ForwardX11 yes on at all times. So if you're wanting to operate your SSH connections in the most secure manor possible, it's best to do the following:



                  1. Don't include ForwardX11 yes in your $HOME/.ssh/config file

                  2. Only use ForwardingX11 when you need to via ssh -X user@server

                  3. If you can, disable X11Forwarding completely on the server so it's disallowed

                  References



                  • SSH: The Secure Shell - The Definitive Guide - 9.3. X Forwarding





                  share|improve this answer






















                  • Can you help me with unix.stackexchange.com/questions/470331/…?
                    – overexchange
                    Sep 20 at 17:44














                  up vote
                  31
                  down vote



                  accepted










                  These messages can be eliminated through 1 of 3 methods, using just SSH options. You can always send messages to /dev/null too but these methods try to deal with the message through configuration, rather than just trapping and dumping them.



                  Method #1 - install xauth



                  The server you're remoting into is complaining that it cannot create an entry in the user's .Xauthority file, because xauth is not installed. So you can install it on each server to get rid of this annoying message.



                  On Fedora 19 you install xauth like so:



                  $ sudo yum install xorg-x11-xauth


                  If you then attempt to ssh into the server you'll see a message that an entry is being created in the user's .Xauthority file.



                  $ ssh root@server
                  /usr/bin/xauth: creating new authority file /root/.Xauthority
                  $


                  Subsequent logins will no longer show this message.



                  Method #2 - disable it via ForwardX11



                  You can instruct the ssh client to not attempt to enable X11 forwarding by inclusion of the SSH parameter ForwardX11.



                  $ ssh -o ForwardX11=no root@server


                  You can do the same thing with the -x switch:



                  $ ssh -x root@server


                  This will only temporarily disable this message, but is a good option if you're not able to or unwilling to install xauth on the remote server.



                  Method #3 - disable it via sshd_config



                  This is typically the default but in case it isn't, you can setup your sshd server so that X11Forwarding is off, in /etc/ssh/sshd_config.



                  X11Forwarding no


                  Of the 3 methods I generally use #2, because I'll often want X11Forwarding on for most of my servers, but then don't want to see the X11.... warnings



                  $HOME/.ssh/config



                  Much of the time these message won't even show up. They're usually only present when you have the following entries in your $HOME/.ssh/config file, at the top.



                  ServerAliveInterval 15
                  ForwardX11 yes
                  ForwardAgent yes
                  ForwardX11Trusted yes

                  GatewayPorts yes


                  So it's this setup, which is ultimately driving the generation of those X11.. messages, so again, method #2 would seem to be the most appropriate if you want to operate with ForwardX11 yes on by default, but then selectively disable it for certain connections from the ssh client's perspective.



                  Security



                  It's generally ill-advised to run with ForwardX11 yes on at all times. So if you're wanting to operate your SSH connections in the most secure manor possible, it's best to do the following:



                  1. Don't include ForwardX11 yes in your $HOME/.ssh/config file

                  2. Only use ForwardingX11 when you need to via ssh -X user@server

                  3. If you can, disable X11Forwarding completely on the server so it's disallowed

                  References



                  • SSH: The Secure Shell - The Definitive Guide - 9.3. X Forwarding





                  share|improve this answer






















                  • Can you help me with unix.stackexchange.com/questions/470331/…?
                    – overexchange
                    Sep 20 at 17:44












                  up vote
                  31
                  down vote



                  accepted







                  up vote
                  31
                  down vote



                  accepted






                  These messages can be eliminated through 1 of 3 methods, using just SSH options. You can always send messages to /dev/null too but these methods try to deal with the message through configuration, rather than just trapping and dumping them.



                  Method #1 - install xauth



                  The server you're remoting into is complaining that it cannot create an entry in the user's .Xauthority file, because xauth is not installed. So you can install it on each server to get rid of this annoying message.



                  On Fedora 19 you install xauth like so:



                  $ sudo yum install xorg-x11-xauth


                  If you then attempt to ssh into the server you'll see a message that an entry is being created in the user's .Xauthority file.



                  $ ssh root@server
                  /usr/bin/xauth: creating new authority file /root/.Xauthority
                  $


                  Subsequent logins will no longer show this message.



                  Method #2 - disable it via ForwardX11



                  You can instruct the ssh client to not attempt to enable X11 forwarding by inclusion of the SSH parameter ForwardX11.



                  $ ssh -o ForwardX11=no root@server


                  You can do the same thing with the -x switch:



                  $ ssh -x root@server


                  This will only temporarily disable this message, but is a good option if you're not able to or unwilling to install xauth on the remote server.



                  Method #3 - disable it via sshd_config



                  This is typically the default but in case it isn't, you can setup your sshd server so that X11Forwarding is off, in /etc/ssh/sshd_config.



                  X11Forwarding no


                  Of the 3 methods I generally use #2, because I'll often want X11Forwarding on for most of my servers, but then don't want to see the X11.... warnings



                  $HOME/.ssh/config



                  Much of the time these message won't even show up. They're usually only present when you have the following entries in your $HOME/.ssh/config file, at the top.



                  ServerAliveInterval 15
                  ForwardX11 yes
                  ForwardAgent yes
                  ForwardX11Trusted yes

                  GatewayPorts yes


                  So it's this setup, which is ultimately driving the generation of those X11.. messages, so again, method #2 would seem to be the most appropriate if you want to operate with ForwardX11 yes on by default, but then selectively disable it for certain connections from the ssh client's perspective.



                  Security



                  It's generally ill-advised to run with ForwardX11 yes on at all times. So if you're wanting to operate your SSH connections in the most secure manor possible, it's best to do the following:



                  1. Don't include ForwardX11 yes in your $HOME/.ssh/config file

                  2. Only use ForwardingX11 when you need to via ssh -X user@server

                  3. If you can, disable X11Forwarding completely on the server so it's disallowed

                  References



                  • SSH: The Secure Shell - The Definitive Guide - 9.3. X Forwarding





                  share|improve this answer














                  These messages can be eliminated through 1 of 3 methods, using just SSH options. You can always send messages to /dev/null too but these methods try to deal with the message through configuration, rather than just trapping and dumping them.



                  Method #1 - install xauth



                  The server you're remoting into is complaining that it cannot create an entry in the user's .Xauthority file, because xauth is not installed. So you can install it on each server to get rid of this annoying message.



                  On Fedora 19 you install xauth like so:



                  $ sudo yum install xorg-x11-xauth


                  If you then attempt to ssh into the server you'll see a message that an entry is being created in the user's .Xauthority file.



                  $ ssh root@server
                  /usr/bin/xauth: creating new authority file /root/.Xauthority
                  $


                  Subsequent logins will no longer show this message.



                  Method #2 - disable it via ForwardX11



                  You can instruct the ssh client to not attempt to enable X11 forwarding by inclusion of the SSH parameter ForwardX11.



                  $ ssh -o ForwardX11=no root@server


                  You can do the same thing with the -x switch:



                  $ ssh -x root@server


                  This will only temporarily disable this message, but is a good option if you're not able to or unwilling to install xauth on the remote server.



                  Method #3 - disable it via sshd_config



                  This is typically the default but in case it isn't, you can setup your sshd server so that X11Forwarding is off, in /etc/ssh/sshd_config.



                  X11Forwarding no


                  Of the 3 methods I generally use #2, because I'll often want X11Forwarding on for most of my servers, but then don't want to see the X11.... warnings



                  $HOME/.ssh/config



                  Much of the time these message won't even show up. They're usually only present when you have the following entries in your $HOME/.ssh/config file, at the top.



                  ServerAliveInterval 15
                  ForwardX11 yes
                  ForwardAgent yes
                  ForwardX11Trusted yes

                  GatewayPorts yes


                  So it's this setup, which is ultimately driving the generation of those X11.. messages, so again, method #2 would seem to be the most appropriate if you want to operate with ForwardX11 yes on by default, but then selectively disable it for certain connections from the ssh client's perspective.



                  Security



                  It's generally ill-advised to run with ForwardX11 yes on at all times. So if you're wanting to operate your SSH connections in the most secure manor possible, it's best to do the following:



                  1. Don't include ForwardX11 yes in your $HOME/.ssh/config file

                  2. Only use ForwardingX11 when you need to via ssh -X user@server

                  3. If you can, disable X11Forwarding completely on the server so it's disallowed

                  References



                  • SSH: The Secure Shell - The Definitive Guide - 9.3. X Forwarding






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 18 '16 at 12:35









                  Nifle

                  2772414




                  2772414










                  answered Jan 29 '14 at 18:44









                  slm♦

                  240k65496665




                  240k65496665











                  • Can you help me with unix.stackexchange.com/questions/470331/…?
                    – overexchange
                    Sep 20 at 17:44
















                  • Can you help me with unix.stackexchange.com/questions/470331/…?
                    – overexchange
                    Sep 20 at 17:44















                  Can you help me with unix.stackexchange.com/questions/470331/…?
                  – overexchange
                  Sep 20 at 17:44




                  Can you help me with unix.stackexchange.com/questions/470331/…?
                  – overexchange
                  Sep 20 at 17:44












                  up vote
                  10
                  down vote













                  In my case adding this string to /etc/ssh/sshd_config solved the problem:



                  X11UseLocalhost no





                  share|improve this answer




















                  • This worked for me (the server already had xauth installed). Thanks.
                    – Paul Higgins
                    Aug 27 '15 at 16:30










                  • This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                    – Kyle Strand
                    Oct 28 '16 at 18:27














                  up vote
                  10
                  down vote













                  In my case adding this string to /etc/ssh/sshd_config solved the problem:



                  X11UseLocalhost no





                  share|improve this answer




















                  • This worked for me (the server already had xauth installed). Thanks.
                    – Paul Higgins
                    Aug 27 '15 at 16:30










                  • This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                    – Kyle Strand
                    Oct 28 '16 at 18:27












                  up vote
                  10
                  down vote










                  up vote
                  10
                  down vote









                  In my case adding this string to /etc/ssh/sshd_config solved the problem:



                  X11UseLocalhost no





                  share|improve this answer












                  In my case adding this string to /etc/ssh/sshd_config solved the problem:



                  X11UseLocalhost no






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 22 '15 at 13:33









                  user3132194

                  21025




                  21025











                  • This worked for me (the server already had xauth installed). Thanks.
                    – Paul Higgins
                    Aug 27 '15 at 16:30










                  • This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                    – Kyle Strand
                    Oct 28 '16 at 18:27
















                  • This worked for me (the server already had xauth installed). Thanks.
                    – Paul Higgins
                    Aug 27 '15 at 16:30










                  • This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                    – Kyle Strand
                    Oct 28 '16 at 18:27















                  This worked for me (the server already had xauth installed). Thanks.
                  – Paul Higgins
                  Aug 27 '15 at 16:30




                  This worked for me (the server already had xauth installed). Thanks.
                  – Paul Higgins
                  Aug 27 '15 at 16:30












                  This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                  – Kyle Strand
                  Oct 28 '16 at 18:27




                  This appeared to solve my issue, but I don't understand why, which is concerning. I have what should be three identical Debian 7 machines, one of which suddenly stopped accepting locahost X11 forwarding. X11 forwarding on the other two still works. Any idea what could have changed?
                  – Kyle Strand
                  Oct 28 '16 at 18:27










                  up vote
                  10
                  down vote













                  Ran across this today and beat my head for a while until I stumbled across an ssh setting:



                  If it's RHEL 7 (centOS, OEL, etc), and it has ipv6 disabled, it needs:



                  AddressFamily inet


                  set in /etc/ssh/sshd_config.






                  share|improve this answer




















                  • This helped me. Thank you very much!
                    – guettli
                    Jun 16 '16 at 8:41










                  • Seconded, very helpful tip. Thanks.
                    – a coder
                    Dec 8 '16 at 18:43










                  • if only the error message related to this...
                    – Jack Wasey
                    Aug 2 at 20:51














                  up vote
                  10
                  down vote













                  Ran across this today and beat my head for a while until I stumbled across an ssh setting:



                  If it's RHEL 7 (centOS, OEL, etc), and it has ipv6 disabled, it needs:



                  AddressFamily inet


                  set in /etc/ssh/sshd_config.






                  share|improve this answer




















                  • This helped me. Thank you very much!
                    – guettli
                    Jun 16 '16 at 8:41










                  • Seconded, very helpful tip. Thanks.
                    – a coder
                    Dec 8 '16 at 18:43










                  • if only the error message related to this...
                    – Jack Wasey
                    Aug 2 at 20:51












                  up vote
                  10
                  down vote










                  up vote
                  10
                  down vote









                  Ran across this today and beat my head for a while until I stumbled across an ssh setting:



                  If it's RHEL 7 (centOS, OEL, etc), and it has ipv6 disabled, it needs:



                  AddressFamily inet


                  set in /etc/ssh/sshd_config.






                  share|improve this answer












                  Ran across this today and beat my head for a while until I stumbled across an ssh setting:



                  If it's RHEL 7 (centOS, OEL, etc), and it has ipv6 disabled, it needs:



                  AddressFamily inet


                  set in /etc/ssh/sshd_config.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 17 '15 at 16:39









                  Systemspoet

                  10113




                  10113











                  • This helped me. Thank you very much!
                    – guettli
                    Jun 16 '16 at 8:41










                  • Seconded, very helpful tip. Thanks.
                    – a coder
                    Dec 8 '16 at 18:43










                  • if only the error message related to this...
                    – Jack Wasey
                    Aug 2 at 20:51
















                  • This helped me. Thank you very much!
                    – guettli
                    Jun 16 '16 at 8:41










                  • Seconded, very helpful tip. Thanks.
                    – a coder
                    Dec 8 '16 at 18:43










                  • if only the error message related to this...
                    – Jack Wasey
                    Aug 2 at 20:51















                  This helped me. Thank you very much!
                  – guettli
                  Jun 16 '16 at 8:41




                  This helped me. Thank you very much!
                  – guettli
                  Jun 16 '16 at 8:41












                  Seconded, very helpful tip. Thanks.
                  – a coder
                  Dec 8 '16 at 18:43




                  Seconded, very helpful tip. Thanks.
                  – a coder
                  Dec 8 '16 at 18:43












                  if only the error message related to this...
                  – Jack Wasey
                  Aug 2 at 20:51




                  if only the error message related to this...
                  – Jack Wasey
                  Aug 2 at 20:51










                  up vote
                  2
                  down vote













                  Another slight variation would be if you wanted to stop seeing this message (i.e. stop trying to forward X11) for certain servers but yet keep the default to ForwardX11 yes for all other connections.



                  For this scenario, you could disable X11 forwarding for a specific host (or range) in your ~/.ssh/config. Something like this:



                  host 10.1.1.*
                  ForwardX11 no


                  Acknowledgment: This is a slight embellishment to the existing (and very complete) existing answer - since I couldn't comment!






                  share|improve this answer
























                    up vote
                    2
                    down vote













                    Another slight variation would be if you wanted to stop seeing this message (i.e. stop trying to forward X11) for certain servers but yet keep the default to ForwardX11 yes for all other connections.



                    For this scenario, you could disable X11 forwarding for a specific host (or range) in your ~/.ssh/config. Something like this:



                    host 10.1.1.*
                    ForwardX11 no


                    Acknowledgment: This is a slight embellishment to the existing (and very complete) existing answer - since I couldn't comment!






                    share|improve this answer






















                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      Another slight variation would be if you wanted to stop seeing this message (i.e. stop trying to forward X11) for certain servers but yet keep the default to ForwardX11 yes for all other connections.



                      For this scenario, you could disable X11 forwarding for a specific host (or range) in your ~/.ssh/config. Something like this:



                      host 10.1.1.*
                      ForwardX11 no


                      Acknowledgment: This is a slight embellishment to the existing (and very complete) existing answer - since I couldn't comment!






                      share|improve this answer












                      Another slight variation would be if you wanted to stop seeing this message (i.e. stop trying to forward X11) for certain servers but yet keep the default to ForwardX11 yes for all other connections.



                      For this scenario, you could disable X11 forwarding for a specific host (or range) in your ~/.ssh/config. Something like this:



                      host 10.1.1.*
                      ForwardX11 no


                      Acknowledgment: This is a slight embellishment to the existing (and very complete) existing answer - since I couldn't comment!







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 1 '15 at 20:51









                      philarmour

                      212




                      212




















                          up vote
                          2
                          down vote













                          If running the client in verbose mode (ssh -v user@host) gives you



                          debug1: Remote: No xauth program; cannot forward with spoofing.


                          but xauth is indeed installed on the server, then it is probably because sshd looks for xauth executable in wrong location (/usr/X11R6/bin/xauth usually). One can fix that by setting



                          XAuthLocation /usr/bin/xauth


                          in /etc/sshd/sshd_config (or whatever your server is configured with).






                          share|improve this answer




















                          • This worked for me on CentOS 7. That's the exact error message I was seeing.
                            – Brian Minton
                            Apr 6 '17 at 16:07











                          • This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                            – Leon Avery
                            May 30 at 22:36















                          up vote
                          2
                          down vote













                          If running the client in verbose mode (ssh -v user@host) gives you



                          debug1: Remote: No xauth program; cannot forward with spoofing.


                          but xauth is indeed installed on the server, then it is probably because sshd looks for xauth executable in wrong location (/usr/X11R6/bin/xauth usually). One can fix that by setting



                          XAuthLocation /usr/bin/xauth


                          in /etc/sshd/sshd_config (or whatever your server is configured with).






                          share|improve this answer




















                          • This worked for me on CentOS 7. That's the exact error message I was seeing.
                            – Brian Minton
                            Apr 6 '17 at 16:07











                          • This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                            – Leon Avery
                            May 30 at 22:36













                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          If running the client in verbose mode (ssh -v user@host) gives you



                          debug1: Remote: No xauth program; cannot forward with spoofing.


                          but xauth is indeed installed on the server, then it is probably because sshd looks for xauth executable in wrong location (/usr/X11R6/bin/xauth usually). One can fix that by setting



                          XAuthLocation /usr/bin/xauth


                          in /etc/sshd/sshd_config (or whatever your server is configured with).






                          share|improve this answer












                          If running the client in verbose mode (ssh -v user@host) gives you



                          debug1: Remote: No xauth program; cannot forward with spoofing.


                          but xauth is indeed installed on the server, then it is probably because sshd looks for xauth executable in wrong location (/usr/X11R6/bin/xauth usually). One can fix that by setting



                          XAuthLocation /usr/bin/xauth


                          in /etc/sshd/sshd_config (or whatever your server is configured with).







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 29 '16 at 13:43









                          Anton Samsonov

                          1977




                          1977











                          • This worked for me on CentOS 7. That's the exact error message I was seeing.
                            – Brian Minton
                            Apr 6 '17 at 16:07











                          • This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                            – Leon Avery
                            May 30 at 22:36

















                          • This worked for me on CentOS 7. That's the exact error message I was seeing.
                            – Brian Minton
                            Apr 6 '17 at 16:07











                          • This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                            – Leon Avery
                            May 30 at 22:36
















                          This worked for me on CentOS 7. That's the exact error message I was seeing.
                          – Brian Minton
                          Apr 6 '17 at 16:07





                          This worked for me on CentOS 7. That's the exact error message I was seeing.
                          – Brian Minton
                          Apr 6 '17 at 16:07













                          This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                          – Leon Avery
                          May 30 at 22:36





                          This was my problem, trying to log in remotely to a Mac. There the correct incantation was XAuthLocation /opt/X11/bin/xauth
                          – Leon Avery
                          May 30 at 22:36











                          up vote
                          0
                          down vote













                          One important point to note after making the configuration changes is that you'll have to kill sshd so that it picks up the changes:



                          cat /var/run/sshd.pid | xargs kill -1


                          being the root user.






                          share|improve this answer
























                            up vote
                            0
                            down vote













                            One important point to note after making the configuration changes is that you'll have to kill sshd so that it picks up the changes:



                            cat /var/run/sshd.pid | xargs kill -1


                            being the root user.






                            share|improve this answer






















                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              One important point to note after making the configuration changes is that you'll have to kill sshd so that it picks up the changes:



                              cat /var/run/sshd.pid | xargs kill -1


                              being the root user.






                              share|improve this answer












                              One important point to note after making the configuration changes is that you'll have to kill sshd so that it picks up the changes:



                              cat /var/run/sshd.pid | xargs kill -1


                              being the root user.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jul 3 at 8:15









                              timidgeek

                              1011




                              1011




















                                  up vote
                                  0
                                  down vote













                                  Configuring X11 forwarding on a per host basis



                                  In addition to all of the excellent answers already here, you can configure ForwardX11 on a per host basis, so if only server fails like this, you can add an entry to your ~/.ssh/config file of the following form:



                                  Host server server.domain.dom
                                  ForwardX11 no


                                  You can even use entries like this as alliases for whole sets of configurations



                                  Host my.server
                                  HostName server.domain.dom
                                  User user
                                  Port 1234
                                  ForwardX11 no


                                  This is especially useful if you have set up Autocomplete server names for SSH and SCP.






                                  share|improve this answer
























                                    up vote
                                    0
                                    down vote













                                    Configuring X11 forwarding on a per host basis



                                    In addition to all of the excellent answers already here, you can configure ForwardX11 on a per host basis, so if only server fails like this, you can add an entry to your ~/.ssh/config file of the following form:



                                    Host server server.domain.dom
                                    ForwardX11 no


                                    You can even use entries like this as alliases for whole sets of configurations



                                    Host my.server
                                    HostName server.domain.dom
                                    User user
                                    Port 1234
                                    ForwardX11 no


                                    This is especially useful if you have set up Autocomplete server names for SSH and SCP.






                                    share|improve this answer






















                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      Configuring X11 forwarding on a per host basis



                                      In addition to all of the excellent answers already here, you can configure ForwardX11 on a per host basis, so if only server fails like this, you can add an entry to your ~/.ssh/config file of the following form:



                                      Host server server.domain.dom
                                      ForwardX11 no


                                      You can even use entries like this as alliases for whole sets of configurations



                                      Host my.server
                                      HostName server.domain.dom
                                      User user
                                      Port 1234
                                      ForwardX11 no


                                      This is especially useful if you have set up Autocomplete server names for SSH and SCP.






                                      share|improve this answer












                                      Configuring X11 forwarding on a per host basis



                                      In addition to all of the excellent answers already here, you can configure ForwardX11 on a per host basis, so if only server fails like this, you can add an entry to your ~/.ssh/config file of the following form:



                                      Host server server.domain.dom
                                      ForwardX11 no


                                      You can even use entries like this as alliases for whole sets of configurations



                                      Host my.server
                                      HostName server.domain.dom
                                      User user
                                      Port 1234
                                      ForwardX11 no


                                      This is especially useful if you have set up Autocomplete server names for SSH and SCP.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Sep 27 at 16:21









                                      Mark Booth

                                      6581821




                                      6581821




















                                          up vote
                                          -2
                                          down vote














                                          1. Set the following 2 options in /etc/ssh/sshd_config in your RHEL host



                                            X11Forwarding yes
                                            X11UseLocalhost no



                                          2. sudo /etc/init.d/sshd reload


                                          3. sudo yum install xauth

                                          4. ssh back to your RHEL host with -X switch:
                                            ssh -X yourname@rhelbox





                                          share|improve this answer


























                                            up vote
                                            -2
                                            down vote














                                            1. Set the following 2 options in /etc/ssh/sshd_config in your RHEL host



                                              X11Forwarding yes
                                              X11UseLocalhost no



                                            2. sudo /etc/init.d/sshd reload


                                            3. sudo yum install xauth

                                            4. ssh back to your RHEL host with -X switch:
                                              ssh -X yourname@rhelbox





                                            share|improve this answer
























                                              up vote
                                              -2
                                              down vote










                                              up vote
                                              -2
                                              down vote










                                              1. Set the following 2 options in /etc/ssh/sshd_config in your RHEL host



                                                X11Forwarding yes
                                                X11UseLocalhost no



                                              2. sudo /etc/init.d/sshd reload


                                              3. sudo yum install xauth

                                              4. ssh back to your RHEL host with -X switch:
                                                ssh -X yourname@rhelbox





                                              share|improve this answer















                                              1. Set the following 2 options in /etc/ssh/sshd_config in your RHEL host



                                                X11Forwarding yes
                                                X11UseLocalhost no



                                              2. sudo /etc/init.d/sshd reload


                                              3. sudo yum install xauth

                                              4. ssh back to your RHEL host with -X switch:
                                                ssh -X yourname@rhelbox






                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Dec 30 '15 at 10:26









                                              whizvids

                                              31




                                              31










                                              answered Dec 30 '15 at 10:14









                                              user149406

                                              1




                                              1



























                                                   

                                                  draft saved


                                                  draft discarded















































                                                   


                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function ()
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f111519%2fssh-returns-message-x11-forwarding-request-failed-on-channel-1%23new-answer', 'question_page');

                                                  );

                                                  Post as a guest













































































                                                  Popular posts from this blog

                                                  How to check contact read email or not when send email to Individual?

                                                  Displaying single band from multi-band raster using QGIS

                                                  How many registers does an x86_64 CPU actually have?