Tunneling with SSH - backwards!

Support for security such as Firewalls and securing linux
Post Reply
eastcoastcoder
Posts: 16
Joined: 2005/06/19 05:59:28

Tunneling with SSH - backwards!

Post by eastcoastcoder » 2005/06/24 04:26:23

Hi. I currently SSH into my server, and access certain things with tunnels.

Is there any straightforward way to create a backwards tunnel, that is, from the server back to me (the client)? I run various services (database, source code repository) on my workstation, and I'd like to be able to access it directly, via an SSH tunnel, from my server.

cormander
Posts: 100
Joined: 2005/05/16 21:27:57
Location: Utah
Contact:

Re: Tunneling with SSH - backwards!

Post by cormander » 2005/07/16 21:20:20

Run the following as root. You will need to have your public key setup on the remote host so that you can login via ssh without typing a password:

[code]
/usr/sbin/pppd updetach noauth passive pty "/usr/bin/ssh -P REMOTE_HOST -lroot -o Batchmode=yes sudo /usr/sbin/pppd nodetach notty noauth" ipparam vpn NEW_LOCAL_IP:NEW_REMOTE_LOCAL_IP
[/code]

change REMOTE_HOST to the ip / domain name of the remote host

change NEW_LOCAL_IP to a RFC1918 address, such as 192.168.50.1 ( make sure it's an IP you don't use on your network )

change NEW_REMOTE_LOCAL_IP to something similar, such as 192.168.50.2

This creates a peer to peer protocol link between the two systems, just like a VPN.

From local, you can ssh to remote via the IP 192.168.50.2

From the remote host, you can ssh back to local via the IP 192.168.50.1

Hope this helps.

Post Reply

Return to “CentOS 4 - Security Support”