Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[solved] Can't use X forwarding in SSH

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
ishanarora
n00b
n00b
Posts: 40
Joined: Fri Jul 13, 2007 10:10 pm
Contact:
Contact ishanarora
Website

[solved] Can't use X forwarding in SSH

  • Quote

Post by ishanarora » Sun Sep 30, 2007 2:29 pm

Hi,

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

Code: Select all

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

Code: Select all

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

Code: Select all

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.
Top
mattsteven
Apprentice
Apprentice
User avatar
Posts: 240
Joined: Mon Oct 27, 2003 2:30 pm
Location: Your Planet
Contact:
Contact mattsteven
Website

  • Quote

Post by mattsteven » Sun Sep 30, 2007 2:44 pm

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.
Matthew Steven
Linux-only desktop since 1998
Graying hair since 2006
Top
sternklang
Veteran
Veteran
User avatar
Posts: 1641
Joined: Sat Sep 10, 2005 1:22 pm
Location: Somewhere in time and space

  • Quote

Post by sternklang » Sun Sep 30, 2007 2:58 pm

Hi,

Google is your friend

The most useful result seems to be this one:
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
makes up some fake authentication data and prints:

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

This happens in particular if there is no entry for the local display
(of the form :D.S or of the form $HOTSNAME/unix:D.S) in ~/.Xauthority on
local host (the host where you issued ssh). To see the list of display
names, run:

$ xauth list

To fix this problem, run the following command on the local host:

$ xauth add `echo "${DISPLAY}" | sed 's/.*\(:.*\)/\1/'` . `mcookie`

Make sure that the command xauth and mcookie on your PATH, otherwise
use the absolute pathname for these commands.

xauth is the program to manage the authorization information used in
connecting to the X server.

echo "${DISPLAY}" | sed 's/.*\(:.*\)/\1/' extracts the display and
screen numbers in the form :D.S (e.g., :10) from DISPLAY environment
variable of the form HOSTNAME:D.S (e.g., localhost:10).

. is an abbreviation for MIT-MAGIC-COOKIE-1 protocol name.

mcookie generates magic cookies for xauth.
Top
ishanarora
n00b
n00b
Posts: 40
Joined: Fri Jul 13, 2007 10:10 pm
Contact:
Contact ishanarora
Website

Solved

  • Quote

Post by ishanarora » Sun Sep 30, 2007 5:32 pm

Hi,

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

Code: Select all

     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

Code: Select all

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
Top
ishanarora
n00b
n00b
Posts: 40
Joined: Fri Jul 13, 2007 10:10 pm
Contact:
Contact ishanarora
Website

how to forward to a seperate display

  • Quote

Post by ishanarora » Sun Sep 30, 2007 5:43 pm

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

5 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy