Problem Description
When using FileZilla's SFTP feature to connect to a host via SSH, you may encounter the following error:
Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)
This indicates a mismatch between the authentication methods attempted by the client (FileZilla) and those supported by the server (SSH service). The server only supports public key, GSSAPI key exchange, and GSSAPI with MIC authentication, while the client may not have provided a valid public key or attempted unsupported password authentication.
Solution
This issue is typically caused by the SSH server configuration disabling password authentication (PasswordAuthentication). The solution is to enable password authentication by modifying the SSH server configuration file and then restarting the SSH service.
Step 1: Edit the SSH Configuration File
Open the SSH server configuration file with a text editor (like vi or nano) using root privileges. The file is usually located at:
/etc/ssh/sshd_config
Find the line related to password authentication. It may appear as:
#PasswordAuthentication yes
or
PasswordAuthentication no
You need to ensure this line is set to:
PasswordAuthentication yes
If the line is commented out (starting with #), remove the # symbol. If its value is 'no', change it to 'yes'.
Step 2: Restart the SSH Service
After saving the configuration file, restart the SSH service for the changes to take effect. Depending on your system, use one of the following commands:
- For systems using systemd (e.g., CentOS 7+, Ubuntu 16.04+):
systemctl restart sshd
- For systems using SysV init (e.g., CentOS 6):
service sshd restart
Or, for some older systems:
/etc/init.d/sshd restart
Step 3: Test the Connection
After completing the steps above, try connecting again with FileZilla via SFTP. You should now be able to authenticate using your password.
Additional Notes and Security Recommendations
While enabling password authentication solves the connection problem, using public key authentication is a more secure practice. For better security, consider:
- Generate an SSH key pair for your user.
- Upload the public key to the server's
~/.ssh/authorized_keysfile. - In FileZilla's Site Manager settings, specify the path to your private key for authentication.
- Once public key authentication is confirmed working, you can set
PasswordAuthenticationback tonoto disable password login and improve server security.
If the problem persists after making these changes, check your server's firewall or security group rules to ensure SSH connections (default port 22) are allowed.