Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication by identity file failed with error code -18

I received this error when trying to establish an SSH tunnel using pgAdmin3

  • I specified the private key location on my local machine (had to enable hidden files on my Mac finder to see it),
  • entered the tunnel host (used public host IP) and
  • checked the 'Identity file' option.

I don't have a password set on my key.

Received this error:

Authentication by identify file failed with error code -18

What am I doing wrong (or what do I need to do differently)?

like image 959
Drewdavid Avatar asked Nov 20 '14 06:11

Drewdavid


1 Answers

I was getting this continously on windows (VM).

So I decided pgAdmin's built in ssh tunnel was no good and just used gSTM (On linux).

Forwarding the port from the remote server 5432 to local host 5555 worked. Then I could just use pgAdmin III on Linux to connect.

You could probably use command line like this if you don't want to use a graphical tool such as gSTM. ssh -fNg -L 5555:localhost:5432 {your_username}@{yourdomain.com}

Source: http://dustindavis.me/ssh-tunnel-in-pgadmin3-for-postgresql/

You can also use putty on windows to forward ports. See Connection | SSH | Tunnels menu in the PuTTY Configuration.

http://www.akadia.com/services/ssh_putty.html

Then you can access it.

Of course be very carefull messing about in a remote database. It is a good idea to label them a red or orange colour in pgAdmin to easily identify the ones that are not on your local network.

like image 116
Liam Mitchell Avatar answered Oct 01 '22 15:10

Liam Mitchell