1 from socket import socket
2 from typing import Iterable, Mapping, NoReturn, Type
4 from paramiko.channel import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile
5 from paramiko.hostkeys import HostKeys
6 from paramiko.pkey import PKey
7 from paramiko.sftp_client import SFTPClient
8 from paramiko.transport import Transport
9 from paramiko.util import ClosingContextManager
11 class SSHClient(ClosingContextManager):
12 def __init__(self) -> None: ...
13 def load_system_host_keys(self, filename: str | None = ...) -> None: ...
14 def load_host_keys(self, filename: str) -> None: ...
15 def save_host_keys(self, filename: str) -> None: ...
16 def get_host_keys(self) -> HostKeys: ...
17 def set_log_channel(self, name: str) -> None: ...
18 def set_missing_host_key_policy(self, policy: Type[MissingHostKeyPolicy] | MissingHostKeyPolicy) -> None: ...
23 username: str | None = ...,
24 password: str | None = ...,
25 pkey: PKey | None = ...,
26 key_filename: str | None = ...,
27 timeout: float | None = ...,
28 allow_agent: bool = ...,
29 look_for_keys: bool = ...,
31 sock: socket | None = ...,
34 gss_deleg_creds: bool = ...,
35 gss_host: str | None = ...,
36 banner_timeout: float | None = ...,
37 auth_timeout: float | None = ...,
38 gss_trust_dns: bool = ...,
39 passphrase: str | None = ...,
40 disabled_algorithms: dict[str, Iterable[str]] | None = ...,
42 def close(self) -> None: ...
47 timeout: float | None = ...,
49 environment: dict[str, str] | None = ...,
50 ) -> tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ...
56 width_pixels: int = ...,
57 height_pixels: int = ...,
58 environment: Mapping[str, str] | None = ...,
60 def open_sftp(self) -> SFTPClient: ...
61 def get_transport(self) -> Transport | None: ...
63 class MissingHostKeyPolicy:
64 def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ...
66 class AutoAddPolicy(MissingHostKeyPolicy):
67 def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ...
69 class RejectPolicy(MissingHostKeyPolicy):
70 def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> NoReturn: ...
72 class WarningPolicy(MissingHostKeyPolicy):
73 def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ...