tencent cloud

DocumentationBastion Host

Linux Resource Login via Mac Prompting No Matching Host Key Type Found

Download
Focus Mode
Font Size
Last updated: 2025-04-18 11:17:41

Phenomenon Description

When you log in to a Linux server through a Mac system, the prompt "no matching host key type found" appears.


Possible Causes

Starting from OpenSSH 8.8, the default configuration no longer supports ssh-rsa.

Solutions

Modify the sshd file to add the algorithm.

Directions

1. Execute the following command on your local computer:
sudo vim /etc/ssh/ssh_config
2. Append the following lines at the end of the sshd file (ensure proper indentation):
HostKeyAlgorithms +ssh-rsa,ssh-dss
PubkeyAcceptedKeyTypes +ssh-rsa

3. Log in again to the Linux server.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback