Author Topic: SFTP connection without SSH key password fails  (Read 1734 times)

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
SFTP connection without SSH key password fails
« on: September 01, 2025, 17:01:51 »
Hello.

I am trying to setup a SFTP connection with a public/private keypair that does *not* use a key password. Unfortunately MC insists on asking me for a password and then claims that the empty password failed.

Quote
Ask for password for keyfile failed - Aborting...
« Last Edit: September 01, 2025, 17:03:33 by Timur Born »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4736
    • View Profile
    • Multi Commander
Re: SFTP connection without SSH key password fails
« Reply #1 on: September 01, 2025, 17:56:35 »
Not sure that can be changed.  MC is using 3rd party library for the SSH. So MC do not have full control over everything

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: SFTP connection without SSH key password fails
« Reply #2 on: September 01, 2025, 21:39:01 »
Thanks for the quick answer. Problem is that I cannot just easily change the private key to include a password for my Oracle VM. WinSCP, Double Commander and Total Commander all work without a password for the private key (just left empty). When the password is left empty in MC then it popups up a pw dialog instead and leaving that empty produces the error I quoted.

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: SFTP connection without SSH key password fails
« Reply #3 on: September 01, 2025, 22:08:57 »
I added a password to the private key file via:

Code: [Select]
ssh-keygen -p -f
But that leads to the following error:

> Failed to authenticate using keyfile : -19

Then I deleted the PW again via the same ssh-keygen command and now MC accepts the empty PW (no popup appears), but this still ends in the same failed authenticate error message.

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: SFTP connection without SSH key password fails
« Reply #4 on: September 01, 2025, 22:12:59 »
I also tried MuCommander and that worked, too.

The failed password message seems to always happen when MC opens the PW popup, regardless of whether the key file's PW is empty or not.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4736
    • View Profile
    • Multi Commander
Re: SFTP connection without SSH key password fails
« Reply #5 on: September 01, 2025, 22:15:32 »
It should send a blank pw to SSH if you just press ok in password dialog. You sure there is not any other error.. Any error in the Log ?
Sure you press OK in the password dialog. the error "Ask for password for keyfile failed - Aborting..." is only outputted to the log if the Ask Password dialog is cancelled

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4736
    • View Profile
    • Multi Commander
Re: SFTP connection without SSH key password fails
« Reply #6 on: September 01, 2025, 22:19:26 »
I added a password to the private key file via:

Code: [Select]
ssh-keygen -p -f
But that leads to the following error:

> Failed to authenticate using keyfile : -19

Then I deleted the PW again via the same ssh-keygen command and now MC accepts the empty PW (no popup appears), but this still ends in the same failed authenticate error message.

-19 = ERROR_PUBLICKEY_UNVERIFIED - The username/public key combination was invalid.

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: SFTP connection without SSH key password fails
« Reply #7 on: September 01, 2025, 22:39:44 »
It's the same public key file and username I successfully used Double Commander. Both WinSCP and MuCommander don't ask for a public keyfile, just the private one and both work with that.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4736
    • View Profile
    • Multi Commander
Re: SFTP connection without SSH key password fails
« Reply #8 on: September 02, 2025, 08:21:06 »
I dont know what 3rd party ssh library they are using..

But sure you press OK in the ask password  dialog. because "Ask for password for keyfile failed - Aborting..." should only be outputted when canceling it.
I can't really test my self at the moment since I do not have access to any key login.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4736
    • View Profile
    • Multi Commander
Re: SFTP connection without SSH key password fails
« Reply #9 on: September 02, 2025, 09:44:07 »
I was able to test this.. I do not get a password dialog when having a keyfile that is not protected with password

Timur Born

  • Junior Member
  • **
  • Posts: 16
    • View Profile
Re: SFTP connection without SSH key password fails
« Reply #10 on: Yesterday at 00:49:54 »
The password dialog only happens when I use the .ppk format private keyfile. When I use the OpenSSH keyfile then no password dialog appears (I think after setting and then deleting the PW again), but instead I get the "Failed to authenticate using keyfile : -19" error instead.
« Last Edit: Yesterday at 11:09:07 by Timur Born »