-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] SSH Connection: fixed OpenWrt <= 19 authentication failure #643
Paramiko versions > 2.8 try to use sha2 as a default HostKeyAlgorithms if the target SSH server doesn't advertise the preferred HostKeyAlgorithms, which is the case for OpenWrt <= 19. This causes SSH connections to fail with: "Pubkey auth attempt with unknown algo", because dropbear on OpenWrt <= 19 doesn't support sha2. The fix suggested by Paramiko is to disable the sha2 HostKeyAlgorithms, which is not great for systems where newer versions of OpenWrt and dropbear are in use, for this reason, this patch disables the sha2 HostKeyAlgorithms only if a first SSH connection attempt fails by raising the exception paramiko.ssh_exception.AuthenticationException. As a bonus fix, I found out that it's better to explicitly close the SSH connection when the authentication fails, otherwise a lingering SSH connection can stay open for a while. Closes #643
- Loading branch information
1 parent
c822493
commit 062800f
Showing
2 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters