Skip to content

Commit

Permalink
F 修复ssh兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Apr 20, 2022
1 parent 4f1e153 commit 0373bae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spug_api/libs/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
# Released under the AGPL-3.0 License.
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko.rsakey import RSAKey
from paramiko.transport import Transport
from paramiko.ssh_exception import AuthenticationException
from io import StringIO
from uuid import uuid4
import time
import re

Transport._preferred_pubkeys = (
"ssh-ed25519",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
"ssh-rsa",
"rsa-sha2-256",
"rsa-sha2-512",
"ssh-dss",
)


class SSH:
def __init__(self, hostname, port=22, username='root', pkey=None, password=None, default_env=None,
Expand Down

0 comments on commit 0373bae

Please sign in to comment.