Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Initiate X connection from Text Mode Login?

Status
Not open for further replies.

heintze

Programmer
Nov 19, 2005
61
US
I'm trying to follow the instructions on page 243 from "Linux in a Windows World" to run GUI programs on a remote RedHat 8 (RH8) at my work office from a Fedora Core 4 at home.

The cisco VPN seems to be working and I ssh to the RH8 and that seems to be working too.

I type "xhost +" and "DISPLAY=209.97.230.250:0" and that, not surprisingly does not work because it has to get thru my fire wall.

Here is the message I get when I try DISPLAY=battle.angel:0
sheintze@co-sheintze-linux ~]$ xterm
_X11TransSocketINETConnect: Can't get address for battle.angel
xterm Xt error: Can't open display: battle.angel:0

battle.angel is the name of my home machine.

So do I need to open ports on my firewall? If so, which ones?

Thanks,
Siegfried
 
I just tried opening up ports 6000-6001. Now I don't an error now, but nothing happens.

Thanks,
siegfried
 
Did I do something stupid by broadcasting my IP address in the first post? Can someone edit that message and remove my IP address? How do I undo "xhost +"?

I just did some googling for xhost and they say don't do "xhost +" -- it is a security breach.

Anyway, when I am using a VPN, whose internal addresses are we using? I'm confused (again!).

Thanks,
Siegfried
 
Try /sbin/ifconfig

See what address has actually been allocated to you. Then set the DISPLAY to your address :0.0

xhost + is not the full command. You can xhost + specific hosts. If you just + it means everyone: hence the security breach. Anyone who knows you've done that can splat your screen with anything.
 
Is that all? Can they format any disks or delete any files if I "xhost +"?

Well anyway, I did "ifconfig" (assuming /sbin/ifconfig is the same thing) and I get 192.168.1.4. When I

export DISPLAY=192.168.1.4:0.0

there is along pause and the it (RH8) complains that it cannot access that IP. I'll post the exact error message later today.

Does the VPN allow the RH8 machine at work to see my internal IP addresses at home? What if both machines happened to use 192.168.1.4 for their internal network address?

Thanks,
Siegfried
 
[sheintze@co-sheintze-linux ~]$ xterm
xterm Xt error: Can't open display:
[sheintze@co-sheintze-linux ~]$ export DISPLAY=192.168.1.4:0.0
[sheintze@co-sheintze-linux ~]$ xterm
xterm Xt error: Can't open display: 192.168.1.4:0.0
[sheintze@co-sheintze-linux ~]$

192.168.1.4 is the addess I get with ifconfig
What am I doing wrong?

Thanks,
Siegfried
 
Oh hoh! OK, I see a new address (172.18.0.154) when I do "ifconfig" after connecting the VPN.

Hmmm... still does not work though.


Thanks,
Siegfried

[root@battle siegfried]# uname -a
Linux battle.angel 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:16:33 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
[root@battle siegfried]#

[sheintze@co-sheintze-linux ~]$ export DISPLAY=battle.angel
[sheintze@co-sheintze-linux ~]$ emacs &
[1] 1279
[sheintze@co-sheintze-linux ~]$ emacs: Cannot connect to X server battle.angel.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.


[1]+ Exit 1 emacs
[sheintze@co-sheintze-linux ~]$ export DISPLAY=172.18.0.154:0.0
[sheintze@co-sheintze-linux ~]$ emacs &
[1] 1292
[sheintze@co-sheintze-linux ~]$ emacs: Cannot connect to X server 172.18.0.154:0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.


[1]+ Exit 1 emacs
[sheintze@co-sheintze-linux ~]$ emacs
 
Why not just use ssh X forwarding?

ssh -X joeUser@192.168.1.42
emacs&

Which is more secure anyway, because it's all encrypted where normal x forwarding is sent as plain text (by default).

Otherwise, the way your trying:
- Punch hole in firewall
server side:
xhost + 192.168.1.41:0.0 # where 192.168.1.41 is client your allowing

client side:
xhost + 192.168.1.42:0.0
xwin -query 192.168.1.42

emacs&

[plug=shameless]
[/plug]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top