The error "An error occurred on the remote host and the connection was closed. Please try again." is displayed when logging in via ssh web proxy to a linux device

1. After analyzing the syslog the following message was displayed: ssh handshake failed.
2. To fix, edit the file /etc/ssh/sshd_config on the device in question and add the following lines:

HostKeyAlgorithms=ssh-rsa,[email protected] 
PubkeyAcceptedAlgorithms=+ssh-rsa,[email protected]

3. Restart ssh services and try logging in again.

systemctl restart ssh
service ssh restart

Remark: Validate in your terminal if it will be ssh or sshd.

systemctl restart sshd
service sshd restart
2 Likes