issues with ssh access from macos/ linux

Showing results for 
Show  only  | Search instead for 
Did you mean: 

issues with ssh access from macos/ linux

L3 Networker

Hi folks I am having issues with access via ssh from macos/ linux pcs


pc ~ % ssh admin@                                                                                                                                         

Unable to negotiate with port 22: no matching host key type found. Their offer: ssh-rsa                                                                          

I can access it using this modified command:   

ssh -oHostKeyAlgorithms=+ssh-rsa admin@


I have added these options to ssh profile, restarted ssh server/ rebooted as well for testing, but still getting same results 


Unable to negotiate with port 22: no matching host key type found. Their offer: ssh-rs


Screenshot 2023-05-06 at 10.49.13 AM.png


Does anyone know what needs to be configured on the palo alto to resolve ssh compatibility issues?

thank you


Community Team Member

Hi @nevolex ,


Is this a VM-Series FW hosted in the public cloud? 

LIVEcommunity team member
Stay Secure,
Don't forget to Like items if a post is helpful to you!

Please help out other users and “Accept as Solution” if a post helps solve your problem !

Read more about how and why to accept solutions.

L1 Bithead

Did you select the SSH Service Profile you just made on Device\Setup\Management\SSH Management Profile Settings? And then restart the ssh server. (it will tell you to do so after commit)

I've just made the same setting for the same reason and missed this step. 

L4 Transporter


For a successful ssh connection at least one mutually-supported choice for each parameter, OpenSSH considers SSH-RSA as a weak algorithm and it has been deprecated since OpenSSH 8.8, it is still supported but disabled by default.
Can you try to connect to the FW by adding the following to your command line: -oHostKeyAlgorithms=+ssh-rsa  

ssh -oHostKeyAlgorithms=+ssh-rsa username@x.x.x.x

Network Security Engineer

L0 Member

This is a problem for us as well. Is there a way to have the PA appliance generate keys using SHA2+? I've tried setting the server profile to use ECDSA 256+ and the connection still fails,.. likely because the SSH server is still trying to present the RSA version... I would have expected this to use ECDSA only, and not try and present ssh-rsa keys to the client... eg.


debug2: reserved 0
debug1: kex: algorithm: ecdh-sha2-nistp384
debug1: kex: host key algorithm: (no match)
Unable to negotiate with <redacted> port 22: no matching host key type found. Their offer: ssh-rsa


ssh {
profiles {
mgmt-profiles {
server-profiles {
default_high_security {
ciphers [ aes256-cbc aes256-gcm aes256-ctr];
kex [ ecdh-sha2-nistp384 ecdh-sha2-nistp521];
mac [ hmac-sha2-256 hmac-sha2-512];
session-rekey {
data default;
interval default;
packets default;
default-hostkey {
key-type {
ECDSA 384;
regenerate-hostkeys {
mgmt {
key-type {
key-length 256;
mgmt {
server-profile default_high_security;
[edit deviceconfig system ssh]

This worked. Thank you!


Dave Gutierrez | PCNSE PCNSC | Sr. Professional Services Consultant
Palo Alto Networks®  |  3000 Tannery Way  | Santa Clara, CA. 95054  |  Mobile: +1-650-743-6232

L1 Bithead

This changed in PanOS 10.2 and higher, you can verify using "nmap --script ssh2-enum-algos -sV -p 22" you will find that:


PanOS 10.1 had

|   server_host_key_algorithms: (3)

|       ssh-rsa

|       rsa-sha2-512

|       rsa-sha2-256


But PanOS 10.2 only has

|   server_host_key_algorithms: (1)

|       ssh-rsa


you need to tell your ssh client to use the larger key size algorithm


The temporary fix is to use:
ssh -oHostKeyAlgorithms=+ssh-rsa admin@
While the permanent fix is to:
1) Create a Shell alias like this that modifies the command ssh and adds support for ssh-rsa host key algorithm evreytime you run ssh
alias ssh='ssh -oHostKeyAlgorithms=+ssh-rsa'
2) modify your SSH Config File (requires sudo) to add support for ssh-rsa host key algorithm 
sudo nano ~/.ssh/config
and then add the line
HostKeyAlgorithms +ssh-rsa



L1 Bithead

adjusting the HOSTKEY to ALL doesn't help, because ALL=ECDSA or RSA, but the only RSA Hostkey Algorithms in PanOS 10.2 and higher are RSA 2048, 3072, or 4096 (known as ssh-rsa) The only way to connect is to tell the SSH client to step up to rsa 2048 or more, or go with ECDSA.

  • 7 replies
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!