Skip to content

Commit

Permalink
fix ssh issue on old distro
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Jan 12, 2024
1 parent 6a7f998 commit 3e1ec50
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lisa/util/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ def try_connect(
# So try with paramiko firstly.
paramiko_client = paramiko.SSHClient()

# Put ssh-rsa in the first element of preferred public keys
# to resolve ssh issues on old distros.
paramiko.Transport.preferred_pubkeys = ( # type: ignore
"ssh-rsa",
"ssh-ed25519",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
"rsa-sha2-512",
"rsa-sha2-256",
"ssh-dss",
)

# Use base policy, do nothing on host key. The host key shouldn't be saved
# locally, or make any warning message. The IP addresses in cloud may be
# reused by different servers. If they are saved, there will be conflict
Expand Down

0 comments on commit 3e1ec50

Please sign in to comment.