1643
(also1925
,1644
,1326
) Add support for SHA-2 variants of RSA key verification algorithms (as described in8332
) as well as limited SSH extension negotiation (8308
). How SSH servers/clients decide when and how to use this functionality can be complicated; Paramiko's support is as follows:Client verification of server host key during key exchange will now prefer
rsa-sha2-512
,rsa-sha2-256
, and legacyssh-rsa
algorithms, in that order, instead of justssh-rsa
.- Note that the preference order of other algorithm families such as
ed25519
andecdsa
has not changed; for example, those two groups are still preferred over RSA.
- Note that the preference order of other algorithm families such as
- Server mode will now offer all 3 RSA algorithms for host key verification during key exchange, similar to client mode, if it has been configured with an RSA host key.
- Client mode key exchange now sends the
ext-info-c
flag signaling support forMSG_EXT_INFO
, and support for parsing the latter (specifically, itsserver-sig-algs
flag) has been added. - Client mode, when performing public key authentication with an RSA key or cert, will act as follows:
- In all cases, the list of algorithms to consider is based on the new
preferred_pubkeys
list (see below) anddisabled_algorithms
; this list, like with host keys, prefers SHA2-512, SHA2-256 and SHA1, in that order. - When the server does not send
server-sig-algs
, Paramiko will attempt the first algorithm in the above list. Clients connecting to legacy servers should thus usedisabled_algorithms
to turn off SHA2. - When the server does send
server-sig-algs
, the first algorithm supported by both ends is used, or if there is none, it falls back to the previous behavior.
- In all cases, the list of algorithms to consider is based on the new
- SSH agent support grew the ability to specify algorithm flags when requesting private key signatures; this is now used to forward SHA2 algorithms when appropriate.
- Server mode is now capable of pubkey auth involving SHA-2 signatures from clients, provided one's server implementation actually provides for doing so.
- This includes basic support for sending
MSG_EXT_INFO
(containingserver-sig-algs
only) to clients advertisingext-info-c
in their key exchange list.
- This includes basic support for sending
In order to implement the above, the following API additions were made:
- `PKey.sign_ssh_data <paramiko.pkey.PKey>: Grew an extra, optional algorithm keyword argument (defaulting to None for most subclasses, and to "ssh-rsa" for ~paramiko.rsakey.RSAKey`).
A new ~paramiko.ssh_exception.SSHException subclass was added, ~paramiko.ssh_exception.IncompatiblePeer, and is raised in all spots where key exchange aborts due to algorithmic incompatibility.
- Like all other exceptions in that module, it inherits from
SSHException
, and as we did not change anything else about the raising (i.e. the attributes and message text are the same) this change is backwards compatible.- ~paramiko.transport.Transport grew a
_preferred_pubkeys
attribute and matchingpreferred_pubkeys
property to match the other, kex-focused, such members. This allows client pubkey authentication to honor thedisabled_algorithms
feature.
Thanks to Krisztián Kovács for the report and an early stab at a patch, as well as the numerous users who submitted feedback on the issue, including but not limited to: Christopher Rabotin, Sam Bull, and Manfred Kaiser.
2.8.1 <2021-11-28>
985
(via992
) Fix listdir failure when server uses a locale. Now on Python 2.7 SFTPAttributes <paramiko.sftp_attr.SFTPAttributes> will decode abbreviated month names correctly rather than raiseUnicodeDecodeError
`. Patch courtesy of Martin Packman.1024
Deleting items from ~paramiko.hostkeys.HostKeys would incorrectly raise KeyError even for valid keys, due to a logic bug. This has been fixed. Report & patch credit: Jia Zhang.1257
(also1266
) Update RSA and ECDSA key decoding subroutines to correctly catch exception types thrown by modern versions of Cryptography (specificallyTypeError
and its internalUnsupportedAlgorithm
). These exception classes will now become ~paramiko.ssh_exception.SSHException instances instead of bubbling up. Thanks to Ignat Semenov for the report and@tylergarcianet
for an early patch.-
(also908
) Update ~paramiko.pkey.PKey and subclasses to compare (__eq__
) via direct field/attribute comparison instead of hashing (while retaining the existing behavior of__hash__
via a slight refactor). Big thanks to Josh Snyder and Jun Omae for the reports, and to Josh Snyder for reproduction details & patch.Warning
This fixes a security flaw! If you are running Paramiko on 32-bit systems with low entropy (such as any 32-bit Python 2, or a 32-bit Python 3 which is running with
PYTHONHASHSEED=0
) it is possible for an attacker to craft a new keypair from an exfiltrated public key, which Paramiko would consider equal to the original key.This could enable attacks such as, but not limited to, the following:
- Paramiko server processes would incorrectly authenticate the attacker (using their generated private key) as if they were the victim. We see this as the most plausible attack using this flaw.
- Paramiko client processes would incorrectly validate a connected server (when host key verification is enabled) while subjected to a man-in-the-middle attack. This impacts more users than the server-side version, but also carries higher requirements for the attacker, namely successful DNS poisoning or other MITM techniques.
2.8.0 <2021-10-09>
-
Administrivia overhaul, including but not limited to:- Migrate CI to CircleCI
- Primary dev branch is now
main
(renamed) - Many README edits for clarity, modernization etc; including a bunch more (and consistent) status badges & unification with main project site index
- PyPI page much more fleshed out (long_description is now filled in with the README; sidebar links expanded; etc)
- flake8, pytest configs split out of setup.cfg into their own files
- Invoke/invocations (used by maintainers/contributors) upgraded to modern versions
1462 major
(via1882
) Newer server-side key exchange algorithms not intended to use SHA1 (diffie-hellman-group14-sha256
,diffie-hellman-group16-sha512
) were incorrectly using SHA1 after all, due to a bug causing them to ignore thehash_algo
class attribute. This has been corrected. Big thanks to@miverson
for the report and to Benno Rice for the patch.1846
Add aprefetch
keyword argument to SFTPClient.get <paramiko.sftp_client.SFTPClient.get>/SFTPClient.getfo <paramiko.sftp_client.SFTPClient.getfo> so users who need to skip SFTP prefetching are able to conditionally turn it off. Thanks to Github user@h3ll0r
for the PR.2.7.2 <2020-08-30>
- backported
Update our CI to catch issues with sdist generation, installation and testing.1727 backported
Add missing test suite fixtures directory to MANIFEST.in, reinstating the ability to run Paramiko's tests from an sdist tarball. Thanks to Sandro Tosi for reporting the issue and to Blazej Michalik for the PR.1722 backported
Remove leading whitespace from OpenSSH RSA test suite static key fixture, to conform better to spec. Credit: Alex Gaynor.-
Fix incorrect string formatting causing unhelpful error message annotation when using Kerberos/GSSAPI. (Thanks, newer version of flake8!)1723
Fix incorrectly swapped order ofp
andq
numbers when loading OpenSSH-format RSA private keys. At minimum this should address a slowdown when using such keys, and it also means Paramiko works with Cryptography 3.1 and above (which complains strenuously when this problem appears). Thanks to Alex Gaynor for the patch.2.7.1 <2019-12-09>
1567
The new-style private key format (added in 2.7) suffered from an unpadding bug which had been fixed earlier for Ed25519 (as that key type has always used the newer format). That fix has been refactored and applied to the base key class, courtesy of Pierce Lopez.1565
(via1566
) Fix a bug in support for ECDSA keys under the newly supported OpenSSH key format. Thanks to Pierce Lopez for the patch.2.7.0 <2019-12-03>
602
(via1343
,1313
,618
) Implement support for OpenSSH 6.5-style private key files (typically denoted as havingBEGIN OPENSSH PRIVATE KEY
headers instead of PEM format'sBEGIN RSA PRIVATE KEY
or similar). If you were getting any sort of weird auth error from "modern" keys generated on newer operating system releases (such as macOS Mojave), this is the first update to try.Major thanks to everyone who contributed or tested versions of the patch, including but not limited to: Kevin Abel, Michiel Tiller, Pierce Lopez, and Jared Hobbs.
- major
ssh_config
token expansion <TOKENS>
used a different method of determining the local username ($USER
env var), compared to what the (much older) client connection code does (getpass.getuser
, which includes$USER
but may check other variables first, and is generally much more comprehensive). Both modules now usegetpass.getuser
.-
A couple of outright ~paramiko.config.SSHConfig parse errors were previously represented as vanillaException
instances; as part of recent feature work a more specific exception class, ~paramiko.ssh_exception.ConfigParseError, has been created. It is now also used in those older spots, which is naturally backwards compatible.717
Implement support for theMatch
keyword inssh_config
files. Previously, this keyword was simply ignored & keywords inside such blocks were treated as if they were part of the previous block. Thanks to Michael Leinartas for the initial patchset.Note
This feature adds a new
optional install dependency </installing>
, Invoke, for managingMatch exec
subprocesses.-
Additionalinstallation </installing>
extras_require
"flavors" (ed25519
,invoke
, andall
) have been added to our packaging metadata; see the install docs for details.- major
Paramiko's use ofsubprocess
forProxyCommand
support is conditionally imported to prevent issues on limited interpreter platforms like Google Compute Engine. However, any resultingImportError
was lost instead of preserved for raising (in the rare cases where a user tried leveragingProxyCommand
in such an environment). This has been fixed.- major
Perform deduplication ofIdentityFile
contents duringssh_config
parsing; previously, if your config would result in the same value being encountered more than once,IdentityFile
would contain that many copies of the same string.897
Implement most 'canonical hostname'ssh_config
functionality (CanonicalizeHostname
,CanonicalDomains
,CanonicalizeFallbackLocal
, andCanonicalizeMaxDots
;CanonicalizePermittedCNAMEs
has not yet been implemented). All were previously silently ignored. Reported by Michael Leinartas.-
Explicitly documentwhich ssh_config features we currently support <ssh-config-support>
. Previously users just had to guess, which is simply no good.-
Add new convenience classmethod constructors to `~paramiko.config.SSHConfig`: ~paramiko.config.SSHConfig.from_text, ~paramiko.config.SSHConfig.from_file, and ~paramiko.config.SSHConfig.from_path. No more annoying two-step process!2.6.0 <2019-06-23>
1463
Add a new keyword argument to SSHClient.connect <paramiko.client.SSHClient.connect> and ~paramiko.transport.Transport,disabled_algorithms
, which allows selectively disabling one or more kex/key/cipher/etc algorithms. This can be useful when disabling algorithms your target server (or client) does not support cleanly, or to work around unpatched bugs in Paramiko's own implementation thereof.2.5.1 <2019-06-23>
2.4.3 <2019-06-23>
1306
(via1400
) Fix Ed25519 key handling so certain key comment lengths don't causeSSHException("Invalid key")
(this was technically a bug in how padding, or lack thereof, is calculated/interpreted). Thanks to@parke
for the bug report & Pierce Lopez for the patch.1440
(with initial fixes via1460
) Tweak many exception classes so their string representations are more human-friendly; this also includes incidental changes to somesuper()
calls.The definitions of exceptions'
__init__
methods have not changed, nor have any log messages been altered, so this should be backwards compatible for everything except the actual exceptions'__str__()
outputs.Thanks to Fabian Büchler for original report & Pierce Lopez for the foundational patch.
1311
(for584
, replacing1166
) Add backwards-compatible support for thegssapi
GSSAPI library, as the previous backend (python-gssapi
) has since become defunct. This change also includes tests for the GSSAPI functionality.Big thanks to Anselm Kruis for the patch and to Sebastian Deiß (author of our initial GSSAPI functionality) for review.
Note
This feature also adds
setup.py
'extras' support for installing Paramiko asparamiko[gssapi]
, which pulls in the optional dependencies you had to get by hand previously.Note
To be very clear, this patch does not remove support for the older
python-gssapi
library. We may remove that support in a later release, but for now, either library will work. Please upgrade togssapi
when you can, however, aspython-gssapi
is no longer maintained upstream.322 major
SSHClient.exec_command <paramiko.client.SSHClient.exec_command> previously returned a naive ~paramiko.channel.ChannelFile object for itsstdin
value; such objects don't know to properly shut down the remote end's stdin when they.close()
. This lead to issues (such as hangs) when running remote commands that read from stdin.A new subclass, ~paramiko.channel.ChannelStdinFile, has been created which closes remote stdin when it itself is closed. ~paramiko.client.SSHClient.exec_command has been updated to use that class for its
stdin
return value.Thanks to Brandon Rhodes for the report & steps to reproduce.
2.5.0 <2019-06-09>
1233
(also1229
,1332
) Add support for encrypt-then-MAC (ETM) schemes (hmac-sha2-256-etm@openssh.com
,hmac-sha2-512-etm@openssh.com
) and two newer Diffie-Hellman group key exchange algorithms (group14
, using SHA256; andgroup16
, using SHA512). Patch courtesy of Edgar Sousa.532
(via1384
and1258
) Add support for Curve25519 key exchange (akacurve25519-sha256@libssh.org
). Thanks to Alex Gaynor and Dan Fuhry for supplying patches.1379
(also1369
) Raise Cryptography dependency requirement to version 2.5 (from 1.5) and update some deprecated uses of its API.This removes a bunch of warnings of the style
CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding
and similar, which users who had eventually upgraded to Cryptography 2.x would encounter.Warning
This change is backwards incompatible if you are unable to upgrade your version of Cryptography. Please see Cryptography's own changelog for details on what may change when you upgrade; for the most part the only changes involved dropping older Python versions (such as 2.6, 3.3, or some PyPy editions) which Paramiko itself has already dropped.
1378 backported
Add support for the modern (as of Python 3.3) import location ofMutableMapping
(used in host key management) to avoid the old location becoming deprecated in Python 3.8. Thanks to Josh Karpel for catch & patch.2.4.2 <2018-09-18>
2.3.3 <2018-09-18>
2.2.4 <2018-09-18>
2.1.6 <2018-09-18>
2.0.9 <2018-09-18>
-
Modify protocol message handling such thatTransport
does not respond toMSG_UNIMPLEMENTED
with its ownMSG_UNIMPLEMENTED
. This behavior probably didn't cause any outright errors, but it doesn't seem to conform to the RFCs and could cause (non-infinite) feedback loops in some scenarios (usually those involving Paramiko on both ends).1283
Fix exploit (CVE-2018-1000805) in Paramiko's server mode (not client mode) where hostile clients could trick the server into thinking they were authenticated without actually submitting valid authentication.Specifically, steps have been taken to start separating client and server related message types in the message handling tables within
Transport
andAuthHandler
; this work is not complete but enough has been performed to close off this particular exploit (which was the only obvious such exploit for this particular channel).Thanks to Daniel Hoffman for the detailed report.
1292 backported (<2.4)
Backport changes from979
(added in Paramiko 2.3) to Paramiko 2.0-2.2, using duck-typing to preserve backwards compatibility. This allows these older versions to use newer Cryptography sign/verify APIs when available, without requiring them (as is the case with Paramiko 2.3+).Practically speaking, this change prevents spamming of
CryptographyDeprecationWarning
notices which pop up in the above scenario (older Paramiko, newer Cryptography).Note
This is a no-op for Paramiko 2.3+, which have required newer Cryptography releases since they were released.
1291 backported (<2.4)
Backport pytest support and application of theblack
code formatter (both of which previously only existed in the 2.4 branch and above) to everything 2.0 and newer. This makes back/forward porting bugfixes significantly easier.1262 backported
Add*.pub
files to the MANIFEST so distributed source packages contain some necessary test assets. Credit: Alexander Kapshuna.1212
Updated SSHConfig.lookup <paramiko.config.SSHConfig.lookup> so it returns a new, type-casting-friendly dict subclass (~paramiko.config.SSHConfigDict) in lieu of dict literals. This ought to be backwards compatible, and allows an easier way to check boolean or int typessh_config
values. Thanks to Chris Rose for the patch.1191
Update our install docs with (somewhat) recently added additional dependencies; we previously only required Cryptography, but the docs never got updated after we incurredbcrypt
andpynacl
requirements for Ed25519 key support.Additionally,
pyasn1
was never actually hard-required; it was necessary during a development branch, and is used by the optional GSSAPI support, but is not required for regular installation. Thus, it has been removed from oursetup.py
and its imports in the GSSAPI code made optional.Credit to
@stevenwinfield
for highlighting the outdated install docs.2.4.1 <2018-03-12>
2.3.2 <2018-03-12>
2.2.3 <2018-03-12>
2.1.5 <2018-03-12>
2.0.8 <2018-03-12>
1.18.5 <2018-03-12>
1.17.6 <2018-03-12>
1175 (1.17+)
Fix a security flaw (CVE-2018-7750) in Paramiko's server mode (emphasis on server mode; this does not impact client use!) where authentication status was not checked before processing channel-open and other requests typically only sent after authenticating. Big thanks to Matthijs Kooijman for the report.1168
Add newer key classes for Ed25519 and ECDSA toparamiko.__all__
so that code introspecting that attribute, or usingfrom paramiko import *
(such as some IDEs) sees them. Thanks to@patriksevallius
for the patch.1039
Ed25519 auth key decryption raised an unexpected exception when given a unicode password string (typical in python 3). Report by Theodor van Nahl and fix by Pierce Lopez.2.4.0 <2017-11-14>
-
Add a newpassphrase
kwarg to SSHClient.connect <paramiko.client.SSHClient.connect> so users may disambiguate key-decryption passphrases from password-auth passwords. (This is a backwards compatible change;password
will still pull double duty as a passphrase whenpassphrase
is not given.)-
UpdatetearDown
of client test suite to avoid hangs due to eternally blockingaccept()
calls on the internal server thread (which can occur when test code raises an exception before actually connecting to the server.)1108 (1.17+)
Rename a private method keyword argument (which was namedasync
) so that we're compatible with the upcoming Python 3.7 release (whereasync
is a new keyword.) Thanks to@vEpiphyte
for the report.1100
Updated the test suite & related docs/metadata/config to be compatible with pytest instead of using the old, custom, crufty unittest-basedtest.py
.This includes marking known-slow tests (mostly the SFTP ones) so they can be filtered out by
inv test
's default behavior; as well as other minor tweaks to test collection and/or display (for example, GSSAPI tests are collected, but skipped, instead of not even being collected by default as intest.py
.)- backported
Include LICENSE file in wheel archives.1070
Drop Python 2.6 and Python 3.3 support; now only 2.7 and 3.4+ are supported. If you're unable to upgrade from 2.6 or 3.3, please stick to the Paramiko 2.3.x (or below) release lines.2.3.1 <2017-09-22>
1071
Certificate support broke the no-certificate case for Ed25519 keys (symptom is anAttributeError
aboutpublic_blob
.) This went uncaught due to cert autoload behavior (i.e. our test suite never actually ran the no-cert case, because the cert existed!) Both issues have been fixed. Thanks to John Hu for the report.2.3.0 <2017-09-18>
2.2.2 <2017-09-18>
2.1.4 <2017-09-18>
2.0.7 <2017-09-18>
1.18.4 <2017-09-18>
1065
Add rekeying support to GSSAPI connections, which was erroneously missing. Without this fix, any attempt to renegotiate the transport keys for agss-kex
-authed ~paramiko.transport.Transport would cause a MIC failure and terminate the connection. Thanks to Sebastian Deiß and Anselm Kruis for the patch.1063
Add agss_trust_dns
option toClient
andTransport
to allow explicitly setting whether or not DNS canonicalization should occur when using GSSAPI. Thanks to Richard E. Silverman for the report & Sebastian Deiß for initial patchset.1061
Clean up GSSAPI authentication procedures so they do not prevent normal fallback to other authentication methods on failure. (In other words, presence of GSSAPI functionality on a target server precluded use of _any other auth type if the user was unable to pass GSSAPI auth.) Patch via Anselm Kruis.1060
Fix key exchange (kex) algorithm list for GSSAPI authentication; previously, the list used solely out-of-date algorithms, and now contains newer ones listed preferentially before the old. Credit: Anselm Kruis.1055 (1.17+)
(also1056
,1057
,1058
,1059
) Fix up host-key checking in our GSSAPI support, which was previously using an incorrect API call. Thanks to Anselm Kruis for the patches.945 (1.18+)
(backport of910
and re:865
) SSHClient now requests the type of host key it has (e.g. from known_hosts) and does not consider a different type to be a "Missing" host key. This fixes a common case where an ECDSA key is in known_hosts and the server also has an RSA host key. Thanks to Pierce Lopez.979
Update how we use Cryptography's signature/verification methods so we aren't relying on a deprecated API. Thanks to Paul Kehrer for the patch.Warning
This bumps the minimum Cryptography version from 1.1 to 1.5. Such an upgrade should be backwards compatible and easy to do. See their changelog for additional details.
-
Ed25519 keys never got proper API documentation support; this has been fixed.1026
Update ~paramiko.ed25519key.Ed25519Key so its constructor offers the samefile_obj
parameter as its sibling key classes. Credit: Michal Kuffa.1013
Added pre-authentication banner support for the server interface (ServerInterface.get_banner <paramiko.server.ServerInterface.get_banner> plus related support inTransport/AuthHandler
.) Patch courtesy of Dennis Kaarsemaker.60 major
(via1037
) Paramiko originally defaulted to zlib compression level 9 (when one connects withcompression=True
; it defaults to off.) This has been found to be quite wasteful and tends to cause much longer transfers in most cases, than is necessary.OpenSSH defaults to compression level 6, which is a much more reasonable setting (nearly identical compression characteristics but noticeably, sometimes significantly, faster transmission); Paramiko now uses this value instead.
Thanks to Damien Dubé for the report and
@DrNeutron
for investigating & submitting the patch.-
Display exception type and message when logging auth-rejection messages (ones readingAuth rejected: unsupported or mangled public key
); previously this error case had a bare except and did not display exactly why the key failed. It will now append info such asKeyError: 'some-unknown-type-string'
or similar.1042
(also partially531
) Implement basic client-side certificate authentication (as per the OpenSSH vendor extension.)The core implementation is PKey.load_certificate <paramiko.pkey.PKey.load_certificate> and its corresponding
.public_blob
attribute on key objects, which is honored in the auth and transport modules. Additionally, SSHClient.connect <paramiko.client.SSHClient.connect> will now automatically load certificate data alongside private key data when one has appropriately-named cert files (e.g.id_rsa-cert.pub
) - see its docstring for details.Thanks to Jason Rigby for a first draft (
531
) and to Paul Kapp for the second draft, upon which the current functionality has been based (with modifications.)Note
This support is client-focused; Paramiko-driven server code is capable of handling cert-bearing pubkey auth packets, but it does not interpret any cert-specific fields, so the end result is functionally identical to a vanilla pubkey auth process (and thus requires e.g. prepopulated authorized-keys data.) We expect full server-side cert support to follow later.
1041
Modify logic around explicit disconnect messages, and unknown-channel situations, so that they rely on centralized shutdown code instead of running their own. This is at worst removing some unnecessary code, and may help with some situations where Paramiko hangs at the end of a session. Thanks to Paul Kapp for the patch.1012
(via1016
) Enhance documentation around the new SFTP.posix_rename <paramiko.sftp_client.SFTPClient.posix_rename> method so it's referenced in the 'standard'rename
method for increased visibility. Thanks to Marius Flage for the report.2.2.1 <2017-06-13>
993
Ed25519 host keys were not comparable/hashable, causing an exception if such a key existed in aknown_hosts
file. Thanks to Oleh Prypin for the report and Pierce Lopez for the fix.990
The (added in 2.2.0)bcrypt
dependency should have been on version 3.1.3 or greater (was initially set to 3.0.0 or greater.) Thanks to Paul Howarth for the report.2.2.0 <2017-06-09>
2.1.3 <2017-06-09>
2.0.6 <2017-06-09>
1.18.3 <2017-06-09>
1.17.5 <2017-06-09>
865
SSHClient now requests the type of host key it has (e.g. from known_hosts) and does not consider a different type to be a "Missing" host key. This fixes a common case where an ECDSA key is in known_hosts and the server also has an RSA host key. Thanks to Pierce Lopez.906 (1.18+)
Clean up a handful of outdated imports and related tweaks. Thanks to Pierce Lopez.984
Enhance default cipher preference order such thataes(192|256)-cbc
are preferred overblowfish-cbc
. Thanks to Alex Gaynor.971 (1.17+)
Allow any type implementing the buffer API to be used with BufferedFile <paramiko.file.BufferedFile>, Channel <paramiko.channel.Channel>, and SFTPFile <paramiko.sftp_file.SFTPFile>. This resolves a regression introduced in 1.13 with the Python 3 porting changes, when using types such asmemoryview
. Credit: Martin Packman.741
(also809
,772
; all via912
) Writing encrypted/password-protected private key files was silently broken since 2.0 due to an incorrect API call; this has been fixed.Includes a directly related fix, namely adding the ability to read
AES-256-CBC
ciphered private keys (which is now what we tend to write out as it is Cryptography's default private key cipher.)Thanks to
@virlos
for the original report, Chris Harris and@ibuler
for initial draft PRs, and@jhgorrell
for the final patch.65
(via471
) Add support for OpenSSH's SFTPposix-rename
protocol extension (section 3.3 of OpenSSH's protocol extension document), via a newposix_rename
method in SFTPClient <paramiko.sftp_client.SFTPClient.posix_rename> and SFTPServerInterface <paramiko.sftp_si.SFTPServerInterface.posix_rename>. Thanks to Wren Turkal for the initial patch & Mika Pflüger for the enhanced, merged PR.869
Add anauth_timeout
kwarg to SSHClient.connect <paramiko.client.SSHClient.connect> (default: 30s) to avoid hangs when the remote end becomes unresponsive during the authentication step. Credit to@timsavage
.Note
This technically changes behavior, insofar as very slow auth steps >30s will now cause timeout exceptions instead of completing. We doubt most users will notice; those affected can simply give a higher value to
auth_timeout
.921
Tighten up the__hash__
implementation for various key classes; less code is good code. Thanks to Francisco Couzo for the patch.956 backported (1.17+)
Switch code coverage service from coveralls.io to codecov.io (& then disable the latter's auto-comments.) Thanks to Nikolai Røed Kristiansen for the patch.983
Movesha1
above the now-arguably-brokenmd5
in the list of preferred MAC algorithms, as an incremental security improvement for users whose target systems offer both. Credit: Pierce Lopez.667
The RC4/arcfour family of ciphers has been broken since version 2.0; but since the algorithm is now known to be completely insecure, we are opting to remove support outright instead of fixing it. Thanks to Alex Gaynor for catch & patch.857
Allow SSHClient.set_missing_host_key_policy <paramiko.client.SSHClient.set_missing_host_key_policy> to accept policy classes _or instances, instead of only instances, thus fixing a long-standing gotcha for unaware users.951
Add support for ECDH key exchange (kex), specifically the algorithmsecdh-sha2-nistp256
,ecdh-sha2-nistp384
, andecdh-sha2-nistp521
. They now come before the olderdiffie-hellman-*
family of kex algorithms in the preferred-kex list. Thanks to Shashank Veerapaneni for the patch & Pierce Lopez for a follow-up.- backported
A big formatting pass to clean up an enormous number of invalid Sphinx reference links, discovered by switching to a modern, rigorous nitpicking doc-building mode.900
(via911
) Prefer newerecdsa-sha2-nistp
keys over RSA and DSA keys during host key selection. This improves compatibility with OpenSSH, both in terms of general behavior, and also re: ability to properly leverage OpenSSH-modifiedknown_hosts
files. Credit:@kasdoe
for original report/PR and Pierce Lopez for the second draft.794
(via981
) Prior support forecdsa-sha2-nistp(384|521)
algorithms didn't fully extend to covering host keys, preventing connection to hosts which only offer these key types and no others. This is now fixed. Thanks to@ncoult
and@kasdoe
for reports and Pierce Lopez for the patch.325
(via972
) Add Ed25519 support, for both host keys and user authentication. Big thanks to Alex Gaynor for the patch.Note
This change adds the
bcrypt
andpynacl
Python libraries as dependencies. No C-level dependencies beyond those previously required (for Cryptography) have been added.974 backported
Overhaul the codebase to be PEP-8, etc, compliant (i.e. passes the maintainer's preferred flake8 configuration) and add aflake8
step to the Travis config. Big thanks to Dorian Pula!949 (1.17+)
SSHClient and Transport could cause a memory leak if there's a connection problem or protocol error, even ifTransport.close()
is called. Thanks Kyle Agronick for the discovery and investigation, and Pierce Lopez for assistance.683 (1.17+)
Makeutil.log_to_file
append instead of replace. Thanks to@vlcinsky
for the report.2.1.2 <2017-02-20>
2.0.5 <2017-02-20>
1.18.2 <2017-02-20>
1.17.4 <2017-02-20>
853 (1.17+)
Tweak how RSAKey.__str__ <paramiko.rsakey.RSAKey> behaves so it doesn't causeTypeError
under Python 3. Thanks to Francisco Couzo for the report.862 (1.17+)
(via863
) Avoid test suite exceptions on platforms lackingerrno.ETIME
(which seems to be some FreeBSD and some Windows environments.) Thanks to Sofian Brabez.44 (1.17+)
(via891
) SSHClient <paramiko.client.SSHClient> now gives its internal Transport <paramiko.transport.Transport> a handle on itself, preventing garbage collection of the client until the session is closed. Without this, some code which returns stream or transport objects without the client that generated them, would result in premature session closure when the client was GCd. Credit:@w31rd0
for original report, Omer Anson for the patch.713 (<2.0)
(via714
and889
) Don't pass initialization vectors to PyCrypto when dealing with counter-mode ciphers; newer PyCrypto versions throw an exception otherwise (older ones simply ignored this parameter altogether). Thanks to@jmh045000
for report & patches.895 (1.17+)
Fix a bug in server-mode concerning multiple interactive auth steps (which were incorrectly responded to). Thanks to Dennis Kaarsemaker for catch & patch.866 backported (1.17+)
(also838
) Remove an old test-related file we don't support, and add PyPy to Travis-CI config. Thanks to Pierce Lopez for the final patch and Pedro Rodrigues for an earlier edition.2.1.1 <2016-12-12>
2.0.4 <2016-12-12>
1.18.1 <2016-12-12>
859 (1.18+)
(via860
) A tweak to the original patch implementing398
was not fully applied, causing calls to ~paramiko.client.SSHClient.invoke_shell to fail withAttributeError
. This has been fixed. Patch credit: Kirk Byers.-
Accidentally merged the new features from 1.18.0 into the 2.0.x bugfix-only branch. This included merging a bug in one of those new features (breaking ~paramiko.client.SSHClient.invoke_shell with anAttributeError
.) The offending code has been stripped out of the 2.0.x line (but of course, remains in 2.1.x and above.)859
(via860
) A tweak to the original patch implementing398
was not fully applied, causing calls to ~paramiko.client.SSHClient.invoke_shell to fail withAttributeError
. This has been fixed. Patch credit: Kirk Byers.2.1.0 <2016-12-09>
2.0.3 <2016-12-09>
1.18.0 <2016-12-09>
1.17.3 <2016-12-09>
802 (1.17+)
(via804
) Update our vendored Windows API module to address errors of the formAttributeError: 'module' object has no attribute 'c_ssize_t'
. Credit to Jason R. Coombs.824 (1.17+)
Fix the implementation ofPKey.write_private_key_file
(this method is only publicly defined on subclasses; the fix was in the private real implementation) so it passes the correct params toopen()
. This bug apparently went unnoticed and unfixed for 12 entire years. Congrats to John Villalovos for noticing & submitting the patch!801 backported (1.17+)
Skip a Unix-only test when on Windows; thanks to Gabi Davar.792 backported (1.17+)
Minor updates to the README and demos; thanks to Alan Yee.780 (1.18+)
(also779
, and may help users affected by520
) Add an optionaltimeout
parameter to Transport.start_client <paramiko.transport.Transport.start_client> (and feed it the value of the configured connection timeout when used within SSHClient <paramiko.client.SSHClient>.) This helps prevent situations where network connectivity isn't timing out, but the remote server is otherwise unable to service the connection in a timely manner. Credit to@sanseihappa
.742
(also re:559
) CatchAssertionError
thrown by Cryptography when attempting to load bad ECDSA keys, turning it into anSSHException
. This moves the behavior in line with other "bad keys" situations, re: Paramiko's main auth loop. Thanks to MengHuan Yu for the patch.789 (1.17+)
Add a missing.closed
attribute (plus._closed
because reasons) to ProxyCommand <paramiko.proxy.ProxyCommand> so the earlier partial fix for520
works in situations where one is gatewaying viaProxyCommand
.334 (1.17+)
Make thesubprocess
import inproxy.py
lazy so users on platforms without it (such as Google App Engine) can import Paramiko successfully. (Relatedly, make it easier to tweak an active socket check timeout [in Transport <paramiko.transport.Transport>] which was previously hardcoded.) Credit: Shinya Okano.854 backported (1.17+)
Fix incorrect docstring/param-list for Transport.auth_gssapi_keyex <paramiko.transport.Transport.auth_gssapi_keyex> so it matches the real signature. Caught by@Score_Under
.681 (1.17+)
Fix a Python3-specific bug re: the handling of read buffers when usingProxyCommand
. Thanks to Paul Kapp for catch & patch.398 (1.18+)
Add anenvironment
dict argument to Client.exec_command <paramiko.client.SSHClient.exec_command> (plus the lower level Channel.update_environment <paramiko.channel.Channel.update_environment> and Channel.set_environment_variable <paramiko.channel.Channel.set_environment_variable> methods) which implements theenv
SSH message type. This means the remote shell environment can be set without the use ofVARNAME=value
shell tricks, provided the server'sAcceptEnv
lists the variables you need to set. Thanks to Philip Lorenz for the pull request.819 backported (>=1.15,<2.0)
Document how lackinggmp
headers at install time can cause a significant performance hit if you build PyCrypto from source. (Most system-distributed packages already have this enabled.)2.0.2 <2016-07-25>
1.17.2 <2016-07-25>
1.16.3 <2016-07-25>
673 (1.16+)
(via681
) Fix protocol banner read errors (SSHException
) which would occasionally pop up when usingProxyCommand
gatewaying. Thanks to@Depado
for the initial report and Paul Kapp for the fix.774 (1.16+)
Add a_closed
private attribute to ~paramiko.channel.Channel objects so that they continue functioning when used as proxy sockets under Python 3 (e.g. asdirect-tcpip
gateways for other Paramiko connections.)758 (1.16+)
Apply type definitions to_winapi
module from jaraco.windows 3.6.1. This should address issues on Windows platforms that often result in errors likeArgumentError: [...] int too long to convert
. Thanks to@swohlerLL
for the report and Jason R. Coombs for the patch.2.0.1 <2016-06-21>
1.17.1 <2016-06-21>
1.16.2 <2016-06-21>
520 (1.16+)
(Partial fix) Fix at least one instance of race condition driven threading hangs at end of the Python interpreter session. (Includes a docs update as well - always make sure to.close()
your clients!)537 (1.16+)
Fix a bug in BufferedPipe.set_event <paramiko.buffered_pipe.BufferedPipe.set_event> which could cause deadlocks/hangs when one uses select.select against ~paramiko.channel.Channel objects (or otherwise calls Channel.fileno <paramiko.channel.Channel.fileno> after the channel has closed). Thanks to Przemysław Strzelczak for the report & reproduction case, and to Krzysztof Rusek for the fix.2.0.0 <2016-04-28>
1.17.0 <2016-04-28>
1.16.1 <2016-04-28>
1.15.5 <2016-04-28>
731
(working off the earlier611
) Add support for 384-and 512-bit elliptic curve groups in ECDSA key types (akaecdsa-sha2-nistp384
/ecdsa-sha2-nistp521
). Thanks to Michiel Tiller and@CrazyCasta
for the patches.670
Due to an earlier bugfix, less-specificHost
blocks'ProxyCommand
values were overridingProxyCommand none
in more-specificHost
blocks. This has been fixed in a backwards compatible manner (i.e.ProxyCommand none
continues to appear as a total lack of anyproxycommand
key in parsed config structures). Thanks to Pat Brisbin for the catch.676
(via677
) Fix a backwards incompatibility issue that cropped up in SFTPFile.prefetch <paramiko.sftp_file.SFTPFile.prefetch> re: the erroneously non-optionalfile_size
parameter. Should only affect users who manually callprefetch
. Thanks to@stevevanhooser
for catch & patch.394
Replace PyCrypto with the Python Cryptographic Authority (PyCA) 'Cryptography' library suite. This improves security, installability, and performance; adds PyPy support; and much more.There aren't enough ways to thank Alex Gaynor for all of his work on this, and then his patience while the maintainer let his PR grow moss for a year and change. Paul Kehrer came in with an assist, and I think I saw Olle Lundberg,
@techtonik
and@johnthagen
supplying backup as well. Thanks to all!Warning
This is a backwards incompatible change.
However, it should only affect installation requirements; no API changes are intended or expected. Please report any such breakages as bugs.
See our updated
installation docs <installing>
for details on what is now required to install Paramiko; many/most users should be able to simplypip install -U paramiko
(especially if you upgrade to pip 8).577
(via578
; should also fix718
,560
) Fix stalled/hung SFTP downloads by cleaning up some threading lock issues. Thanks to Stephen C. Pope for the patch.716
Fix a Python 3 compatibility issue when handling two-factor authentication. Thanks to Mateusz Kowalski for the catch & original patch.729 backported (>=1.15,<2.0)
Clean upsetup.py
to always usesetuptools
, not doing so was a historical artifact from bygone days. Thanks to Alex Gaynor.649 major (==1.17)
Update the module in charge of handling SSH moduli so it's consistent with OpenSSH behavior re: prime number selection. Thanks to Damien Tournoud for catch & patch.617
(aka fabric/fabric#1429; via679
; related:678
,685
,615
&616
) Fix up ~paramiko.ssh_exception.NoValidConnectionsError so it pickles correctly, and fix a related Python 3 compatibility issue. Thanks to Rebecca Schlussel for the report & Marius Gedminas for the patch.613
(via619
) Update tojaraco.windows
3.4.1 to fix some errors related toctypes
on Windows platforms. Credit to Jason R. Coombs.621 backported (>=1.15,<2.0)
Annotate some public attributes on ~paramiko.channel.Channel such as.closed
. Thanks to Sergey Vasilyev for the report.632
Fix logic bug in the SFTP client's callback-calling functionality; previously there was a chance the given callback would fire twice at the end of a transfer. Thanks to@ab9-er
for catch & original patch.612 backported (>=1.15,<2.0)
Identify & work around a race condition in the test for handshake timeouts, which was causing frequent test failures for a subset of contributors as well as Travis-CI (usually, but not always, limited to Python 3.5). Props to Ed Kellett for assistance during some of the troubleshooting.697 backported (>=1.15,<2.0)
Remove whitespace in oursetup.py
'sinstall_requires
as it triggers occasional bugs in some versions ofsetuptools
. Thanks to Justin Lecher for catch & original patch.499
Strip trailing/leading whitespace from lines when parsing SSH config files - this brings things in line with OpenSSH behavior. Thanks to Alfredo Esteban for the original report and Nick Pillitteri for the patch.652
Fix behavior ofgssapi-with-mic
auth requests so they fail gracefully (allowing followup via other auth methods) instead of raising an exception. Patch courtesy of@jamercee
.588 (==1.17)
Add missing file-like object methods for ~paramiko.file.BufferedFile and ~paramiko.sftp_file.SFTPFile. Thanks to Adam Meily for the patch.636 backported (>=1.15,<2.0)
Clean up and enhance the README (and rename it toREADME.rst
from justREADME
). Thanks to@LucasRMehl
.1.16.0 <2015-11-04>
194 major
(also562
,530
,576
) Streamline use ofstat
when downloading SFTP files via SFTPClient.get <paramiko.sftp_client.SFTPClient.get>; this avoids triggering bugs in some off-spec SFTP servers such as IBM Sterling. Thanks to@muraleee
for the initial report and to Torkil Gustavsen for the patch.467
(also139
,412
) Fully enable two-factor authentication (e.g. when a server requiresAuthenticationMethods pubkey,keyboard-interactive
). Thanks to@perryjrandall
for the patch and to@nevins-b
and Matt Robenolt for additional support.502 major
Fix 'exec' requests in server mode to useget_string
instead ofget_text
to avoidUnicodeDecodeError
on non-UTF-8 input. Thanks to Anselm Kruis for the patch & discussion.401
Fix line number reporting in log output regarding invalidknown_hosts
line entries. Thanks to Dylan Thacker-Smith for catch & patch.525 backported
Update the vendored Windows API addon to a more recent edition. Also fixes193
,488
,498
. Thanks to Jason Coombs.1.15.4 <2015-11-02>
1.14.3 <2015-11-02>
1.13.4 <2015-11-02>
366
Fix ~paramiko.sftp_attr.SFTPAttributes so its string representation doesn't raise exceptions on empty/initialized instances. Patch by Ulrich Petri.359
Use correct attribute name when trying to use Python 3'sint.bit_length
method; prior to fix, the Python 2 custom fallback implementation was always used, even on Python 3. Thanks to Alex Gaynor.594 backported
Correct some post-Python3-port docstrings to specifybytes
type instead ofstr
. Credit to@redixin
.565
Don't explode withIndexError
when reading private key files lacking an-----END <type> PRIVATE KEY-----
footer. Patch courtesy of Prasanna Santhanam.604
Add support for theaes192-ctr
andaes192-cbc
ciphers. Thanks to Michiel Tiller for noticing it was as easy as tweaking some key sizes :D356
(also596
,365
,341
,164
,581
, and a bunch of other duplicates besides) Add support for SHA-2 based key exchange (kex) algorithmdiffie-hellman-group-exchange-sha256
and (H)MAC algorithmshmac-sha2-256
andhmac-sha2-512
.This change includes tweaks to debug-level logging regarding algorithm-selection handshakes; the old all-in-one log line is now multiple easier-to-read, printed-at-handshake-time log lines.
Thanks to the many people who submitted patches for this functionality and/or assisted in testing those patches. That list includes but is not limited to, and in no particular order: Matthias Witte, Dag Wieers, Ash Berlin, Etienne Perot, Gert van Dijk,
@GuyShaanan
, Aaron Bieber,@cyphase
, and Eric Brown.1.15.3 <2015-10-02>
554 backported
Fix inaccuracies in the docstring for the ECDSA key class. Thanks to Jared Hance for the patch.516 backported
Document ~paramiko.agent.AgentRequestHandler. Thanks to@toejough
for report & suggestions.496 (1.15+)
Fix a handful of small but critical bugs in Paramiko's GSSAPI support (note: this includes switching from PyCrypo's Random to os.urandom). Thanks to Anselm Kruis for catch & patch.491
(combines62
and439
) Implement timeout functionality to address hangs from dropped network connections and/or failed handshakes. Credit to@vazir
and@dacut
for the original patches and to Olle Lundberg for reimplementation.490
Skip invalid/unparseable lines inknown_hosts
files, instead of raising ~paramiko.ssh_exception.SSHException. This brings Paramiko's behavior more in line with OpenSSH, which silently ignores such input. Catch & patch courtesy of Martin Topholm.404
Print details when displaying ~paramiko.ssh_exception.BadHostKeyException objects (expected vs received data) instead of just "hey shit broke". Patch credit: Loic Dachary.469
(also488
,461
and like a dozen others) Fix a typo introduced in the 1.15 release which broke WinPageant support. Thanks to everyone who submitted patches, and to Steve Cohen who was the lucky winner of the cherry-pick lottery.353
(via482
) Fix a bug introduced in the Python 3 port which causedOverFlowError
(and other symptoms) in SFTP functionality. Thanks to@dboreham
for leading the troubleshooting charge, and to Scott Maxwell for the final patch.582
Fix some oldsetup.py
related helper code which was breakingbdist_dumb
on Mac OS X. Thanks to Peter Odding for the patch.22 major
Try harder to connect to multiple network families (e.g. IPv4 vs IPv6) in case of connection issues; this helps with problems such as hosts which resolve both IPv4 and IPv6 addresses but are only listening on IPv4. Thanks to Dries Desmet for original report and Torsten Landschoff for the foundational patchset.402
Check to see if an SSH agent is actually present before trying to forward it to the remote end. This replaces what was usually a uselessTypeError
with a human-readable ~paramiko.ssh_exception.AuthenticationException. Credit to Ken Jordan for the fix and Yvan Marques for original report.1.15.2 <2014-12-19>
1.14.2 <2014-12-19>
1.13.3 <2014-12-19>
413
(also414
,420
,454
) Be significantly smarter about polling & timing behavior when running proxy commands, to avoid unnecessary (often 100%!) CPU usage. Major thanks to Jason Dunsmore for report & initial patchset and to Chris Adams & John Morrissey for followup improvements.455
Tweak packet size handling to conform better to the OpenSSH RFCs; this helps address issues with interactive program cursors. Courtesy of Jeff Quast.428
Fix an issue in ~paramiko.file.BufferedFile (primarily used in the SFTP modules) concerning incorrect behavior by ~paramiko.file.BufferedFile.readlines on files whose size exceeds the buffer size. Thanks to@achapp
for catch & patch.415
Fixssh_config
parsing to correctly interpretProxyCommand none
as the lack of a proxy command, instead of as a literal command string of"none"
. Thanks to Richard Spiers for the catch & Sean Johnson for the fix.431 backported
Replace handrolledssh_config
parsing code with use of theshlex
module. Thanks to Yan Kalchevskiy.422 backported
Clean up some unused imports. Courtesy of Olle Lundberg.421 backported
Modernize threading calls to use newer API. Thanks to Olle Lundberg.419 backported
Modernize a bunch of the codebase internals to leverage decorators. Props to@beckjake
for realizing we're no longer on Python 2.2 :D266
Change numbering of ~paramiko.transport.Transport channels to start at 0 instead of 1 for better compatibility with OpenSSH & certain server implementations which break on 1-indexed channels. Thanks to@egroeper
for catch & patch.459
Tighten up agent connection closure behavior to avoid spuriousResourceWarning
display in some situations. Thanks to@tkrapp
for the catch.429
Server-level debug message logging was overlooked during the Python 3 compatibility update; Python 3 clients attempting to log SSH debug packets encountered type errors. This is now fixed. Thanks to@mjmaenpaa
for the catch.320
Update our win_pageant module to be Python 3 compatible. Thanks to@sherbang
and@adamkerz
for the patches.1.15.1 <2014-09-22>
399
SSH agent forwarding (potentially other functionality as well) would hang due to incorrect values passed into the new window size arguments for ~paramiko.transport.Transport (thanks to a botched merge). This has been corrected. Thanks to Dylan Thacker-Smith for the report & patch.167
Add ~paramiko.config.SSHConfig.get_hostnames for easier introspection of a loaded SSH config file or object. Courtesy of Søren Løvborg.1.15.0 <2014-09-18>
393
Replace internal use of PyCrypto'sSHA.new
with the stdlib'shashlib.sha1
. Thanks to Alex Gaynor.267
(also250
,241
,228
) Add GSS-API / SSPI (e.g. Kerberos) key exchange and authentication support (installation docs here <gssapi>
). Mega thanks to Sebastian Deiß, with assist by Torsten Landschoff.Note
Unix users should be aware that the
python-gssapi
library (a requirement for using this functionality) only appears to support Python 2.7 and up at this time.346 major
Fix an issue in private key files' encryption salts that could cause tracebacks and file corruption if keys were re-encrypted. Credit to Xavier Nunn.362
Allow users to control the SSH banner timeout. Thanks to Cory Benfield.372
Update default window & packet sizes to more closely adhere to the pertinent RFC; also expose these settings in the public API so they may be overridden by client code. This should address some general speed issues such as175
. Big thanks to Olle Lundberg for the update.373 major
Attempt to fix a handful of issues (such as354
) related to infinite loops and threading deadlocks. Thanks to Olle Lundberg as well as a handful of community members who provided advice & feedback via IRC.374
(also375
) Old code cleanup courtesy of Olle Lundberg.377
Factor ~paramiko.channel.Channel openness sanity check into a decorator. Thanks to Olle Lundberg for original patch.298 major
Don't perform point validation on ECDSA keys inknown_hosts
files, since a) this can cause significant slowdown when such keys exist, and b)known_hosts
files are implicitly trustworthy. Thanks to Kieran Spear for catch & patch.Note
This change bumps up the version requirement for the
ecdsa
library to0.11
.234 major
Lower logging levels for a few overly-noisy log messages about secure channels. Thanks to David Pursehouse for noticing & contributing the fix.218
Add support for ECDSA private keys on the client side. Thanks to@aszlig
for the patch.335 major
Fix ECDSA key generation (generation of brand new ECDSA keys was broken previously). Thanks to@solarw
for catch & patch.184
Support quoted values in SSH config file parsing. Credit to Yan Kalchevskiy.131
Add a ~paramiko.sftp_client.SFTPClient.listdir_iter method to ~paramiko.sftp_client.SFTPClient allowing for more efficient, async/generator based file listings. Thanks to John Begeman.378 backported
Minor code cleanup in the SSH config module courtesy of Olle Lundberg.249 backported
Consolidate version information into one spot. Thanks to Gabi Davar for the reminder.1.14.1 <2014-08-25>
1.13.2 <2014-08-25>
376
Be less aggressive about expanding variables inssh_config
files, which results in a speedup of SSH config parsing. Credit to Olle Lundberg.324 backported
A bevvy of documentation typo fixes, courtesy of Roy Wellington.312
paramiko.transport.Transport had a bug in its__repr__
which surfaces during errors encountered within its__init__
, causing problematic tracebacks in such situations. Thanks to Simon Percivall for catch & patch.272
Fix a bug whereknown_hosts
parsing hashed the input hostname as well as the hostnames from theknown_hosts
file, on every comparison. Thanks to@sigmunau
for final patch and@ostacey
for the original report.239
Add Windows-style CRLF support to SSH config file parsing. Props to Christopher Swenson.229 backported
Fix a couple of incorrectly-copied docstrings'.. versionadded::
RST directives. Thanks to Aarni Koskela for the catch.169 backported
Minor refactor of paramiko.sftp_client.SFTPClient.put thanks to Abhinav Upadhyay.285
(also352
) Update our Python 3b()
compatibility shim to handlebuffer
objects correctly; this fixes a frequently reported issue affecting many users, including users of thebzr
software suite. Thanks to@basictheprogram
for the initial report, Jelmer Vernooij for the fix and Andrew Starr-Bochicchio & Jeremy T. Bouse (among others) for discussion & feedback.371
Add Travis support & docs update for Python 3.4. Thanks to Olle Lundberg.1.14.0 <2014-05-07>
1.13.1 <2014-05-07>
1.12.4 <2014-05-07>
1.11.6 <2014-05-07>
-
paramiko.file.BufferedFile.read incorrectly returned text strings after the Python 3 migration, despite bytes being more appropriate for file contents (which may be binary or of an unknown encoding.) This has been addressed.Note
paramiko.file.BufferedFile.readline continues to return strings, not bytes, as "lines" only make sense for textual data. It assumes UTF-8 by default.
This should fix this issue raised on the Obnam mailing list. Thanks to Antoine Brenner for the patch.
-
Added self.args for exception classes. Used for unpickling. Related to (Fabric #986, Fabric #714). Thanks to Alex Plugaru.-
Fix logging error in sftp_client for filenames containing the '%' character. Thanks to Antoine Brenner.308
Fix regression in dsskey.py that caused sporadic signature verification failures. Thanks to Chris Rose.299
Use deterministic signatures for ECDSA keys for improved security. Thanks to Alex Gaynor.297
Replace PyCrypto'sRandom
with os.urandom for improved speed and security. Thanks again to Alex.295
Swap out a bunch of PyCrypto hash functions with use of hashlib. Thanks to Alex Gaynor.290
(also292
) Add support for building universal (Python 2+3 compatible) wheel files during the release process. Courtesy of Alex Gaynor.284
Add Python language trove identifiers tosetup.py
. Thanks to Alex Gaynor for catch & patch.235
Improve string type testing in a handful of spots (e.g.s/if type(x) is str/if isinstance(x, basestring)/g
.) Thanks to@ksamuel
for the report.1.13.0 <2014-03-13>
1.12.3 <2014-03-13>
1.11.5 <2014-03-13>
1.10.7 <2014-03-13>
16
Python 3 support! Our test suite passes under Python 3, and it (& Fabric's test suite) continues to pass under Python 2. Python 2.5 is no longer supported with this change!The merged code was built on many contributors' efforts, both code & feedback. In no particular order, we thank Daniel Goertzen, Ivan Kolodyazhny, Tomi Pieviläinen, Jason R. Coombs, Jan N. Schulze,
@Lazik
, Dorian Pula, Scott Maxwell, Tshepang Lekhonkhobe, Aaron Meurer, and Dave Halter.256 backported
Convert API documentation to Sphinx, yielding a new API docs website to replace the old Epydoc one. Thanks to Olle Lundberg for the initial conversion work.-
Use constant-time hash comparison operations where possible, to protect against timing-based attacks. Thanks to Alex Gaynor for the patch.1.12.2 <2014-02-14>
1.11.4 <2014-02-14>
1.10.6 <2014-02-14>
58
Allow client code to access the stored SSH server banner via Transport.get_banner <paramiko.transport.Transport.get_banner>. Thanks to@Jhoanor
for the patch.252
(Fabric #1020) Enhanced the implementation ofProxyCommand
to avoid a deadlock/hang condition that frequently occurs atTransport
shutdown time. Thanks to Mateusz Kobos, Matthijs van der Vleuten and Guillaume Zitta for the original reports and to Marius Gedminas for helping test nontrivial use cases.268
Fix some missed renames ofProxyCommand
related error classes. Thanks to Marius Gedminas for catch & patch.34
(PR35
) Fix SFTP prefetching incompatibility with some SFTP servers regarding request/response ordering. Thanks to Richard Kettlewell.193
(and its attentant PRs230
&253
) Fix SSH agent problems present on Windows. Thanks to David Hobbs for initial report and to Aarni Koskela & Olle Lundberg for the patches.1.12.1 <2014-01-08>
1.11.3 <2014-01-08>
1.10.5 <2014-01-08>
225 (1.12+)
Note ecdsa requirement in README. Thanks to Amaury Rodriguez for the catch.176
Fix AttributeError bugs in known_hosts file (re)loading. Thanks to Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test case.1.12.0 <2013-09-27>
1.11.2 <2013-09-27>
1.10.4 <2013-09-27>
152
Add tentative support for ECDSA keys. This adds the ecdsa module as a new dependency of Paramiko. The module is available at warner/python-ecdsa on Github and ecdsa on PyPI.- Note that you might still run into problems with key negotiation --Paramiko picks the first key that the server offers, which might not be what you have in your known_hosts file.
- Mega thanks to Ethan Glasser-Camp for the patch.
136
Add server-side support for the SSH protocol's 'env' command. Thanks to Benjamin Pollack for the patch.156 (1.11+)
Fix potential deadlock condition when using Channel objects as sockets (e.g. when using SSH gatewaying). Thanks to Steven Noonan and Frank Arnold for catch & patch.179
Fix a missing variable causing errors when an ssh_config file has a non-default AddressFamily set. Thanks to Ed Marshall & Tomaz Muraus for catch & patch.200
Fix an exception-causing typo indemo_simple.py
. Thanks to Alex Buchanan for catch & Dave Foster for patch.199
Typo fix in the license header cross-project. Thanks to Armin Ronacher for catch & patch.1.11.1 <2013-09-20>
1.10.3 <2013-09-20>
162
Clean up HMAC module import to avoid deadlocks in certain uses of SSHClient. Thanks to Gernot Hillier for the catch & suggested fix.36
Fix the port-forwarding demo to avoid file descriptor errors. Thanks to Jonathan Halcrow for catch & patch.168
Update config handling to properly handle multiple 'localforward' and 'remoteforward' keys. Thanks to Emre Yılmaz for the patch.1.11.0 <2013-07-26>
1.10.2 <2013-07-26>
98 major
On Windows, when interacting with the PuTTY PAgeant, Paramiko now creates the shared memory map with explicit Security Attributes of the user, which is the same technique employed by the canonical PuTTY library to avoid permissions issues when Paramiko is running under a different UAC context than the PuTTY Ageant process. Thanks to Jason R. Coombs for the patch.100
Remove use of PyWin32 inwin_pageant
module. Module was already dependent on ctypes for constructing appropriate structures and had ctypes implementations of all functionality. Thanks to Jason R. Coombs for the patch.87 major
Ensure updates toknown_hosts
files account for any updates to said files after Paramiko initially read them. (Includes related fix to guard against duplicate entries during subsequentknown_hosts
loads.) Thanks to@sunweaver
for the contribution.153
(also67
) Warn on parse failure when reading known_hosts file. Thanks to@glasserc
for patch.146
Indentation fixes for readability. Thanks to Abhinav Upadhyay for catch & patch.1.10.1 <2013-04-05>
142
(Fabric #811) SFTP put of empty file will still return the attributes of the put file. Thanks to Jason R. Coombs for the patch.154
(Fabric #876) Forwarded SSH agent connections left stale local pipes lying around, which could cause local (and sometimes remote or network) resource starvation when running many agent-using remote commands. Thanks to Kevin Tegtmeier for catch & patch.1.10.0 <2013-03-01>
66
Batch SFTP writes to help speed up file transfers. Thanks to Olle Lundberg for the patch.133 major
Fix handling of window-change events to be on-spec and not attempt to wait for a response from the remote sshd; this fixes problems with less common targets such as some Cisco devices. Thanks to Phillip Heller for catch & patch.93
Overhaul SSH config parsing to be in line withman ssh_config
(& the behavior ofssh
itself), including addition of parameter expansion within config values. Thanks to Olle Lundberg for the patch.110
Honor SSH configAddressFamily
setting when looking up local host's FQDN. Thanks to John Hensley for the patch.128
Defer FQDN resolution until needed, when parsing SSH config files. Thanks to Parantapa Bhattacharya for catch & patch.102 major
Forego random padding for packets when running under*-ctr
ciphers. This corrects some slowdowns on platforms where random byte generation is inefficient (e.g. Windows). Thanks to@warthog618
for catch & patch, and Michael van der Kolff for code/technique review.127
TurnSFTPFile
into a context manager. Thanks to Michael Williamson for the patch.116
LimitMessage.get_bytes
to an upper bound of 1MB to protect against potential DoS vectors. Thanks to@mvschaik
for catch & patch.115
Add convenienceget_pty
kwarg toClient.exec_command
so users not manually controlling a channel object can still toggle PTY creation. Thanks to Michael van der Kolff for the patch.71
AddSFTPClient.putfo
and.getfo
methods to allow direct uploading/downloading of file-like objects. Thanks to Eric Buehl for the patch.113
Addtimeout
parameter toSSHClient.exec_command
for easier setting of the command's internal channel object's timeout. Thanks to Cernov Vladimir for the patch.94
Remove duplication of SSH port constant. Thanks to Olle Lundberg for the catch.80
Expose the internal "is closed" property of the file transfer classBufferedFile
as.closed
, better conforming to Python's file interface. Thanks to@smunaut
and James Hiscock for catch & patch.