parallel-ssh 2.14.0__py3-none-any.whl → 2.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: parallel-ssh
3
- Version: 2.14.0
3
+ Version: 2.15.0
4
4
  Summary: Asynchronous parallel SSH library
5
5
  Home-page: https://github.com/ParallelSSH/parallel-ssh
6
6
  Author: Panos Kittenis
7
- Author-email: zuboci@yandex.com
8
- License: LGPLv2.1
7
+ Author-email: danst@tutanota.com
8
+ License: LGPL-2.1-only
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
- Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)
11
10
  Classifier: Intended Audience :: Developers
12
11
  Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python
14
12
  Classifier: Programming Language :: Python :: 3
15
13
  Classifier: Programming Language :: Python :: 3.8
16
14
  Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: Implementation :: CPython
21
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
22
+ Classifier: Topic :: System :: Shells
20
23
  Classifier: Topic :: System :: Networking
21
24
  Classifier: Topic :: Software Development :: Libraries
22
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Operating System :: POSIX
23
27
  Classifier: Operating System :: POSIX :: Linux
24
28
  Classifier: Operating System :: POSIX :: BSD
25
29
  Classifier: Operating System :: Microsoft :: Windows
@@ -30,6 +34,15 @@ License-File: COPYING.LESSER
30
34
  Requires-Dist: gevent
31
35
  Requires-Dist: ssh2-python
32
36
  Requires-Dist: ssh-python
37
+ Dynamic: author
38
+ Dynamic: author-email
39
+ Dynamic: classifier
40
+ Dynamic: description
41
+ Dynamic: home-page
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: requires-dist
45
+ Dynamic: summary
33
46
 
34
47
  ============
35
48
  parallel-ssh
@@ -0,0 +1,27 @@
1
+ parallel_ssh-2.15.0.dist-info/licenses/COPYING,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
2
+ parallel_ssh-2.15.0.dist-info/licenses/COPYING.LESSER,sha256=AKibDRiqzUEU3s95Ei24e_Nb3a8rxQ44PJyfTCYzkLI,24486
3
+ parallel_ssh-2.15.0.dist-info/licenses/LICENSE,sha256=m4cqigcLitMpxL04D7G_AAD1ZMdQI-yOHmgD8VNkuek,26461
4
+ pssh/__init__.py,sha256=-2ioNmlJK1Mg2BG2VMODs0uX4zjHWo09HQ2BDu0k8ZI,1491
5
+ pssh/_version.py,sha256=ORfZeFepHteZV6a-ErdSrZvIosQNSSEdGlc5mCrLh0Q,24494
6
+ pssh/config.py,sha256=BTdsCyLmwe8oBaveCWYy-Jdd8N2oPS7q0FlNtguqp2Q,11422
7
+ pssh/constants.py,sha256=0CTBQp82r9eHhm0avOooor4VEQNBom720p9Yn5b2tFE,1103
8
+ pssh/exceptions.py,sha256=fe4HKlIr0bWCdJGFIDowrT5fF231JqINsiJHx16nKhE,2694
9
+ pssh/output.py,sha256=Tg1KeiK0zIQq_O8jf46jnPIoyWEdd89UNXwUaSJApPA,4712
10
+ pssh/utils.py,sha256=Ly3J3G1De9nzujMsZvbnTEfV78bFl2-LkhLKkQTJftw,1849
11
+ pssh/clients/__init__.py,sha256=m7fYfyw7G_Blc9-gPRDVKSY0w020pkD2n1WxDRrY3bk,883
12
+ pssh/clients/common.py,sha256=Bb-dFiXwa-0Dtq2JXD1R7ojfJ_-IS91vORRBJ_sAX1Y,1765
13
+ pssh/clients/reader.py,sha256=wGURuem2xMqnl7sad4bwcB8wrlI3x6HNADZnEGZSXCI,3139
14
+ pssh/clients/base/__init__.py,sha256=dOC19H9XBNwDQFNnAz6WaRtzM7ZmFpyu86U8DofbOII,812
15
+ pssh/clients/base/parallel.py,sha256=nkzHATvCbUfT_TmpgfZTZnQ-8I9aWcQvJnZf2BMSpfs,24889
16
+ pssh/clients/base/single.py,sha256=_81t4J5BCL-h9lBw-yyD9YpFx-FaX9Cb1ML1q4FPZtI,27379
17
+ pssh/clients/native/__init__.py,sha256=CUZdR52b4tPyqrBKFUHJlOJRYEGkS3tXgl8q3wd73mA,912
18
+ pssh/clients/native/parallel.py,sha256=bSzLVIEXLLtJDC6q2tlRv2R3wjSdvUWpDXACihFAJ-U,24933
19
+ pssh/clients/native/single.py,sha256=Cj00SGxtqNrHu4l_J5P9TP9s_nJKzSVHNpMbStQ5h7g,35687
20
+ pssh/clients/native/tunnel.py,sha256=mZyKoblB_vZhQfQaVHQRlv7KWDd_MKcAhE-a72xv-MI,10697
21
+ pssh/clients/ssh/__init__.py,sha256=0oqNL4MXa1DwDX4nWM1nb5y12QkIqGYw1n_xpm-ePp4,904
22
+ pssh/clients/ssh/parallel.py,sha256=fx1CGDgjlmbgQTGt9FDa9JGkDzkAb41y-RAF69rMV_s,11673
23
+ pssh/clients/ssh/single.py,sha256=VDtN65-ELXD0BXGUt5u9FFMzArGCDqDJ_rdi8x0Stt4,14383
24
+ parallel_ssh-2.15.0.dist-info/METADATA,sha256=JAaJJ9UcLWBCK6naRt7pVqGh0wRowvZ5HSdEXbiKzUo,11104
25
+ parallel_ssh-2.15.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ parallel_ssh-2.15.0.dist-info/top_level.txt,sha256=s8P6ZHOwt2BYgDc62Cpd2z7i-rebGzIhhnO09pger0U,5
27
+ parallel_ssh-2.15.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pssh/__init__.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  """Asynchronous parallel SSH client library.
19
19
 
pssh/clients/__init__.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2025 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  # flake8: noqa: F401
19
19
  from .native import ParallelSSHClient, SSHClient
@@ -0,0 +1,16 @@
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  """Abstract parallel SSH client package"""
19
19
 
@@ -23,7 +23,7 @@ import gevent.pool
23
23
  from gevent import joinall, spawn, Timeout as GTimeout
24
24
  from gevent.hub import Hub
25
25
 
26
- from ..common import _validate_pkey_path, _validate_pkey
26
+ from ..common import _validate_pkey_path, _validate_pkey, _validate_api
27
27
  from ...config import HostConfig
28
28
  from ...constants import DEFAULT_RETRIES, RETRY_DELAY
29
29
  from ...exceptions import HostArgumentError, Timeout, ShellError, HostConfigError
@@ -55,6 +55,8 @@ class BaseParallelSSHClient(object):
55
55
  gssapi_client_identity=None,
56
56
  gssapi_delegate_credentials=False,
57
57
  forward_ssh_agent=False,
58
+ compress=False,
59
+ keyboard_interactive=False,
58
60
  _auth_thread_pool=True,
59
61
  ):
60
62
  self.allow_agent = allow_agent
@@ -86,6 +88,9 @@ class BaseParallelSSHClient(object):
86
88
  self.gssapi_server_identity = gssapi_server_identity
87
89
  self.gssapi_client_identity = gssapi_client_identity
88
90
  self.gssapi_delegate_credentials = gssapi_delegate_credentials
91
+ self.compress = compress
92
+ self.keyboard_interactive = keyboard_interactive
93
+ _validate_api(self.keyboard_interactive, self.password)
89
94
  self._auth_thread_pool = _auth_thread_pool
90
95
  self._check_host_config()
91
96
 
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  import logging
19
19
  import os
@@ -23,14 +23,14 @@ from warnings import warn
23
23
 
24
24
  from gevent import sleep, socket, Timeout as GTimeout
25
25
  from gevent.hub import Hub
26
+ from gevent.pool import Pool
26
27
  from gevent.select import poll, POLLIN, POLLOUT
27
28
  from gevent.socket import SHUT_RDWR
28
- from gevent.pool import Pool
29
29
  from ssh2.exceptions import AgentConnectionError, AgentListIdentitiesError, \
30
30
  AgentAuthenticationError, AgentGetIdentityError
31
31
  from ssh2.utils import find_eol
32
32
 
33
- from ..common import _validate_pkey
33
+ from ..common import _validate_pkey, _validate_api
34
34
  from ..reader import ConcurrentRWBuffer
35
35
  from ...constants import DEFAULT_RETRIES, RETRY_DELAY
36
36
  from ...exceptions import UnknownHostError, AuthenticationError, \
@@ -226,6 +226,8 @@ class BaseSSHClient(PollMixIn):
226
226
  _auth_thread_pool=True,
227
227
  identity_auth=True,
228
228
  ipv6_only=False,
229
+ compress=False,
230
+ keyboard_interactive=False,
229
231
  ):
230
232
  super(PollMixIn, self).__init__()
231
233
  self._auth_thread_pool = _auth_thread_pool
@@ -233,6 +235,7 @@ class BaseSSHClient(PollMixIn):
233
235
  self.alias = alias
234
236
  self.user = user if user else getuser()
235
237
  self.password = password
238
+ self.keyboard_interactive = keyboard_interactive
236
239
  self.port = port if port else 22
237
240
  self.num_retries = num_retries
238
241
  self.timeout = timeout if timeout else None
@@ -245,6 +248,9 @@ class BaseSSHClient(PollMixIn):
245
248
  self.identity_auth = identity_auth
246
249
  self._keepalive_greenlet = None
247
250
  self.ipv6_only = ipv6_only
251
+ self.compress = compress
252
+ self.keyboard_interactive = keyboard_interactive
253
+ _validate_api(self.keyboard_interactive, self.password)
248
254
  self._pool = Pool()
249
255
  self._init()
250
256
 
@@ -437,7 +443,7 @@ class BaseSSHClient(PollMixIn):
437
443
  msg = "No remaining authentication methods"
438
444
  logger.error(msg)
439
445
  raise AuthenticationError(msg)
440
- logger.debug("Private key auth failed, trying password")
446
+ logger.debug("Private key auth failed or not enabled, trying password")
441
447
  self._password_auth()
442
448
 
443
449
  def _agent_auth(self):
pssh/clients/common.py CHANGED
@@ -1,23 +1,26 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
+ import logging
18
19
  import os
19
20
 
20
- from ..exceptions import PKeyFileError
21
+ from ..exceptions import PKeyFileError, InvalidAPIUseError
22
+
23
+ logger = logging.getLogger('pssh')
21
24
 
22
25
 
23
26
  def _validate_pkey_path(pkey):
@@ -39,3 +42,10 @@ def _validate_pkey(pkey):
39
42
  if isinstance(pkey, str):
40
43
  return _validate_pkey_path(pkey)
41
44
  return pkey
45
+
46
+
47
+ def _validate_api(keyboard_interactive, password):
48
+ if keyboard_interactive and not password:
49
+ msg = "Keyboard interactive authentication is enabled but no password is provided - cannot continue"
50
+ logger.error(msg)
51
+ raise InvalidAPIUseError(msg)
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  # flake8: noqa: F401
19
19
  from .parallel import ParallelSSHClient
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  import logging
19
19
 
@@ -37,6 +37,8 @@ class ParallelSSHClient(BaseParallelSSHClient):
37
37
  forward_ssh_agent=False,
38
38
  keepalive_seconds=60, identity_auth=True,
39
39
  ipv6_only=False,
40
+ compress=False,
41
+ keyboard_interactive=False,
40
42
  ):
41
43
  """
42
44
  :param hosts: Hosts to connect to
@@ -115,9 +117,17 @@ class ParallelSSHClient(BaseParallelSSHClient):
115
117
  for the host(s) or raise NoIPv6AddressFoundError otherwise. Note this will
116
118
  disable connecting to an IPv4 address if an IP address is provided instead.
117
119
  :type ipv6_only: bool
120
+ :param compress: Enable/Disable compression on the client. Defaults to off.
121
+ :type compress: bool
122
+ :param keyboard_interactive: Enable/Disable keyboard interactive authentication with provided username and
123
+ password. An `InvalidAPIUse` error is raised when keyboard_interactive is enabled without a provided password.
124
+ Defaults to off.
125
+ :type keyboard_interactive: bool
118
126
 
119
127
  :raises: :py:class:`pssh.exceptions.PKeyFileError` on errors finding
120
128
  provided private key.
129
+ :raises: :py:class:`pssh.exceptions.InvalidAPIUseError` when `keyboard_interactive=True` with no password
130
+ provided.
121
131
  """
122
132
  BaseParallelSSHClient.__init__(
123
133
  self, hosts, user=user, password=password, port=port, pkey=pkey,
@@ -126,6 +136,8 @@ class ParallelSSHClient(BaseParallelSSHClient):
126
136
  host_config=host_config, retry_delay=retry_delay,
127
137
  identity_auth=identity_auth,
128
138
  ipv6_only=ipv6_only,
139
+ compress=compress,
140
+ keyboard_interactive=keyboard_interactive,
129
141
  )
130
142
  self.proxy_host = proxy_host
131
143
  self.proxy_port = proxy_port
@@ -232,6 +244,7 @@ class ParallelSSHClient(BaseParallelSSHClient):
232
244
  keepalive_seconds=cfg.keepalive_seconds or self.keepalive_seconds,
233
245
  identity_auth=cfg.identity_auth or self.identity_auth,
234
246
  ipv6_only=cfg.ipv6_only or self.ipv6_only,
247
+ compress=cfg.compress or self.compress,
235
248
  )
236
249
  return _client
237
250
 
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  from collections import deque
19
19
 
@@ -27,7 +27,7 @@ from gevent.timeout import Timeout as GTimeout
27
27
  from ssh2.error_codes import LIBSSH2_ERROR_EAGAIN
28
28
  from ssh2.exceptions import SFTPHandleError, SFTPProtocolError, \
29
29
  Timeout as SSH2Timeout
30
- from ssh2.session import Session, LIBSSH2_SESSION_BLOCK_INBOUND, LIBSSH2_SESSION_BLOCK_OUTBOUND
30
+ from ssh2.session import Session, LIBSSH2_SESSION_BLOCK_INBOUND, LIBSSH2_SESSION_BLOCK_OUTBOUND, LIBSSH2_FLAG_COMPRESS
31
31
  from ssh2.sftp import LIBSSH2_FXF_READ, LIBSSH2_FXF_CREAT, LIBSSH2_FXF_WRITE, \
32
32
  LIBSSH2_FXF_TRUNC, LIBSSH2_SFTP_S_IRUSR, LIBSSH2_SFTP_S_IRGRP, \
33
33
  LIBSSH2_SFTP_S_IWUSR, LIBSSH2_SFTP_S_IXUSR, LIBSSH2_SFTP_S_IROTH, \
@@ -110,6 +110,8 @@ class SSHClient(BaseSSHClient):
110
110
  keepalive_seconds=60,
111
111
  identity_auth=True,
112
112
  ipv6_only=False,
113
+ compress=False,
114
+ keyboard_interactive=False,
113
115
  ):
114
116
  """
115
117
  :param host: Host name or IP to connect to.
@@ -158,9 +160,17 @@ class SSHClient(BaseSSHClient):
158
160
  for the host or raise NoIPv6AddressFoundError otherwise. Note this will
159
161
  disable connecting to an IPv4 address if an IP address is provided instead.
160
162
  :type ipv6_only: bool
163
+ :param compress: Enable/Disable compression on the client. Defaults to off.
164
+ :type compress: bool
165
+ :param keyboard_interactive: Enable/Disable keyboard interactive authentication with provided username and
166
+ password. An `InvalidAPIUse` error is raised when keyboard_interactive is enabled without a provided password.
167
+ Defaults to off.
168
+ :type keyboard_interactive: bool
161
169
 
162
170
  :raises: :py:class:`pssh.exceptions.PKeyFileError` on errors finding
163
171
  provided private key.
172
+ :raises: :py:class:`pssh.exceptions.InvalidAPIUseError` when `keyboard_interactive=True` with no password
173
+ provided.
164
174
  """
165
175
  self.forward_ssh_agent = forward_ssh_agent
166
176
  self._forward_requested = False
@@ -182,6 +192,8 @@ class SSHClient(BaseSSHClient):
182
192
  timeout=timeout,
183
193
  keepalive_seconds=keepalive_seconds,
184
194
  identity_auth=identity_auth,
195
+ compress=compress,
196
+ keyboard_interactive=keyboard_interactive,
185
197
  )
186
198
  proxy_host = '127.0.0.1'
187
199
  self._chan_stdout_lock = RLock()
@@ -194,6 +206,8 @@ class SSHClient(BaseSSHClient):
194
206
  proxy_host=proxy_host, proxy_port=proxy_port,
195
207
  identity_auth=identity_auth,
196
208
  ipv6_only=ipv6_only,
209
+ compress=compress,
210
+ keyboard_interactive=keyboard_interactive,
197
211
  )
198
212
 
199
213
  def _shell(self, channel):
@@ -206,7 +220,10 @@ class SSHClient(BaseSSHClient):
206
220
  allow_agent=True, timeout=None,
207
221
  forward_ssh_agent=False,
208
222
  keepalive_seconds=60,
209
- identity_auth=True):
223
+ identity_auth=True,
224
+ compress=False,
225
+ keyboard_interactive=False,
226
+ ):
210
227
  assert isinstance(self.port, int)
211
228
  try:
212
229
  self._proxy_client = SSHClient(
@@ -216,6 +233,8 @@ class SSHClient(BaseSSHClient):
216
233
  timeout=timeout, forward_ssh_agent=forward_ssh_agent,
217
234
  identity_auth=identity_auth,
218
235
  keepalive_seconds=keepalive_seconds,
236
+ compress=compress,
237
+ keyboard_interactive=keyboard_interactive,
219
238
  _auth_thread_pool=False)
220
239
  except Exception as ex:
221
240
  msg = "Proxy authentication failed. " \
@@ -263,6 +282,8 @@ class SSHClient(BaseSSHClient):
263
282
 
264
283
  def _init_session(self, retries=1):
265
284
  self.session = Session()
285
+ if self.compress:
286
+ self.session.flag(LIBSSH2_FLAG_COMPRESS)
266
287
 
267
288
  if self.timeout:
268
289
  # libssh2 timeout is in ms
@@ -310,7 +331,9 @@ class SSHClient(BaseSSHClient):
310
331
  )
311
332
 
312
333
  def _password_auth(self):
313
- self.session.userauth_password(self.user, self.password)
334
+ if self.keyboard_interactive:
335
+ return self.session.userauth_keyboardinteractive(self.user, self.password)
336
+ return self.session.userauth_password(self.user, self.password)
314
337
 
315
338
  def _open_session(self):
316
339
  chan = self.eagain(self.session.open_session)
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  import atexit
19
19
  import logging
pssh/clients/reader.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  from io import BytesIO
19
19
 
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  # flake8: noqa: F401
19
19
  from .parallel import ParallelSSHClient
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  import logging
19
19
 
@@ -40,6 +40,7 @@ class ParallelSSHClient(BaseParallelSSHClient):
40
40
  gssapi_delegate_credentials=False,
41
41
  identity_auth=True,
42
42
  ipv6_only=False,
43
+ compress=False,
43
44
  ):
44
45
  """
45
46
  :param hosts: Hosts to connect to
@@ -114,6 +115,8 @@ class ParallelSSHClient(BaseParallelSSHClient):
114
115
  for the host or raise NoIPv6AddressFoundError otherwise. Note this will
115
116
  disable connecting to an IPv4 address if an IP address is provided instead.
116
117
  :type ipv6_only: bool
118
+ :param compress: Enable/Disable compression on the client. Defaults to off.
119
+ :type compress: bool
117
120
 
118
121
  :raises: :py:class:`pssh.exceptions.PKeyFileError` on errors finding
119
122
  provided private key.
@@ -125,6 +128,7 @@ class ParallelSSHClient(BaseParallelSSHClient):
125
128
  host_config=host_config, retry_delay=retry_delay,
126
129
  identity_auth=identity_auth,
127
130
  ipv6_only=ipv6_only,
131
+ compress=compress,
128
132
  )
129
133
  self.pkey = _validate_pkey(pkey)
130
134
  self.cert_file = _validate_pkey_path(cert_file)
@@ -228,5 +232,6 @@ class ParallelSSHClient(BaseParallelSSHClient):
228
232
  gssapi_client_identity=self.gssapi_client_identity,
229
233
  gssapi_delegate_credentials=self.gssapi_delegate_credentials,
230
234
  cert_file=cfg.cert_file,
235
+ compress=cfg.compress or self.compress,
231
236
  )
232
237
  return _client
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  import logging
19
19
  from gevent import sleep, spawn, Timeout as GTimeout, joinall
@@ -50,6 +50,7 @@ class SSHClient(BaseSSHClient):
50
50
  gssapi_client_identity=None,
51
51
  gssapi_delegate_credentials=False,
52
52
  ipv6_only=False,
53
+ compress=False,
53
54
  _auth_thread_pool=True):
54
55
  """:param host: Host name or IP to connect to.
55
56
  :type host: str
@@ -107,6 +108,8 @@ class SSHClient(BaseSSHClient):
107
108
  for the host or raise NoIPv6AddressFoundError otherwise. Note this will
108
109
  disable connecting to an IPv4 address if an IP address is provided instead.
109
110
  :type ipv6_only: bool
111
+ :param compress: Enable/Disable compression on the client. Defaults to off.
112
+ :type compress: bool
110
113
 
111
114
  :raises: :py:class:`pssh.exceptions.PKeyFileError` on errors finding
112
115
  provided private key.
@@ -124,6 +127,7 @@ class SSHClient(BaseSSHClient):
124
127
  timeout=timeout,
125
128
  identity_auth=identity_auth,
126
129
  ipv6_only=ipv6_only,
130
+ compress=compress,
127
131
  )
128
132
 
129
133
  def _disconnect(self):
@@ -151,6 +155,8 @@ class SSHClient(BaseSSHClient):
151
155
  self.session = Session()
152
156
  self.session.options_set(options.USER, self.user)
153
157
  self.session.options_set(options.HOST, self.host)
158
+ if self.compress:
159
+ self.session.options_set(options.COMPRESSION, "yes")
154
160
  self.session.options_set_port(self.port)
155
161
  if self.gssapi_server_identity:
156
162
  self.session.options_set(
pssh/config.py CHANGED
@@ -1,23 +1,25 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
19
19
  """Host specific configuration."""
20
20
 
21
+ from .exceptions import InvalidAPIUseError
22
+
21
23
 
22
24
  class HostConfig(object):
23
25
  """Host configuration for ParallelSSHClient.
@@ -29,7 +31,7 @@ class HostConfig(object):
29
31
  'proxy_host', 'proxy_port', 'proxy_user', 'proxy_password', 'proxy_pkey',
30
32
  'keepalive_seconds', 'ipv6_only', 'cert_file', 'auth_thread_pool', 'gssapi_auth',
31
33
  'gssapi_server_identity', 'gssapi_client_identity', 'gssapi_delegate_credentials',
32
- 'forward_ssh_agent',
34
+ 'forward_ssh_agent', 'compress', 'keyboard_interactive',
33
35
  )
34
36
 
35
37
  def __init__(self, user=None, port=None, password=None, private_key=None,
@@ -46,6 +48,8 @@ class HostConfig(object):
46
48
  gssapi_client_identity=None,
47
49
  gssapi_delegate_credentials=False,
48
50
  forward_ssh_agent=False,
51
+ compress=False,
52
+ keyboard_interactive=False,
49
53
  ):
50
54
  """
51
55
  :param user: Username to login as.
@@ -99,6 +103,15 @@ class HostConfig(object):
99
103
  :param gssapi_delegate_credentials: Enable/disable server credentials
100
104
  delegation. (pssh.clients.ssh only)
101
105
  :type gssapi_delegate_credentials: bool
106
+ :param compress: Enable/Disable compression on the client. Defaults to off.
107
+ :type compress: bool
108
+ :param keyboard_interactive: Enable/Disable keyboard interactive authentication with provided username and
109
+ password. An `InvalidAPIUse` error is raised when keyboard_interactive is enabled without a provided password.
110
+ Defaults to off.
111
+ :type keyboard_interactive: bool
112
+
113
+ :raises: :py:class:`pssh.exceptions.InvalidAPIUseError` when `keyboard_interactive=True` with no password
114
+ provided.
102
115
  """
103
116
  self.user = user
104
117
  self.port = port
@@ -124,6 +137,10 @@ class HostConfig(object):
124
137
  self.gssapi_server_identity = gssapi_server_identity
125
138
  self.gssapi_client_identity = gssapi_client_identity
126
139
  self.gssapi_delegate_credentials = gssapi_delegate_credentials
140
+ self.compress = compress
141
+ self.keyboard_interactive = keyboard_interactive
142
+ if self.keyboard_interactive and not self.password:
143
+ raise InvalidAPIUseError("Keyboard interactive authentication is enabled but no password is provided")
127
144
  self._sanity_checks()
128
145
 
129
146
  def _sanity_checks(self):
@@ -181,3 +198,7 @@ class HostConfig(object):
181
198
  raise ValueError("GSSAPI client identity %s is not a string", self.gssapi_client_identity)
182
199
  if self.gssapi_delegate_credentials is not None and not isinstance(self.gssapi_delegate_credentials, bool):
183
200
  raise ValueError("GSSAPI delegate credentials %s is not a bool", self.gssapi_delegate_credentials)
201
+ if self.compress is not None and not isinstance(self.compress, bool):
202
+ raise ValueError("Compress %s is not a bool", self.compress)
203
+ if self.keyboard_interactive is not None and not isinstance(self.keyboard_interactive, bool):
204
+ raise ValueError("keyboard_interactive %s is not a bool", self.keyboard_interactive)
pssh/constants.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
19
19
  """Constants definitions for pssh package"""
pssh/exceptions.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
19
19
  """Exceptions raised by parallel-ssh classes."""
@@ -100,3 +100,7 @@ class ShellError(Exception):
100
100
 
101
101
  class HostConfigError(Exception):
102
102
  """Raised on invalid host configuration"""
103
+
104
+
105
+ class InvalidAPIUseError(Exception):
106
+ """Raised on invalid use of library API"""
pssh/output.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
19
19
  """Output module of ParallelSSH"""
pssh/utils.py CHANGED
@@ -1,19 +1,19 @@
1
- # This file is part of parallel-ssh.
1
+ # This file is part of parallel-ssh.
2
+ # Copyright (C) 2014-2025 Panos Kittenis.
3
+ # Copyright (C) 2014-2025 parallel-ssh Contributors.
2
4
  #
3
- # Copyright (C) 2014-2022 Panos Kittenis and contributors.
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation, version 2.1.
4
8
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation, version 2.1.
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
8
13
  #
9
- # This library is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
- # Lesser General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU Lesser General Public
15
- # License along with this library; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
 
19
19
  """Module containing static utility functions for parallel-ssh."""
@@ -1,27 +0,0 @@
1
- pssh/__init__.py,sha256=W7jdMnEJJfpd3LbTxdzOkjvspMs6VIHyZ0FH-eJGuOU,1444
2
- pssh/_version.py,sha256=ORfZeFepHteZV6a-ErdSrZvIosQNSSEdGlc5mCrLh0Q,24494
3
- pssh/config.py,sha256=xM0zRWY0Noig273Ki32pTw5U9ybV_NEBEUKGTX9Pp1c,10050
4
- pssh/constants.py,sha256=toVllZuLBKxLYB8fuY_46UoPjmAA3J59oH1wS4OlL7g,1056
5
- pssh/exceptions.py,sha256=ZjnrT_Ye1v4OH582jNwYUCkI4NVgujCWwu8aB8XymUM,2561
6
- pssh/output.py,sha256=0pkyaUxTY4Oi36GYbGTNvPbxZRA2qC0aeXYoq9XXuR8,4665
7
- pssh/utils.py,sha256=qdsVnKGxZovWGZpGS3eUyrfCaeWTKX7yETfA29zbLMk,1802
8
- pssh/clients/__init__.py,sha256=QzNb1FcbjQyxEPtRbog-ZOidMRu0zA718PkRz21SMmQ,836
9
- pssh/clients/common.py,sha256=fd_jJj8ezDjwr3peN3LonLff5EYSNkMEre0yjlnRjBU,1375
10
- pssh/clients/reader.py,sha256=9boQMv9xUBGLY53OybJmWvfa6qsA6mudfdfXk4sF2Oc,3092
11
- pssh/clients/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- pssh/clients/base/parallel.py,sha256=GZEYNpg-sOCfKcM-jaAaxdW2Ln4_A_f77qhmCbsdll8,24595
13
- pssh/clients/base/single.py,sha256=_Txr04S11LADbRekTvpS2xBf4C9UV3rTEZ22tPOTdfo,27013
14
- pssh/clients/native/__init__.py,sha256=dydX5Fae9U9gRBT8koPTM8H9u4t0rIgD1q9XammFYSs,865
15
- pssh/clients/native/parallel.py,sha256=AjOJoLdhyyUKWp4Leda08cXC-SsyT16XK4PExiOl3-c,24119
16
- pssh/clients/native/single.py,sha256=AQWmq_uBUFhZDkX6Cn0jR21BVd8twcYu_UhwMJYex9U,34388
17
- pssh/clients/native/tunnel.py,sha256=xMfn75O32E-ZzVTFkA7DeHZOO0MXFSGn4aqGHNIb2lc,10650
18
- pssh/clients/ssh/__init__.py,sha256=HgYZkVJ5QOgaVFp5snwyLZvQbp0Tbdxj8Gbyic2_Ibo,857
19
- pssh/clients/ssh/parallel.py,sha256=2X47tgPklubHbb7RjUk75IZjidbbOdJq3VstH3KU6KM,11397
20
- pssh/clients/ssh/single.py,sha256=z9_OQKYyxOMnTixycZLuBoU2GjQYO_I-VL_L3GddwKo,14068
21
- parallel_ssh-2.14.0.dist-info/COPYING,sha256=ZA2Q9u5AEkH_YoNNDRsz-DBJ6ZuL_foE7RsKFjXd4-c,18093
22
- parallel_ssh-2.14.0.dist-info/COPYING.LESSER,sha256=AKibDRiqzUEU3s95Ei24e_Nb3a8rxQ44PJyfTCYzkLI,24486
23
- parallel_ssh-2.14.0.dist-info/LICENSE,sha256=m4cqigcLitMpxL04D7G_AAD1ZMdQI-yOHmgD8VNkuek,26461
24
- parallel_ssh-2.14.0.dist-info/METADATA,sha256=Y2Vjl44EdOIuyRpZx2Feav-OLD_6yiiB3u6ly5LgVGc,10730
25
- parallel_ssh-2.14.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
26
- parallel_ssh-2.14.0.dist-info/top_level.txt,sha256=s8P6ZHOwt2BYgDc62Cpd2z7i-rebGzIhhnO09pger0U,5
27
- parallel_ssh-2.14.0.dist-info/RECORD,,