# [solved] Can't use X forwarding in SSH

## ishanarora

Hi,

I am not able to use X forwarding with SSH. This is what I get

```
ishanarora@calculus ~ $ ssh -X quack

Password: 

Warning: No xauth data; using fake authentication data for X11 forwarding.

Last login: Sun Sep 30 19:28:01 2007 from xx.xx.xx.xx

ishanarora@quack:~> 

```

When I run any gui apps, i  get these messages

```
ishanarora@quack:~> konqueror 

Xlib: connection to "localhost:10.0" refused by server

Xlib: Invalid MIT-MAGIC-COOKIE-1 key

konqueror: cannot connect to X server localhost:10.0

```

```
ishanarora@quack:~> firefox

Xlib: connection to "localhost:10.0" refused by server

Xlib: Invalid MIT-MAGIC-COOKIE-1 key

(firefox-bin:8299): Gtk-WARNING **: cannot open display: 
```

Another friend of mine is able to do the same on his system, so i guess there is something wrong with my X server. I am guessing the problem is trivial where my xauth data is not being passed via ssh, but why and how do I fix it?Last edited by ishanarora on Fri Oct 12, 2007 8:06 pm; edited 1 time in total

----------

## mattsteven

Make sure the /etc/ssh/ssh_config has all the X options enabled on the client machine, and /etc/ssh/sshd_config has all the X options for the server enabled on the server.  Lots of times people do one but not the other.

----------

## sternklang

Hi,

Google is your friend

The most useful result seems to be this one: *Quote:*   

> Symptoms: ssh prints "Warning: No xauth data; using fake
> 
> authentication data for X11 forwarding."
> 
> When ssh is unable to get Xauthority information for the display, it
> ...

 

----------

## ishanarora

Hi,

Thanks for your help. I found the solution after reading the last option in the man page for ssh_config. 

```
     XAuthLocation

             Specifies the full pathname of the xauth(1) program.  The default is /usr/openwin/bin/xauth.

```

So I just added this to my /etc/ssh/ssh_config

```
Host *

  ForwardX11Trusted yes

  XAuthLocation /usr/bin/xauth
```

Seems I was right about xauth data not being passed coz ssh could not find xauth.

PS: I had looked up on google and I had read through that page sternklang qouted, but that doesn't work coz that seems to be a very old page doing things manually that ssh is supposed to handle fully automatically. Thanks again

----------

## ishanarora

I was wondering if anyone would know how to forward a kde session to a display other than the one being used for localhost

----------

