I'm using Ubuntu and trying to connect to a database server wich is accessed by a tunnel in my server wich is inside a router and I only have ssh connection to my server. Is there a way to do that?
For make things easier, I'll try to diagram it:
me -> connect through ssh (port 22) to my server in (serverip:12345)
myserver -> has a tunnel to database server
database server -> only accepts myserverip address
*serverip:12345 is a port forwarding from my router to myserver
Thanks in advance
UPDATE
Thanks for the help @Kondybas, I tried you suggestion but it didn't work. Maybe I wasn't clear enough.
I'll try again =D.
I am in my laptop and I have access to my server through ssh. My server is behind a router (no in the same network of my laptop), so to access my server I use:
ssh -p 12345 user@myserverip
My server already has a tunnel to a distant database:
ssh -L 1521:localhost:1521 user@mydbserverip
because when I'm in the same network of my server I can access the database with 192.168.0.X:1521
Since I can't touch in the router (the one who forward port 12345 to my server) and I can't create a direct tunnel to the database.
Is there a way to access the database from my laptop going through my server?
Thanks again.