Why is my SSH X Window forwarding broken?

This commit is contained in:
Ian Gulliver
2019-04-21 17:11:54 +00:00
parent a334fd299b
commit fd452f9393
4 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<!--# set var="title" value="Why is my SSH X Window forwarding broken?" -->
<!--# set var="date" value="February 7, 2006" -->
<!--# include file="include/top.html" -->
<p>SSH into your destination:</p>
<pre><code>ssh -vv -X &lt;hostname&gt;
</code></pre>
<p>If you see a line near the end that says “<em>debug1: Remote: No xauth program; cannot forward with spoofing.</em>“, you need to install xauth and reconnect. In Debian, run:</p>
<pre><code>apt-get install xbase-clients
</code></pre>
<p>Next, ensure that youre getting a DISPLAY variable through:</p>
<pre><code>echo $DISPLAY
</code></pre>
<p>If that command outputs just a blank line, X forwarding is probably being denied by the server. Edit your sshd_config (/etc/ssh/sshd_config on Debian) and change/add the line:</p>
<pre><code>X11Forwarding yes
</code></pre>
<p>If you change this, youll need to restart your SSH server:</p>
<pre><code>/etc/init.d/ssh restart
</code></pre>
<p>Once your DISPLAY is being passed correctly, some programs may run but act oddly (”Gdk-error: […] BadAtom”, etc.) SSH uses “SECURITY” extensions by default, and some programs dont work correctly with them. Try:</p>
<pre><code>ssh -Y &lt;hostname&gt;
</code></pre>
<p>Note that this command may expose your local machine to compromise if someone malicious is in control of the host youre connecting to.</p>
<!--# include file="include/bottom.html" -->

View File

@@ -40,6 +40,7 @@
<li>2009-Sep-11: <a href="2009-09-11-confusing-bind-with-cnames.html">Confusing BIND with CNAMEs</a></li> <li>2009-Sep-11: <a href="2009-09-11-confusing-bind-with-cnames.html">Confusing BIND with CNAMEs</a></li>
<li>2009-Feb-19: <a href="2019-02-19-the-odd-case-of-my-mugging.html">The odd case of my mugging</a></li> <li>2009-Feb-19: <a href="2019-02-19-the-odd-case-of-my-mugging.html">The odd case of my mugging</a></li>
<li>2009-Feb-03: <a href="2009-02-03-5-packet-tcp-connection.html">5-packet TCP connection?</a></li> <li>2009-Feb-03: <a href="2009-02-03-5-packet-tcp-connection.html">5-packet TCP connection?</a></li>
<li>2006-Feb-07: <a href="2006-02-07-why-is-my-ssh-x-window-forwarding-broken.html">Why is my SSH X Window forwarding broken?</a></li>
<li>2006-Feb-06: <a href="2006-02-06-installing-debian-from-a-usb-stick.html">Installing Debian from a USB stick</a></li> <li>2006-Feb-06: <a href="2006-02-06-installing-debian-from-a-usb-stick.html">Installing Debian from a USB stick</a></li>
<li>2006-Feb-02: <a href="2006-02-02-rebooting-linux-when-it-doesnt-feel-like-it.html">Rebooting Linux when it doesnt feel like it</a></li> <li>2006-Feb-02: <a href="2006-02-02-rebooting-linux-when-it-doesnt-feel-like-it.html">Rebooting Linux when it doesnt feel like it</a></li>
<li>2006-Jan-25: <a href="2006-01-25-new-mysql-toys.html">New MySQL toys</a></li> <li>2006-Jan-25: <a href="2006-01-25-new-mysql-toys.html">New MySQL toys</a></li>

View File

@@ -0,0 +1,32 @@
<!--# set var="title" value="Why is my SSH X Window forwarding broken?" -->
<!--# set var="date" value="February 7, 2006" -->
<!--# include file="include/top.html" -->
SSH into your destination:
ssh -vv -X <hostname>
If you see a line near the end that says “_debug1: Remote: No xauth program; cannot forward with spoofing._“, you need to install xauth and reconnect. In Debian, run:
apt-get install xbase-clients
Next, ensure that youre getting a DISPLAY variable through:
echo $DISPLAY
If that command outputs just a blank line, X forwarding is probably being denied by the server. Edit your sshd\_config (/etc/ssh/sshd\_config on Debian) and change/add the line:
X11Forwarding yes
If you change this, youll need to restart your SSH server:
/etc/init.d/ssh restart
Once your DISPLAY is being passed correctly, some programs may run but act oddly (”Gdk-error: […] BadAtom”, etc.) SSH uses “SECURITY” extensions by default, and some programs dont work correctly with them. Try:
ssh -Y <hostname>
Note that this command may expose your local machine to compromise if someone malicious is in control of the host youre connecting to.
<!--# include file="include/bottom.html" -->

View File

@@ -39,6 +39,7 @@
1. 2009-Sep-11: [Confusing BIND with CNAMEs](2009-09-11-confusing-bind-with-cnames.html) 1. 2009-Sep-11: [Confusing BIND with CNAMEs](2009-09-11-confusing-bind-with-cnames.html)
1. 2009-Feb-19: [The odd case of my mugging](2019-02-19-the-odd-case-of-my-mugging.html) 1. 2009-Feb-19: [The odd case of my mugging](2019-02-19-the-odd-case-of-my-mugging.html)
1. 2009-Feb-03: [5-packet TCP connection?](2009-02-03-5-packet-tcp-connection.html) 1. 2009-Feb-03: [5-packet TCP connection?](2009-02-03-5-packet-tcp-connection.html)
1. 2006-Feb-07: [Why is my SSH X Window forwarding broken?](2006-02-07-why-is-my-ssh-x-window-forwarding-broken.html)
1. 2006-Feb-06: [Installing Debian from a USB stick](2006-02-06-installing-debian-from-a-usb-stick.html) 1. 2006-Feb-06: [Installing Debian from a USB stick](2006-02-06-installing-debian-from-a-usb-stick.html)
1. 2006-Feb-02: [Rebooting Linux when it doesnt feel like it](2006-02-02-rebooting-linux-when-it-doesnt-feel-like-it.html) 1. 2006-Feb-02: [Rebooting Linux when it doesnt feel like it](2006-02-02-rebooting-linux-when-it-doesnt-feel-like-it.html)
1. 2006-Jan-25: [New MySQL toys](2006-01-25-new-mysql-toys.html) 1. 2006-Jan-25: [New MySQL toys](2006-01-25-new-mysql-toys.html)