Forums

Skip to content

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

xhost doesn't work

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
dattaway
n00b
n00b
User avatar
Posts: 29
Joined: Sat Jan 25, 2003 1:05 am
Location: Kansas Citeeeee, Missoureeeee
Contact:
Contact dattaway
Website

xhost doesn't work

  • Quote

Post by dattaway » Thu Jan 19, 2006 2:54 pm

My xorg server refuses to open windows from applications if the DISPLAY set to any IP address, including localhost. Without the IP address, windows open as they should. This means my xforwarding is broken, unless I start X with the -ac option, which disables all access control. Obviously, I don't want to run my xserver with the -ac option, so how do I get a functional access control?

Here is a typical runaround in the bash shell and a snippet of an strace:

Code: Select all

dattaway@home ~ $ export DISPLAY=:0.0
dattaway@home ~ $ xosview 
dattaway@home ~ $ export DISPLAY=127.0.0.1:0.0
dattaway@home ~ $ xosview 
Can't open display named 
dattaway@home ~ $ strace xosview
.... 
connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
....
dattaway@home ~ $ xhost +
xhost:  unable to open display "127.0.0.1:0.0"
dattaway@home ~ $ export DISPLAY=:0.0
dattaway@home ~ $ xhost +
access control disabled, clients can connect from any host
dattaway@home ~ $ xosview 
dattaway@home ~ $ xhost -
You see what's going on here?
Top
firex
Tux's lil' helper
Tux's lil' helper
Posts: 145
Joined: Mon Jan 05, 2004 7:30 pm
Location: Hamburg
Contact:
Contact firex
Website

  • Quote

Post by firex » Thu Jan 19, 2006 3:26 pm

the best way to do it what you want for me is :

ssh user@host -X [command]

in you sshd config you shuld enable X11Forwarding und restart sshd befor you try.

[command] is optional. if you don't use it you will get shell with set DISLPAY varible and all application started in the shell will use your local X :-)
Top
dattaway
n00b
n00b
User avatar
Posts: 29
Joined: Sat Jan 25, 2003 1:05 am
Location: Kansas Citeeeee, Missoureeeee
Contact:
Contact dattaway
Website

  • Quote

Post by dattaway » Thu Jan 19, 2006 3:54 pm

firex wrote:the best way to do it what you want for me is :

ssh user@host -X [command]

in you sshd config you shuld enable X11Forwarding und restart sshd befor you try.

[command] is optional. if you don't use it you will get shell with set DISLPAY varible and all application started in the shell will use your local X :-)
Yes, my X11 forwarding was enabled in sshd_config. Same error using ssh. Something inside the xserver is denying any request with an IP number, including localhost and loopback:

Code: Select all

dattaway@home ~ $ ssh dattaway@localhost -X xosview
Password: 
Can't open display named 
dattaway@home ~ $ 
Starting X with the -ac option makes it all work, but without ANY security. No other problems with name lookups that I can see. The X server just doesn't want to do it.
Top
Esel Theo
n00b
n00b
Posts: 35
Joined: Fri Jul 23, 2004 10:45 am

  • Quote

Post by Esel Theo » Thu Jan 19, 2006 5:58 pm

Never, never ever use xhost.

Simply do

Code: Select all

ssh -Y user@host
xosview
No xhost, no export DISPLAY, no nothing.

ssh will magically do X11 forwarding for you (except if you confuse it with xhost or export DISPLAY :-)).
Top
dattaway
n00b
n00b
User avatar
Posts: 29
Joined: Sat Jan 25, 2003 1:05 am
Location: Kansas Citeeeee, Missoureeeee
Contact:
Contact dattaway
Website

  • Quote

Post by dattaway » Thu Jan 19, 2006 7:12 pm

Esel Theo wrote:Never, never ever use xhost.

Simply do

Code: Select all

ssh -Y user@host
xosview
No xhost, no export DISPLAY, no nothing.

ssh will magically do X11 forwarding for you (except if you confuse it with xhost or export DISPLAY :-)).
ok...

Code: Select all

dattaway@ts7200:/$ ssh -Y dattaway@home.dattaway.org                                
Password:                                                                       
Last login: Thu Jan 19 13:07:55 2006 from cpe-69-23-113-234.kc.res.rr.com       
dattaway@home ~ $ xosview                                                       
Can't open display named                                                        
dattaway@home ~ $ 
See what I'm trying to say? My xserver WILL NOT honor any ip address, not from another box, localhost, or even the loopback address. SSH works great. SSH sets up the environment up like it should. Its not the problem. Its *within* X.
Top
firex
Tux's lil' helper
Tux's lil' helper
Posts: 145
Joined: Mon Jan 05, 2004 7:30 pm
Location: Hamburg
Contact:
Contact firex
Website

  • Quote

Post by firex » Thu Jan 19, 2006 10:04 pm

try "ssh user@host -X " only and check DISPLAY
for me it is localhost:10.0 on the remote pc.
then try to start xterm

/etc/ssh/sshd_config must have X11Forwarding yes
Top
dattaway
n00b
n00b
User avatar
Posts: 29
Joined: Sat Jan 25, 2003 1:05 am
Location: Kansas Citeeeee, Missoureeeee
Contact:
Contact dattaway
Website

  • Quote

Post by dattaway » Sat Jan 21, 2006 9:05 pm

I found the problem with ssh -vvv
It was able to tell me it could not find xauth
Now it works! :mrgreen:
Top
Post Reply

7 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

 

 

magic