IT professionals voor ondernemers

ssh - tunneling via a gateway PDF Afdrukken
The secure shell, ssh, can be used to transport data for other applications, such as rsync, cvs, or vnc .

the machine you are starting from is called "myhome", the intermediate machine is called "gateway", and the
machine you really want to connect to is called "server"
1. Setup autorized authentication with ssh:
SSH Without a Password:

On the client (my home) run the following commands:

$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''

This should result in two files, $HOME/.ssh/id_dsa (private key) and $HOME/.ssh/id_dsa.pub (public key).

Copy $HOME/.ssh/id_dsa.pub to the gateway.

On the gateway server run the following commands:

$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2

2.  Setup the tunnel:

On the My Home server:
ssh -f -N -L 8767:server:8767 gateway 
3. Use tunnel:

Use "ssh -p 8767" as a command to make a "direct" ssh connection to server.

Combination use with rsync:

rsync -SHar -e 'ssh -p 8767' localhost:/somewhere/on/server /localdir


< Vorige   Volgende >