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 |
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 Eric |
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... |
In ~/.ssh on pc1, create a file named config and put an entry in it like this:
Host pc2The 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. Then you won't have to use numeric addresses. |
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 |
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 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. |
Quote:
X11Forwarding yesYou'll need to stop and restart sshd: /etc/rc.d/rc.sshd stop 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). |
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 |
All times are GMT -5. The time now is 03:35 AM. |