Private Key File for SFTP in NetBeans

Addev picture Addev · Dec 18, 2011 · Viewed 10.1k times · Source

I'm trying to configure Netbeans for automatically upload PHP files to an SFTP server (I have not admin permissions in that server).

Everything is OK, except that Netbeans launches a warning each time it needs to upload something:

The authenticity of host ... can't be established. RSA key fingerprint is XX:XX:XX:,,,, Are you sure you want to continue connecting?

How can avoid being prompted every time? I suppose specifying the private key file is enough but don't know how to generate that file. Can you help me? (Suppressing the warning by other way will be ok too.)

Answer

Bjørn Otto Vasbotten picture Bjørn Otto Vasbotten · Jan 23, 2012

This is not too easy to understand from the gui, but it really is quite simple.

First, you need to create an empty text file that Netbeans will write to, call it knownhosts.txt.

Point to this file in the Known Hosts File field in your configuration. (Right-click on your project in the Projects window, choose Properties from the pull-down menu; select Run Configuration in the Project Properties dialog; and then click Manage Connections... Now you should see the Known Hosts File field where you can Browse to your empty text file.)

Test the connection.

That's it!