F 修复ssh兼容性问题

pull/480/head
vapao 2022-04-20 11:41:57 +08:00
parent 4f1e153c6b
commit 0373baef42
1 changed files with 12 additions and 0 deletions

View File

@ -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,