[vertical/ESXi) Failed to create an SFTP client: Authentication failed

Since vertical forum is down for weeks as I have been trying (504 error), I’m opening this thread here.

Ref: https://forum.verticalbackup.com/t/failed-to-create-an-sftp-client-authentication-failed/306

From ESXi 6.7 I don’t seem to be able to enforce SSH key usage since it always asks for a passphrase of the key - and the key was indeed created w/o passphrase.

Screenshot of the original forum post so I don’t need to repeat it:

It opens for me just fine.

There is a response to that forum post:

How did you generate the ssh private key? The first line must be -----BEGIN RSA PRIVATE KEY----- or -----BEGIN DSA PRIVATE KEY----- .

Create an empty environment variable VB_SSH_KEY_PASS and it won’t ask you for the key passphrase:

export VB_SSH_KEY_PASS
1 Like

now the forum does work - probably Gilbert sorted it out after my post :wink:

regarding response there - yes I have seen it (via web archive cache) - but it doesn’t help in any way in my case (ESXi have this key auto generated with proper header indeed) - the thing is ssh with specified -i flag and RSA key works with that key. I suppose duplicacy/vertical do not have some other underlying SSH layer.

1 Like

Thank you Gilbert - will try that after my manual backup is done. :pray:

Sadly it doesn’t seem to work.

This is what I have in my passwords config:

.verticalbackup/passwords

{
"ssh_key":"/etc/ssh/ssh_host_rsa_key"
}

but still it asks me about the key location and then passphrase.

  1. (leave blank to choose public key authentication):
  2. Enter the passphrase of the ssh private key file:

Apparently it doesn’t read from passwords file at all.

It does work flawlessly with SFTP password stored in .verticalbackup/passwords file, though.
It just doesn’t work with SSH key.

-vvv verbose debug shows this:

Vertical Backup 1.4.6
vm names: [], show all: False, show files: False
Attempting to read from environment variable VB_SSH_PASS
Attempting to read ssh_pass from file '/vmfs/volumes/xxxxxxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
esxi-nl@my.net's password (leave blank to choose public key authentication):

then when I hit enter:

Attempting to read from environment variable VB_SSH_KEY
Attempting to read ssh_key from file '/vmfs/volumes/xxxxxxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
Attempting to read from environment variable VB_SSH_KEY_PASS
Attempting to read ssh_key_pass from file '/vmfs/volumes/xxxxxxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
Failed to create an SFTP client: Authentication failed.

Apparently it will try to read ssh password first, and then it will ignore variables of both ssh key and passphrase set to an empty string. OR it could be bug where for some reason it always seeks for a ssh passphrase in the last step?

Forum is down again.

Can you put this in .verticalbackup/passwords:

{
"ssh_pass": "",
"ssh_key": "/etc/ssh/ssh_host_rsa_key",
"ssh_key_pass": ""
}

The forum is working for me, although it takes a long time to load the page. I need to look into it.

1 Like
Vertical Backup 1.4.6
host id: myBackup, storage url: sftp://esxi-x@xxxxxxxxxxxxxx:9211/path, tag: None, threads: 1, limit rate: 0, quiesce: True
Licensed to xxxxxxx expires on 2025-05-14
Attempting to read from environment variable VB_SSH_PASS
Attempting to read ssh_pass from file '/vmfs/volumes/xxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
Attempting to read from environment variable VB_SSH_KEY
Attempting to read ssh_key from file '/vmfs/volumes/xxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
Attempting to read from environment variable VB_SSH_KEY_PASS
Attempting to read ssh_key_pass from file '/vmfs/volumes/xxxxxxxx/_scripts/vertical/.verticalbackup/passwords'
Failed to create an SFTP client: Authentication failed.

The best way to debug this is to start the ssh server on the server in the debug mode:

sshd -d -p 222

Then change the storage url to connect to this sshd instance. You’ll need to specify the port in the form of sftp://username@server[:port]/path/to/storage.