ORA-01017 and ORA-12545 when trying to connect to oracle 12c with sqlplus I'm trying to connect to an oracle 12c database from a remote machine, but it fails with two errors.

sqlplus "user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.1.37)(Port=1521))(CONNECT_DATA=(SID=ora12)))"

SQL*Plus: Release 9.2.0.8.0
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: user
Enter password:  (pass)
ERROR:
ORA-12545: Connect failed because target host or object does not exist


On the connecting machine I can do:

$ tnsping server12

TNS Ping Utility for Linux: Version 9.2.0.8.0
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.37)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora12)))
OK (0 msec)


So there seems to be connectivity.

If I run the same sqlplus command on the DB server, I get

$ sqlplus "user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.1.37)(Port=1521))(CONNECT_DATA=(SID=ora12)))"

SQL*Plus: Release 12.2.0.1.0 

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


The TNS on the connecting machine says

server12 =
  (DESCRIPTION =
  (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.37)(PORT = 1521))
  )
  (CONNECT_DATA =
    (SID = ora12)
  )
  )


I can also connect from SQLDeveloper using Basic Connection Type and hostname = 192.168.1.37 and port 1521 and SID=ora12.

Any ideas on how to make it connect?
You can't connect from a 9.2.0 SQL*Plus to a 12.2.0.1 version or Oracle Database.

It was never a supported option as displayed in the Interoperability Support Situation matrix chart in an Oracle Support Note.1 (Oracle Support Login required to read the Oracle Document.)

A SQL*Plus 9.2.0 client was only able to connect to 11.2.0 server or lower.

The lowest supported version of SQL*Plus that could connect to an 12.2.0.1 version of Oracle Database would be an 11.2.0.x client.

1 Oracle: Note 207303.1

Reference: oracle 9i client connecting to oracle 12c server
 (Stackoverflow.com)