Page 1 of 1

SFTP prompting for key password

Posted: 2019-06-26 18:19
by SCB-jcole
I recently added a public key for an SFTP server (call it SFTP 1 for simplicity) that I am connecting to that requires a password. I also have another SFTP (SFTP 2) server that I connect to that does not use a key at all. Whenever I try to connect to SFTP 2 since adding the key it prompts me to enter a password for the public key, which has no relation to SFTP 2. If I enter the correct password, it tells gives me an authentication failure, if I close the window it aborts the connection. I can work around it by removing the key when I need to connect to SFTP 2 and re-adding it when I connect to SFTP 1, but this would be a daily process. I have logs and can provide debug lines if needed.

Re: SFTP prompting for key password

Posted: 2019-06-26 18:54
by botg
Here's what happens with your server:

1. FileZilla connects to the SFTP server
2. Client and server agree on various parameters, including the challenge that is used for public key authentication
3. FileZilla reads the unprotected (because public) public key from the key file.
4. FileZilla asks the server: Hey, can I sign the challenge we authenticate with this key please?
5. The server agrees to use this key for authentication
6. Now FileZilla prompts you for the password to the key file so that it can use the private key to sign the challenge
7. FileZilla sends the signature to the server
8. The server rejects the signature because it does not know the public key
9. FileZilla tries again with the next key or if there is none, the next authentication mechanism

The question is, why does the server agree to use authentication with a particular key when it doesn't actually allow authentication with that key?

Re: SFTP prompting for key password

Posted: 2019-06-26 18:56
by SCB-jcole
I did forget to mention that another user with the same setup (we have verified all settings are the same and that he is connecting to the same servers), does not encounter this issue.

Re: SFTP prompting for key password

Posted: 2019-06-27 06:48
by botg
There must be some material difference in the configuration, either client-side or server-side.

Re: SFTP prompting for key password

Posted: 2020-08-20 16:35
by flexer225
Hello

Old thread but I am havign the exact same issue
1) Setup a key for an SSH account access
2) Setup a completely different accout that does not require a key = get prompted for the key from 1) No passwords work

Any ideas?