I have two servers. Server 1 has access to an Oracle instance on a server I have permission to hit but not login to via SSH. I would like to use SSH port forwarding to connect from server 2 to server 1 and from there to the Oracle instance. I have set
AllowTcpForwarding=yes but I still feel like something is wrong.
For the purposes of this question, I would like to focus simply on connecting to a postgres instance on server 1 (port 5432) from server 2 port forward from 16951.
ssh -L 16951:localhost:5432 server1 -nNT -f -g
from server 2, I can see
"localhost.16951" after running
netstat to check open ports which leads me to believe that the port is listening successfully.
When I run:
psql -U jbarton -p 16951
I get a message saying that there is no listening port localhost:16951
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.16951"?
Any comments, answers or suggestions are greatly appreciated.
When I now try this with oracle, connect using:
./sqlplus W_USER/password@//localhost:16951/dbname, I get this error:
ERROR: ORA-12537: TNS:connection closed
My oracle ora files look like this:
`#tnsnames.ora PROD2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 16951)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod2) ) )
And the sqlnet.ora
'# sqlnet.ora Network Configuration File Generated by Oracle configuration tools. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) NAMES.LOG_DIRECTORY = /var/oracle/network/log