1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21 """
22 Exception raised by failures in SSH2 protocol negotiation or logic errors.
23 """
24 pass
25
26
28 """
29 Exception raised when authentication failed for some reason. It may be
30 possible to retry with different credentials. (Other classes specify more
31 specific reasons.)
32
33 .. versionadded:: 1.6
34 """
35 pass
36
37
39 """
40 Exception raised when a password is needed to unlock a private key file.
41 """
42 pass
43
44
46 """
47 Exception raised when an authentication type (like password) is used, but
48 the server isn't allowing that type. (It may only allow public-key, for
49 example.)
50
51 :ivar list allowed_types:
52 list of allowed authentication types provided by the server (possible
53 values are: ``"none"``, ``"password"``, and ``"publickey"``).
54
55 .. versionadded:: 1.1
56 """
57 allowed_types = []
58
64
67
68
70 """
71 An internal exception thrown in the case of partial authentication.
72 """
73 allowed_types = []
74
80
81
83 """
84 Exception raised when an attempt to open a new `.Channel` fails.
85
86 :ivar int code: the error code returned by the server
87
88 .. versionadded:: 1.6
89 """
95
96
98 """
99 The host key given by the SSH server did not match what we were expecting.
100
101 :ivar str hostname: the hostname of the SSH server
102 :ivar PKey got_key: the host key presented by the server
103 :ivar PKey expected_key: the host key expected
104
105 .. versionadded:: 1.6
106 """
107 - def __init__(self, hostname, got_key, expected_key):
108 SSHException.__init__(self, 'Host key for server %s does not match!' % hostname)
109 self.hostname = hostname
110 self.key = got_key
111 self.expected_key = expected_key
112
113 self.args = (hostname, got_key, expected_key, )
114
115
117 """
118 The "ProxyCommand" found in the .ssh/config file returned an error.
119
120 :ivar str command: The command line that is generating this exception.
121 :ivar str error: The error captured from the proxy command output.
122 """
124 SSHException.__init__(self,
125 '"ProxyCommand (%s)" returned non-zero exit status: %s' % (
126 command, error
127 )
128 )
129 self.error = error
130
131 self.args = (command, error, )
132