0

At my company we have a strict security policy and to access my server i need to use different jumpboxes like this:

  1. jump_box_1 (has public access)
  2. jump_box_2 (has private access)
  3. my_server (here is my database)
  4. public_server (has access to my_server)

So far i managed to access my_server starting from jump_box_1 with putty and multiple tunnels like this:

1. start a ssh command to open a port on jump_box_1:

ssh -L 2222:jump_box_2:22 my_user@jump_box_1

2. start putty session configured like this(this 3 pictures are from the same connection):

putty configuration

and now i can access my database with:

host: localhost

port: 1521

What i want is to get rid of putty and use only ssh commands so in the end to automate all of this.

Thank you.

0

1 Answer 1

0

I've managed to fix it with one ssh command like this, i hope it help someone:

ssh -fN -L 2222:jump_box_2:22 <user>@jump_box_1 && ssh -fN -p 2222 -L 2223:public_server:22 <user_jump_2>@localhost && ssh -p 2223 -L 1521:my_server :1521 <user_public_server>@localhost

Not the answer you're looking for? Browse other questions tagged .