I have the following setup:
- A machine on the local network that is connected to a VPN on another network, lets call it machine A
- A machine on the local network that has access to machine A, but with no access to the VPN. Lets call it machine B.
Now if I want to access hosts inside the VPN from machine B, I could certainly do ssh forwarding or chained ssh calls (e.g.
ssh machine-a ssh machine-vpn) but that gives me only limited access (i.e. as many ports as I specify in SSH tunnel using the
-L option). Is there a way to create some sort of "Virtual Host" using SSH such that any connection to that Virtual Host in SSH will be forwarded to the target host inside the VPN, regardless of the port? To put the question in another way:
From machine A:
ssh -L 16000:machine-vpn:22 machine-a #creating the initial tunnel to the SSH port on machine-vpn #now ssh -p 16000 localhost does an SSH to the machine behind the vpn #create the Virtual Host somehow using SSH, call the virtual host vhost ssh vhost #this will ssh to the machine behind the vpn, using ssh tunnel ftp vhost #this will ftp to the machine behind the vpn, using ssh tunnel #etc.
Is there anyway to do that kind of thing?