30

So, i've been having this problem for a while now.

Notepad++ NppFTP plugin fails to connect to server via SFTP with "[SFTP] Error during authentication: Invalid private key file". But the key file is 100% correct and i'm connecting fine with WinSCP.

Any solutions?

Pavel Lint
  • 3,252
  • 1
  • 18
  • 18
  • Are npp and winscp using the same private key file? – Sergio Tulentsev Jan 20 '12 at 10:35
  • I'm having the same issue. I'm thinking of trying to maybe converting it to a *.ppk file? – Roy Rico Feb 07 '12 at 19:05
  • If all else fails and you've regenerated keys and whatnot and you still can't connect, try simply deleting that profile within NPP and re-creating it using whatever key is currently valid. Sometimes the profiles do get corrupted and make it seem like a server-side or key issue. – Ivan Dec 06 '16 at 19:50
  • 1
    fwiw I generally SSH with an ecdsa key but NppFTP only seems to work with an rsa key. – Auspex Jan 04 '17 at 12:02

9 Answers9

92

The solution for me was to use puttygen to export a .ppk version of my private key to OpenSSH as follows:

  1. Open PuttyGen
  2. Menu: Conversion -> Export OpenSSH key
  3. Save your new key (don't forget to make it clear it is openssh)

This was weird seeing as my .ppk was converted from a private key generated by OpenSSH itself.

I think it has to do with the fact that my original key starts with

---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----

whereas the exported key starts with

-----BEGIN RSA PRIVATE KEY-----
checklist
  • 12,340
  • 15
  • 58
  • 102
strocknar
  • 1,146
  • 9
  • 9
  • 14
    Just adding a little more detail, the option desired is Toolbar -> Conversions -> Export OpenSSH Key. This works. OP should accept this answer – w-- Dec 10 '12 at 19:34
  • Yep, exporting to openSSH did it for me as well! Thanks! – Daniel Dimitrov Feb 19 '14 at 12:07
  • @w, you should submit your addendum as an edit to the answer; your rep is certainly high enough. – Brian A. Henning Jun 10 '15 at 15:26
  • Im lost here, what am i suppose to do with the key after i save it to let´s say desktop? Also could anyone tell me why doesnt my nppftp connect vis sFTP using password. Getting an error "None of the server's authentication methods were accepted". Meanwhile winSCP connects effortlessly with same parameters. – ints Dec 11 '19 at 16:11
8

Log-in to your terminal. Make sure you are in /home/your_user_name/

First client private/public key

$ ssh-keygen -t rsa

  1. Press Enter to choose default directory
  2. You may choose a pass phrase here depending upon situation.

Now add your public rsa key details to authorized keys, use the following command

$ cat id_rsa.pub >> ~/.ssh/authorized_keys

$ chmod 600 ~/.ssh/authorized_keys

After this delete the id_rsa.pub file if you wish.

Now the private key file id_rsa is the one you need to 'import'.

You need the tool called the puttygen to import this file and then
click on the Menu Bar -> Conversions -> Export OpenSSH Key and save the exported file.

Save it as npp.ppk (maybe) and then use this in the Notepad++ Private key file path.

amresh tripathi
  • 121
  • 1
  • 5
  • Thank you for mentioning `npp.ppk` as using the above procedure with any other filename fails to connect for me. `npp.ppk` worked. – Krista K Nov 29 '14 at 04:47
2

Go to C:\Users\[User Name]\AppData\Roaming\Notepad++\plugins\config\NppFTP

and delete the entry of the host in that file and try re-connecting.

2

When using Notepadd ++ I found that if your logging into a secure server with NppFTP and you know your user name and password but your getting [SFTP]Unable to authenticate error: Try going to toolbar -> Profile settings -> Authentication and only check the box that says try password authentication. The default is private file but, that doesn't all ways apply.
-Hope that helps-

2

Open output connect (engine icon on the NppFTP) to see why you dont connect.

Probably the problem could be the authentication method you use. Try "keyboard interactive authentication" on the tab Authentication.

Jules
  • 14,200
  • 13
  • 56
  • 101
0

I was able to correct this error by extending the Timeout for the connection.

Profile settings > Profile > Connection > Timeout (seconds)
YoungHobbit
  • 13,254
  • 9
  • 50
  • 73
0

I had the same error message, the solution was :

  • go to Profile settings / Athentication / Try Keyboard Interactive auth ...

It worked.

0

In my case I had problems with NppFTP and instead with FileZilla it was fine. Finally I solved it by lowering the version of NppFTP with version 0.29.10 it was wrong (problems) and with version 0.27.5 it was fine.

0

Use these setting if you already have a valid and working SSH connection with your server but you are not able to connect via Nppftp. Basically what you need to do is convert your privateKey to an OpenSSHprivate key , do it following these steps

Open your OriginalvalidprivateKey.ppk file in puttyGen using these menu option

  1. Conversions->import Key
  2. enter your passphrase of validprivateKey.ppk
  3. Conversions -> Export OpenSSh Key
  4. save it with another name of your imported key for example opensshvalidprivateKey.ppk
  5. use this new key as your key in Notepad ++ Nppftp conf, use these settings at images attached at your nppFTP conf (if its not shown, is set as default) Nppftpkeyplacement my nppFTP settings Try again to connect and just enter now the keypassphrase used when you created the original.ppk file.

If working with GCP you should have added your publickey to your instance or

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 17 '22 at 01:41
  • What is unclear ? First you need to have a valid SSH key, for it you have to use in windows Puttygen program. I explain it. Secondly i explain how to add it into Notepad ++ on its Nppftp plugin conf with screen captured set as link as for its my first post as i cannot post images directly.... – webmasternoob Oct 18 '22 at 07:33