Start a conversation

Resolving "SFTP Error: No Hostkey Alg" in Engine Yard

Overview

The error "SFTP error: no hostkey alg" occurs when attempting to connect via SFTP from your instance. This indicates a mismatch between the SSH protocols supported by your client and the server. The issue may arise due to outdated OpenSSH versions or unsupported host key algorithms. Solutions include updating OpenSSH, specifying host key algorithms in the SSH configuration, or using an alternative SSH client like PuTTY.

Information

Error Message: "SFTP error: no hostkey alg"

Cause: This error occurs when the SSH client does not support the host key algorithms required by the remote SFTP server. It may be due to an outdated OpenSSH version or unsupported key types.

Resolution Steps:

  1. Update OpenSSH:
    • For Gentoo-based instances, run:
      sudo echo =net-misc/openssh-5.9_p1-r1 >> /etc/portage/package.keywords/local
      sudo emerge -av =net-misc/openssh-5.9_p1-r1
      sudo /etc/init.d/ssh restart
    • Retry the SFTP connection.
  2. Specify Host Key Algorithms:
    • Modify your SSH configuration file (`~/.ssh/config`) to include:
      Host <sftp_server>
          HostKeyAlgorithms +ssh-rsa
          PubkeyAcceptedKeyTypes +ssh-rsa
          IdentityFile /home/deploy/.ssh/id_rsa
          User <username>
    • Alternatively, use the command line:
      sftp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=+ssh-rsa -i /home/deploy/.ssh/id_rsa <username>@<sftp_server>
  3. Use an Alternative SSH Client:
    • Try using PuTTY or another GUI SSH client to determine if the issue is client-side.
    • Convert your key using PuTTYgen if necessary.

Verification:

  • Ensure the SFTP connection is successful without errors.
  • If issues persist, verify the SSH configuration and permissions, and consider using alternative clients or configurations.

Frequently Asked Questions

How do I know if this error applies to my situation?
You'll see the error message "SFTP error: no hostkey alg" when attempting to connect via SFTP from your instance.
What if updating OpenSSH doesn't resolve the issue?
Ensure your SSH key is compatible and consider specifying host key algorithms in your SSH configuration. If issues persist, try using an alternative SSH client like PuTTY.
How can I use PuTTY to connect?
Download PuTTY and convert your SSH key using PuTTYgen. Follow the instructions in our article Connect to Your Instance Using SSH for detailed steps.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments