Hello,
Essentially, the idea with SSH port forwarding is that you use the host that you SSH into as a kind of connectivity bridge, linking up your local computer in some fashion with the network available to the remote computer. Using local port forwarding you are able to use a port on your local computer to connect to a service running on the remote network; or using remote forwarding, you can enable hosts on the remote end to connect to services on your computer via a port that is opened on the host you are SSH'd into.
That's the basic idea, anyway. So in your scenario, it sounds like you want to use local port forwarding, thus allowing you to connect to port 1152 on your local machine, and to have those packets forwarded to port 1521 on a remote machine. This will work so long as from the SSH host you are able to connect to port 1521 on the database server. If the host you are SSH'ing into cannot directly connect to port 1521 on the DB box, then attempts to forward the connections from your local machine to the remote one will not succeed.
The syntax you would be looking for would be something along the lines of:
ssh -L 1152:<IP address of the Oracle box at the remote end>:1521 <the rest of your normal SSH options go here>
So for example, if I wished to SSH into a host called ssh-gateway
and use it to forward connections from port 8080 on my local machine to port 80 on a Web server with an IP of 192.168.0.1 (which would need to be accessible from the ssh-gateway
host for this to work), I would type:
ssh -L 8080:192.168.0.1:80 user@ssh-gateway
and that would do the trick. I could now visit http://127.0.0.1:8080
in a Web browser running on my local machine, and in reality I would find myself effectively talking to port 80 on 192.168.0.1 on the remote end, and be able to use Web sites hosted on it as if I was directly accessing them from ssh-gateway
.
Again, this all depends on 192.168.0.1:80 being accessible from the host ssh-gateway
- if it is, then this will work. If it is not, then this will just silently fail to produce any usable results.
Hope this helps ! If any part of the above is unclear or if you have any further questions, please let us know and we can take things from there.