Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VNC over remote SSH to multiple remote workstations
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
phypor
n00b
n00b


Joined: 25 Jun 2002
Posts: 68
Location: Texas

PostPosted: Sun Oct 13, 2002 2:49 am    Post subject: VNC over remote SSH to multiple remote workstations Reply with quote

This is for someone with
one gentoo box connected to the internet - local linux
one other gentoo box on a different internet connection - remote linux
windows workstations on the same lan as remote linux - remote workstations
possibly windows workstations on your local lan - local workstations

and a need to control the remote workstations (with VNC) securely (with SSH), from either your local linux or local workstations


notes:
this is current for VNC 3.3.4

if you have a router in between either linux machine and the internet, youll have to setup port forwarding for port 22 (ssh) from the wan side of the router to the linux machine behind it

'bounce' is the user on local linux that will be used to create the local ssh port
'PASSWD' is where you put in a password
'your.home.ip' is where you substitute local linux ip

as of this writing, you have to specfically use the 3.3.4 ebuild for vnc

there are undoubtedly ways to improve the remote linux ssh tunnel establishment, such as setting up autologin / auto connect




-- local linux as root --
-- Do this step Once to setup ssh, vnc and the user --
Code:

bash# emerge rsync

# use full path to ebuild if neccessary
bash# emerge /usr/portage/net-misc/vnc/vnc-3.3.4.ebuild

# skip the following if youve already got ssh going
bash# emerge openssh
bash# /etc/init.d/sshd start
bash# rc-update add sshd default


# setup the local user, try to secure login due to remotely used password
bash# mkdir /home/bounce
bash# adduser -s /bin/sh -d /home/bounce -p PASSWD bounce
bash# echo 'exit' > /home/bounce/.profile



-- remote linux as root --
If you dont't already have ssh installed on your remote server run the above commands on it for ssh to get that installed


-- remote workstations (with administrator privs) --
-- Do this step Once to install vnc server --
Get RealVNC from here
Install it. Check the boxes to start on startup and register as a service.


-- remote linux as any non-root --
-- Do this step Once Per Reboot to establish ssh tunnel between linux machines --
Code:

# replace 'remote workstation' with the lan ip of the windows workstation where you've got vnc server running

bash$ ssh -l bounce -f -N -g -C -R 5900:remote workstation:5900 your.home.ip
bounce@your.home.ip's password: (enter PASSWD here)




-- local linux as your current user --
-- Do this step to establish a VNC connection over the ssh tunnel
Code:

bash$ vncviewer localhost


-- local workstations can get to remote workstations by pointing the vnc client at local linux --


Here's an example of some speedup aliases I use. (change the dummy ip for $RUMBLE to your local linux ip)

In my local linux /etc/profile I have
Code:

alias vnc-dopey='vncviewer localhost:2'
alias vnc-sneezy='vncviewer localhost:3'
alias vnc-grumpy='vncviewer localhost:4'
alias vnc-horny='vncviewer localhost:5'
alias vnc-doc='vncviewer localhost:10'



At the end of my remote linux /etc/profile I have
Code:

alias bounce='tail -10 /etc/profile'
alias psb='ps x | grep bounce'
alias killssh='killall ssh'

export RUMBLE=208.180.xx.xx
alias bounce-dopey='ssh -l bounce -f -N -g -C -R 5902:dopey:5900 $RUMBLE'
alias bounce-sneezy='ssh -l bounce -f -N -g -C -R 5903:sneezy:5900 $RUMBLE'
alias bounce-grumpy='ssh -l bounce -f -N -g -C -R 5904:grumpy:5900 $RUMBLE'
alias bounce-horny='ssh -l bounce -f -N -g -C -R 5905:horny:5900 $RUMBLE'
alias bounce-doc='ssh -l bounce -f -N -g -C -R 5910:doc:5900 $RUMBLE'


To establish a connection to the remote workstation "doc" I login to remote linux as non-root, type in "bounce-doc", enter the passwd I setup, and on local linux, as non-root I type "vnc-doc"... enter the passwd and it connects the client.

Also, after you run a bounce-whatever, it will stay alive until you kill it or the server reboots.


hope its helpful
~phypor
_________________
ALWAYS stay away from tanks enguled in fire.
- 2000 Emergency Response Guidebook, pg307
Back to top
View user's profile Send private message
Paradoxx
Apprentice
Apprentice


Joined: 13 Jan 2003
Posts: 197
Location: Sweden

PostPosted: Mon Mar 22, 2004 8:57 am    Post subject: Reply with quote

how do i do so i can connect owher internet?
_________________
//Jag är dyslectiker

//pless dount complain im dyslectic


//i whas born in hell im going to hell
Back to top
View user's profile Send private message
phypor
n00b
n00b


Joined: 25 Jun 2002
Posts: 68
Location: Texas

PostPosted: Mon Mar 22, 2004 3:14 pm    Post subject: How far did you get before you had trouble? Reply with quote

Paradoxx wrote:
how do i do so i can connect owher internet?


Following the instructions, how far along did you get ?
_________________
ALWAYS stay away from tanks enguled in fire.
- 2000 Emergency Response Guidebook, pg307
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum