Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Local port forwarding through a bastion machine:

One line version:

ssh -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 myuser@bastion.mycompany.com

Or run with -v to debug:

ssh -v -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 myuser@bastion.mycompany.com

Db should be accessible on localhost:9000 From another terminal run: telnet localhost 9000 <- this does not prove the connection to the DB unfortunately, need to check by connecting to the db with dedicated app or jdbc

In debug mode I have:


# and after using telnet
Connection to port 9000 forwarding to bd.db.mycompany.com port 1521 requested.```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.