FileZilla SFTP Connection Error

Created on: 2 September 2021

FileZilla shows a message: Error: Pageant failed to answer challenge when trying to connect to a server using SFTP. This FileZilla SFTP connection error prevents connecting to a remote server using the FileZilla application. SSH from the command line also fails.

Attempting to SSH from the command line gives the following error: sign_and_send_pubkey: signing failed: agent refused operation

Error: Pageant failed to answer challenge Message in FileZilla

The image below shows the two messages that appear in FileZilla when trying to SFTP into a remote server.

Error: Pageant failed to answer challenge Message in FileZilla
FileZilla SFTP Connection Error Messages

As can be seen in the image, two messages that appear are:
Error: Pageant failed to answer challenge
Error: Could not connect to server

SSH Setup

SSH was set up in FileZilla using the following tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps

After changing Linux distribution versions (on the client side, not the server), FileZilla would no longer connect, but displayed the error messages instead. Further to this it was not possible to SSH into the server from the command line using the SSH key. Attempting to SSH from the command line gave the following error: sign_and_send_pubkey: signing failed: agent refused operation

How the FileZilla SFTP Connection Error Occurred

The following paragraphs describes how the problem happened to me.

After moving from Linux Mint 18.3 to Linux Mint 19.1, this error occurred when trying to SFTP into a remote server. It also happens on newer versions of Ubuntu, but not on the latest Linux Mint Debian.

Using the same login credentials and SSH key on any new Ubuntu based Linux distribution caused the login error. After switching back to Linux Mint 18.3, the problem disappears.

Solution to FileZilla SFTP Error

In my case, the solution was very simple. It was just a matter of changing file permissions of the key file found in ~/.ssh/ as follows:

chmod 600 ~/.ssh/id_rsa

This solution is from the following web page, but was not the answer that was accepted on the page. Look under “Simple Solution” further down the page.

https://askubuntu.com/questions/762541/ubuntu-16-04-ssh-sign-and-send-pubkey-signing-failed-agent-refused-operation

If the following command is entered in the terminal window before changing the file permissions:

ssh-add

The following message is displayed that describes why this problem is occurring:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/home/user/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

Changing the file permission as described above solved the problem in FileZilla and for using SSH from a terminal window.