<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 you’re 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, you’ll 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 don’t work correctly with them. Try:</p>
<pre><code>ssh -Y <hostname>
</code></pre>
<p>Note that this command may expose your local machine to compromise if someone malicious is in control of the host you’re connecting to.</p>