On Wed, 20 Mar 2002 17:22:27 -0800
Patrick Beart <[EMAIL PROTECTED]> quietly intimated:

> Folks:
> 
>       I'm trying to setup a PII laptop, running RH 7.2 (Enigma) to 
> connect to my remote servers (also running RH 7.2), via X.
> 
>       What I want to do it use the laptop as a kind of "dumb 
> terminal" to the servers, so that I can use the KDE/Gnome interface, 
> instead of being limited to only Telnet/SSH command line sessions 
> when I want to make changes to the server.
> 
>       I've seen some links (via Google) that seem to describe this 
> process. I've even made some headway to getting this going. However, 
> at the moment when I try to start the remote X Window session the 
> laptop doesn't get information coming BACK from the server.
> 
>       Anybody have success getting this kind of connection to work?

Easier than you probably think!

I use this script on the server (remote) end:

------------------------------------------------

#!/bin/bash

export DISPLAY=<clientname>:0.0
exit 0

-----------------------------------------------

And this one on the receiving (local) end:

-----------------------------------------------

#!/bin/bash

xhost +<servername>
ssh <servername>
exit 0

---------------------------------------------

Replace the <servername> with your remote server name and <clientname>
with your laptop's name.

They both require ssh and sshd has to be running on the server (I run on
both automatically). The proper ports need to be open (ssh-22) on both
machines. The laptop needs to be running X and any apps run from that
terminal will show up on the laptop's desktop. It will remain this way
until that terminal session (the secure shell part) is closed.

Make sure there is _NO_ space between the plus (+) and the servername or
you leave your desktop opened to anybody from the outside world that can
get into your machine.

There's also VNC, which comes with RH. Here's a script I use to get it
started (I have 2 users that keep desktops exported). I run it at boot,
called from rc.local, but it could just as easily be run from the
commandline by root, or trimmed and run by individual users:

--------------------------------------------------------------------

#!/bin/bash

vnc_users="kcsmart guest"
disp=2

for user in $vnc_users
do
     echo -e "Starting VNC server for $user (display no. :$disp)...\c"
     vncstart="/usr/bin/vncserver :$disp -depth 16 -geometry 1024x768
-name Display1"
      vnc_cmd="su -l $user -c \"$vncstart\" >/dev/null"

     if eval $vnc_cmd; then
         echo "DONE"
     else
         echo "***VNC FAILED***"
     fi

     # Run xterm on the vnc session on Linux
#     su -l $user -c "DISPLAY=:$disp xterm &"

     disp=$(( $disp + 1 ))
done

----------------------------------------------------------------------

I have users kcsmart and guest (I use 'i in 10' in case I want to add
more users later; it gives more flexibility without having to modify the
script). They both get a session started. I start those with display 2
(disp=2) but it can be changed to any number under 10. I also step it by
1 (disp=disp+1) and that can also be changed as long as you keep all
numbers under 10.

I have commented out the added xterm in this script, but you can easily
add it back in. I did that because I run individual sessions that run
icewm as a desktop (I've also used KDE on one of them). I allow those
environments to set things up in a separate xstartup file. Here's one of
those:

----------------------------------------------------------------------

#!/bin/sh
# xstartup for kcsmart

xrdb $HOME/.Xresources
xsetroot -solid grey
gkrellm &
chbg -scenario /home/kcsmart/.vnc/chbg &
icewm &

------------------------------------------------------------------------
VNC requires ports open, too. The fist session is 5900, the second 5901,
etc. It can also be run via a java-equipped browser, and that requires
ports 5800 on up. If not using the browser, one runs vncviewer and gives
the server thusly:

<servername>:<display>

Such as:

server.harry.net:0

The first session is display 0 (different than the display setting used
by the computer's desktop; there can be a desktop display 0 and a VNC
session 0 at the same time), the second is 1 and so forth.

The difference is, the exported X environment allows you to run apps
from the server machine on the local desktop. The VNC environment puts a
window from the remote machine on the local desktop (either in a
browser, or via vncviewer).

Just a couple of possibilities. And I think I covered it all.

-- 
I'm so hungry, I could almost eat health food.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to