Local port forwarding through a bastion machine:
One line version:
ssh -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 [email protected]
Or run with -v
to debug:
ssh -v -i ~/.ssh/bastion-key.pem -N -L 9000:db.mycompany.com:1521 [email protected]
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.```