Christopher Schneider
Christopher Schneider

Reputation: 3915

Connecting to Oracle DB only accessible via SSH

Searched quite a bit on this, but I think it's a bit of a unique case. What I'm asking may not be possible.

I'm taking an online DB class that requires logging into an SSH server and using SQLPLUS to execute commands and then copying and pasting the results into a document to be submitted. I find SQLPLUS to be excruciatingly painful to work with in the command line... You can't press up for the last command, and if you happen to be holding shift while pressing backspace you get garbage characters.

Anyway, I was hoping I could attach a GUI to make my life easier, but there are some major restrictions. I've tried logging in with SQL Developer, but the connection is rejected.

The only way I can get to the SQL database to do my assignments is by logging into the school's SSH server and running SQLPLUS from there. It seems that attempted connections to the Oracle DB from any IP other than the school's SSH servers are rejected.

I was hoping to use SSH tunneling to connect to the DB server from my local machine, but the only open port on the school's SSH server is 22.

Do I have any options? I would just love to have some sort of database program with a terminal window on the bottom part of the screen and a GUI on top.

Upvotes: 0

Views: 1812

Answers (1)

quickshiftin
quickshiftin

Reputation: 69621

Is SSH tunneling not working, it sounds like it would be perfect. Take a look at this link.

You should be able to do something like (from a terminal on your home system)

oracle_port=XXXX
ssh -f [email protected] -L $oracle_port:school-server.com:$oracle_port -N

Now fire up SQLPLUS on your home machine and point it at localhost:$oracle_port.

Forgive me on the $oracle_port part, I'm not an oracle guy! Substitute appropriately.

Upvotes: 1

Related Questions