LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-11-2006, 03:12 PM   #1
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 660

Rep: Reputation: 39
can't run applications remotely using export DISPLAY and xhost +


hi everyone,
im on two slackware pcs and i have a LAN. i am loging onto pc1 with ssh. and doing on that pc
export DISPLAY=pc2:0.0 .. pc2 is where i am sitting now...
then on pc2 im doing xhost + (to simplify things) ..
then i try to run xlogo or xload from pc1 so that it will pop up in pc2 monitor...
but it tells me it can't connect to the display...
what haven't i don yet?
what configurationm files are involved so that i can go check them?
thank you for your help
nass
 
Old 10-11-2006, 03:31 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,435

Rep: Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627Reputation: 7627
Do the computers know what IP address pc1 and pc2 have? Did you setup the /etc/hosts file with mappings of the host names to IP addresses?

What does
Code:
ping pc2
tell you if you run that on pc1?

Eric
 
Old 10-12-2006, 06:01 AM   #3
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 660

Original Poster
Rep: Reputation: 39
they both 'see' each other when i ping them. and either way im only using numeric ip addresses at this stage .. no names involved. pc1 and pc2 are names that fit in conviniently in writing this thread... (since i tend to mix up the client and server pc's lol)


so no that can't be it...
 
Old 10-12-2006, 06:29 AM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
In ~/.ssh on pc1, create a file named config and put an entry in it like this:
Host pc2
ForwardX11 yes
Compression yes
Protocol 2,1
User userid

Host *
ForwardX11 no
Compression yes
Protocol 2,1
The first entry allows pc1 to run applications on pc2 with display on pc1's screen. The second is the "blanket" entry for not permitting when connecting to machines outside your LAN. Do the same thing on pc2, changing "pc2" to "pc1" in that file.

A config file like this in ~/.ssh overrides system-wide settings (and makes life simpler).

It would be useful, while you're at it, to put entries of this form in /etc/hosts
# For loopbacking.
127.0.0.1 localhost
192.168.1.10 pc1.com pc1
192.168.1.20 pc2.com pc2

Then you won't have to use numeric addresses.
 
Old 10-13-2006, 05:17 AM   #5
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 660

Original Poster
Rep: Reputation: 39
i have already tweaked /etc/ssh/ssh_config and sshd_config
and uncommented in them both 'X11forward yes' and Host * (i believe that this means all hosts are allowed X11fwd).

do u really think i should put a config in ~/.ssh ?

nass
 
Old 10-13-2006, 05:55 AM   #6
billstclair
LQ Newbie
 
Registered: Oct 2006
Distribution: Slackware 11.0, Puppy 2.10
Posts: 6

Rep: Reputation: 0
I don't know how to enable the general ability of opening a window on PC1 from PC2, but I DID just learn that with your setup, ForwardX11 enabled in PC1's ssh_config for Host including PC2, and ForwardX11 enabled in PC2's sshd_config, it works for me to connect to PC2 from PC1 via ssh, with the -X parameter, and then start an X application. I also did "xhost localhost" on PC1.

Here's an example connecting to Slackware 11.0 on my desktop machine from Puppy 2.10 on my laptop:

Code:
# ssh -X wws@desk
Warning: No xauth data; using fake authentication data for X11 forwarding.
Last login: Fri Oct 13 06:40:43 2006 from lap
Linux 2.4.33.3.

I bet you have fun chasing the soap around the bathtub.
                -- Princess Diana, to a one-armed war veteran during
                   a visit to a London veterans hospital

wws@slackcraft:~$ echo $DISPLAY
localhost:10.0
wws@slackcraft:~$ xterm
Warning: Cannot convert string "nil2" to type FontStruct
wws@slackcraft:~$
An Xterm window popped up on my laptop.

The secret is "ssh -X"

I have used X-window servers on Windows and Unix machines that allow opening an X window through a telnet or rlogin session, but I haven't yet learned how to do that. No need, really, an encrypted ssh tunnel is much more secure.

Last edited by billstclair; 10-13-2006 at 06:05 AM.
 
Old 10-13-2006, 07:49 AM   #7
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Quote:
Originally Posted by nass
i have already tweaked /etc/ssh/ssh_config and sshd_config
and uncommented in them both 'X11forward yes' and Host * (i believe that this means all hosts are allowed X11fwd).

do u really think i should put a config in ~/.ssh ?

nass
On PC2, try editing /etc/ssh/sshd_config and set these (they're at the bottom of the file); you don't need -- or want -- to mess with any other settings in that file:
X11Forwarding yes
X11DisplayOffset 10
You'll need to stop and restart sshd:
/etc/rc.d/rc.sshd stop
/etc/rc.d/rc.sshd start

Then, on PC1, enter
ssh PC2 /usr/X11R6/bin/xclock

and you should see the clock.

You really don't want "Host *" in /etc/ssh/sshd_config, do that in the per-user config (in ~/.ssh) to restrict unknown hosts from running X applications from your box if they're logged in as "you" (whoever "you" may be). That per-user config file works along with the system-wide configuration on a user-by-user basis and, when you've done the above along with ~/.ssh/config you should be able to simply execute a command on the remote machine as the example xlock above.

So, yeah, you probably should put the config file in ~/.ssh (and repeat the same thing on PC1 so PC2 can execute things).
 
Old 10-14-2006, 05:25 AM   #8
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 660

Original Poster
Rep: Reputation: 39
solved

i finally managed..
no i didn't do it with ssh -X even though i guess you managed to do that for me
what i did , in /etc/X11/xdm/ :

file Xaccess, uncomment lines (shown uncommented already):
* #any host can get a login window
and
* CHOOSER BROADCAST #any indirect host can get a chooser

file xdm-config, comment line (shown commented already):
!DisplayManager.requestPort: 0

and in /opt/kde/share/config/kdm:
file Xaccess, uncomment lines (shown uncommented already):
* #any host can get a login window
and
* CHOOSER BROADCAST #any indirect host can get a chooser

file kdmrc, make sure:
[Xdmcp] #look for this section and put Enable to TRUE if its not
Enable=true
Port=177

[X-:*-Core] #look for this section and Comment...
#ServerArgsLocal=-nolisten tcp

then by using the export DISPLAY=... and xhost + in the 2 pcs it should work fine

i basically got all this steps from this very good HOW-TO:
http://www.tldp.org/HOWTO/XDM-Xterm/config.html

nass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xhost+ Unable to open Display atifrafi Linux - Software 1 06-26-2005 12:22 PM
Problem opening Display / xhost + not working rot Linux - Software 2 06-09-2005 01:56 AM
xhost: unable to open display d_kote23 Fedora 1 06-03-2004 08:40 AM
xhost: unable to open display aqoliveira Linux - Networking 4 12-12-2003 04:36 PM
Unable to run X applications remotely pree Linux - Software 0 06-27-2003 01:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration