projects/guix·blob librewolf-updates · refs

1191 lines · 47.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2023, 2025 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2014 Andreas Enge <[email protected]>
4;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email protected]>
5;;; Copyright © 2015, 2016, 2018-2022, 2024, 2025 Efraim Flashner <[email protected]>
6;;; Copyright © 2016, 2019 Leo Famulari <[email protected]>
7;;; Copyright © 2016, 2021, 2023 Nicolas Goaziou <[email protected]>
8;;; Copyright © 2016 Christine Lemmer-Webber <[email protected]>
9;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2017 Stefan Reichör <[email protected]>
11;;; Copyright © 2017 Ricardo Wurmus <[email protected]>
12;;; Copyright © 2017 Nikita <[email protected]>
13;;; Copyright © 2018 Manuel Graf <[email protected]>
14;;; Copyright © 2019 Gábor Boskovits <[email protected]>
15;;; Copyright © 2019, 2020 Mathieu Othacehe <[email protected]>
16;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
17;;; Copyright © 2020 Oleg Pykhalov <[email protected]>
18;;; Copyright © 2020, 2021, 2022, 2025 Maxim Cournoyer <[email protected]>
19;;; Copyright © 2021 Brice Waegeneire <[email protected]>
20;;; Copyright © 2023 Simon Streit <[email protected]>
21;;; Copyright © 2024 Zheng Junjie <[email protected]>
22;;; Copyright © 2024, 2025 Ashish SHUKLA <[email protected]>
23;;; Copyright © 2024, 2025 Sharlatan Hellseher <[email protected]>
24;;; Copyright © 2025 Ghislain Vaillant <[email protected]>
25;;; Copyright © 2025 Cayetano Santos <[email protected]>
26;;; Copyright © 2026 Patrick Norton <[email protected]>
27;;;
28;;; This file is part of GNU Guix.
29;;;
30;;; GNU Guix is free software; you can redistribute it and/or modify it
31;;; under the terms of the GNU General Public License as published by
32;;; the Free Software Foundation; either version 3 of the License, or (at
33;;; your option) any later version.
34;;;
35;;; GNU Guix is distributed in the hope that it will be useful, but
36;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38;;; GNU General Public License for more details.
39;;;
40;;; You should have received a copy of the GNU General Public License
41;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42
43(define-module (gnu packages ssh)
44 #:use-module (guix gexp)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages admin)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bash)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages crypto)
54 #:use-module (gnu packages elf)
55 #:use-module (gnu packages gnupg)
56 #:use-module (gnu packages golang-build)
57 #:use-module (gnu packages golang-xyz)
58 #:use-module (gnu packages gperf)
59 #:use-module (gnu packages groff)
60 #:use-module (gnu packages guile)
61 #:use-module (gnu packages libedit)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages logging)
64 #:use-module (gnu packages m4)
65 #:use-module (gnu packages multiprecision)
66 #:use-module (gnu packages ncurses)
67 #:use-module (gnu packages nettle)
68 #:use-module (gnu packages kerberos)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages popt)
72 #:use-module (gnu packages protobuf)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages python-build)
75 #:use-module (gnu packages python-crypto)
76 #:use-module (gnu packages python-web)
77 #:use-module (gnu packages python-xyz)
78 #:use-module (gnu packages readline)
79 #:use-module (gnu packages security-token)
80 #:use-module (gnu packages texinfo)
81 #:use-module (gnu packages tls)
82 #:use-module (gnu packages xorg)
83 #:use-module (guix build-system cmake)
84 #:use-module (guix build-system gnu)
85 #:use-module (guix build-system go)
86 #:use-module (guix build-system python)
87 #:use-module (guix build-system pyproject)
88 #:use-module (guix download)
89 #:use-module (guix git-download)
90 #:use-module (guix gexp)
91 #:use-module ((guix licenses) #:prefix license:)
92 #:use-module (guix packages)
93 #:use-module (guix utils)
94 #:use-module (srfi srfi-1))
95
96(define-public hss
97 (package
98 (name "hss")
99 (version "1.10")
100 (source (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://github.com/six-ddc/hss")
104 (commit version)))
105 (file-name (git-file-name name version))
106 (sha256
107 (base32
108 "1xriqqp89nbzzx1q2jii3ylh3izmf48n5cpyz9ml7gcnzs04vd98"))))
109 (inputs
110 (list readline))
111 (arguments
112 (list #:make-flags
113 #~(list (string-append "CC=" #$(cc-for-target))
114 (string-append "INSTALL_BIN=" #$output "/bin"))
115 #:tests? #f ; no tests
116 #:phases
117 #~(modify-phases %standard-phases
118 (add-after 'unpack 'patch-file-names
119 (lambda _
120 (substitute* "Makefile"
121 (("/usr/local/opt/readline")
122 #$(this-package-input "readline")))))
123 (delete 'configure)))) ; no configure script
124 (build-system gnu-build-system)
125 (home-page "https://github.com/six-ddc/hss/")
126 (synopsis "Interactive SSH client for multiple servers")
127 (description
128 "@command{hss} is an interactive SSH client for multiple servers. Commands
129are executed on all servers in parallel. Execution on one server does not need
130to wait for that on another server to finish before starting. One can run a
131command on hundreds of servers at the same time, with almost the same experience
132as a local Bash shell.
133
134It supports:
135@itemize @bullet
136@item interactive input: based on GNU readline.
137@item history: responding to the @kbd{C-r} key.
138@item auto-completion: @key{TAB}-completion from remote servers for commands and
139file names.
140@end itemize\n")
141 (license license:expat)))
142
143(define-public libssh
144 (package
145 (name "libssh")
146 (version "0.12.0")
147 (source (origin
148 (method url-fetch)
149 (uri (string-append "https://www.libssh.org/files/"
150 (version-major+minor version)
151 "/libssh-" version ".tar.xz"))
152 (sha256
153 (base32
154 "08bidaiq4z911zl3v7xc2zb6s8i4p7syfpsfxznmwzijv0jg8shs"))))
155 (build-system cmake-build-system)
156 (outputs '("out" "debug"))
157 (arguments
158 (list
159 ;; Even as few as 6 processors have been reported to cause test
160 ;; failures, see
161 ;; https://codeberg.org/guix/guix/pulls/6776#issuecomment-11085680
162 #:parallel-tests? #f
163 #:configure-flags
164 #~(list #$@(if (%current-target-system)
165 #~()
166 #~("-DUNIT_TESTING=ON")))
167 #:phases
168 #~(modify-phases %standard-phases
169 (add-after 'unpack 'patch-commands
170 (lambda* (#:key inputs #:allow-other-keys)
171 ;; Runtime sources.
172 (substitute* '("src/config.c"
173 "src/socket.c")
174 (("\"/bin/sh\"")
175 (format #f "~s" (search-input-file inputs "/bin/sh"))))
176 ;; Test sources.
177 (substitute* '("tests/server/test_server/default_cb.c")
178 (("\"/bin/sh\"")
179 (format #f "~s" (which "sh"))))))
180 #$@(if (system-hurd?)
181 #~((add-after 'unpack 'skip-tests-hurd
182 ;; these subtests require an ipv6 address
183 ;; torture_config_match_localnetwork_string
184 ;; torture_config_match_localnetwork_file
185 (lambda _
186 (substitute* "tests/unittests/CMakeLists.txt"
187 (("torture_config_match_localnetwork") "")))))
188 #~())
189 #$@(if (target-ppc32?)
190 #~((add-after 'unpack 'skip-torture-test
191 ;; This test times out after 1500 seconds.
192 (lambda _
193 (substitute* "tests/unittests/CMakeLists.txt"
194 (("torture_threads_pki_rsa") "")))))
195 #~()))))
196 (native-inputs (list cmocka))
197 (inputs (list bash-minimal libsodium mit-krb5 openssl zlib))
198 (synopsis "SSH client library")
199 (description
200 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for client
201and server implementations. With libssh, you can remotely execute programs,
202transfer files, and use a secure and transparent tunnel for your remote
203applications.")
204 (home-page "https://www.libssh.org")
205 (license license:lgpl2.1+)))
206
207(define-public libssh2
208 (package
209 (name "libssh2")
210 (version "1.11.1")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append
214 "https://www.libssh2.org/download/libssh2-"
215 version ".tar.gz"))
216 (sha256
217 (base32
218 "1xsqysmrq40gdfjndd1yrcvwic16kn4jrzir6pn8xfadwg5pdv6r"))))
219 (build-system gnu-build-system)
220 ;; The installed libssh2.pc file does not include paths to openssl and
221 ;; zlib libraries, so we need to propagate the inputs.
222 (propagated-inputs (list openssl zlib))
223 (arguments
224 (list #:configure-flags #~'("--with-crypto=openssl"
225 "--disable-static"
226 "--disable-docker-tests")))
227 (synopsis "Client-side C library implementing the SSH2 protocol")
228 (description
229 "libssh2 is a library intended to allow software developers access to
230the SSH-2 protocol in an easy-to-use self-contained package. It can be built
231into an application to perform many different tasks when communicating with
232a server that supports the SSH-2 protocol.")
233 (license license:bsd-3)
234 (home-page "https://www.libssh2.org/")))
235
236(define-public openssh
237 (package
238 (name "openssh")
239 (version "10.2p1")
240 (source
241 (origin
242 (method url-fetch)
243 (uri (string-append "mirror://openbsd/OpenSSH/portable/"
244 "openssh-" version ".tar.gz"))
245 (patches (search-patches "openssh-trust-guix-store-directory.patch"))
246 (sha256
247 (base32 "1clqyxh6mrbwjg964df0hjwmd361mxnx3nx17wk5jyck3422ri6c"))))
248 (build-system gnu-build-system)
249 (arguments
250 (list
251 #:test-target "tests"
252 ;; Not all of the tests can be run in parallel, see
253 ;; <https://marc.info/?l=openssh-unix-dev&m=170313565518842>.
254 #:parallel-tests? #f
255 ;; Otherwise, the test scripts try to use a nonexistent directory and fail.
256 #:make-flags
257 #~(list "REGRESSTMP=\"$${BUILDDIR}/regress\"")
258 #:configure-flags
259 #~(append
260 (list "--sysconfdir=/etc/ssh"
261 ;; Default value of 'PATH' used by sshd.
262 "--with-default-path=/run/current-system/profile/bin"
263 ;; configure needs to find krb5-config.
264 (string-append "--with-kerberos5="
265 #$(this-package-input "mit-krb5")
266 "/bin")
267 ;; libedit is needed for sftp completion.
268 "--with-libedit")
269 ;; Enable PAM support in sshd.
270 (if #$(target-hurd?)
271 '()
272 (list "--with-pam"
273 ;; Support creation and use of ecdsa-sk, ed25519-sk keys.
274 "--with-security-key-builtin"))
275 ;; "make install" runs "install -s" by default, which doesn't work for
276 ;; cross-compiled binaries because it invokes 'strip' instead of
277 ;; 'TRIPLET-strip'. Work around this.
278 (if #$(%current-target-system)
279 (list "--disable-strip")
280 '()))
281 #:phases
282 #~(modify-phases %standard-phases
283 (add-after 'configure 'set-store-location
284 (lambda _
285 (substitute* "misc.c"
286 (("@STORE_DIRECTORY@")
287 (string-append "\"" (%store-directory) "/\"")))))
288 (add-before 'check 'patch-tests
289 (lambda _
290 (substitute* "regress/test-exec.sh"
291 (("/bin/sh") (which "sh")))
292
293 ;; Remove 't-exec' regress target which requires user 'sshd'.
294 (substitute* (list "Makefile"
295 "regress/Makefile")
296 (("^(tests:.*) t-exec(.*)" all pre post)
297 (string-append pre post)))))
298 (replace 'install
299 (lambda* (#:key (make-flags '()) #:allow-other-keys)
300 ;; Don't create /var/empty.
301 (substitute* "Makefile"
302 ((".*MKDIR_P.*PRIVSEP_PATH.*") ""))
303 ;; Install without host keys and system configuration files.
304 (apply invoke "make" "install-nosysconf" make-flags)
305 (with-directory-excursion "contrib"
306 (chmod "ssh-copy-id" #o555)
307 (install-file "ssh-copy-id"
308 (string-append #$output "/bin/"))
309 (install-file "ssh-copy-id.1"
310 (string-append #$output "/share/man/man1/"))))))))
311 (native-inputs (list groff pkg-config))
312 (inputs
313 (cons* libedit
314 openssl
315 mit-krb5
316 zlib
317 xauth ; for 'ssh -X' and 'ssh -Y'
318 (if (target-hurd?)
319 '()
320 (list linux-pam
321 libfido2)))) ; fails to build on GNU/Hurd
322 (synopsis "Client and server for the secure shell (ssh) protocol")
323 (description
324 "The SSH2 protocol implemented in OpenSSH is standardised by the
325IETF secsh working group and is specified in several RFCs and drafts.
326It is composed of three layered components:
327
328The transport layer provides algorithm negotiation and a key exchange.
329The key exchange includes server authentication and results in a
330cryptographically secured connection: it provides integrity, confidentiality
331and optional compression.
332
333The user authentication layer uses the established connection and relies on
334the services provided by the transport layer. It provides several mechanisms
335for user authentication. These include traditional password authentication
336as well as public-key or host-based authentication mechanisms.
337
338The connection layer multiplexes many different concurrent channels over the
339authenticated connection and allows tunneling of login sessions and
340TCP-forwarding. It provides a flow control service for these channels.
341Additionally, various channel-specific options can be negotiated.")
342 (license (license:non-copyleft "file://LICENSE"
343 "See LICENSE in the distribution."))
344 (properties
345 '((release-monitoring-url . "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/")))
346 (home-page "https://www.openssh.com/")))
347
348;; Deprecation added on 2025-11-18.
349(define-deprecated-package lsh openssh)
350
351;; OpenSSH without X support. This allows using OpenSSH without dragging X
352;; libraries to the closure.
353(define-public openssh-sans-x
354 (package
355 (inherit openssh)
356 (name "openssh-sans-x")
357 (inputs (modify-inputs (package-inputs openssh)
358 (delete "xauth")))
359 (synopsis "OpenSSH client and server without X11 support")))
360
361(define-public hpn-ssh
362 (package
363 (inherit openssh)
364 (name "hpn-ssh")
365 (version "18.8.0")
366 (source
367 (origin
368 (inherit (package-source openssh))
369 (method git-fetch)
370 (uri
371 (git-reference
372 (url "https://github.com/rapier1/hpn-ssh")
373 (commit (string-append "hpn-" version))))
374 (file-name (git-file-name name version))
375 (sha256 (base32 "13g7b652rf9lqlp492fiyi8ypf04v65ar3z174gjmkskl77m4b7k"))))
376 (arguments
377 (substitute-keyword-arguments (package-arguments openssh)
378 ((#:configure-flags flags #~(list))
379 #~(cons* "--with-privsep-user=sshd"
380 "--with-pam-service=sshd"
381 #$flags))
382 ((#:modules mods %default-gnu-modules)
383 (cons '(ice-9 string-fun) mods))
384 ((#:imported-modules mods %default-gnu-imported-modules)
385 (cons '(ice-9 string-fun) mods))
386 ((#:phases phases #~(list))
387 #~(modify-phases #$phases
388 (add-after 'unpack 'patch-ssh-stuff
389 (lambda _
390 (substitute* "Makefile.in"
391 (("^sysconfdir=.*$")
392 "sysconfdir=/etc/ssh\n")
393 ((".*MKDIR_P.*PRIVSEP_PATH.*")
394 ""))
395 (substitute* "ssh.h"
396 (("#define HPNSSH_DEFAULT_PORT.*$")
397 "#define HPNSSH_DEFAULT_PORT 22\n"))))
398 (replace 'install
399 (lambda* (#:key (make-flags '()) #:allow-other-keys)
400 (let ((bindir (string-append #$output "/bin"))
401 (sbindir (string-append #$output "/sbin"))
402 (mandir (string-append #$output "/share/man")))
403 ;; Install without host keys and system configuration files. This
404 ;; will install /var/empty to the store, which is needed by the
405 ;; system openssh-service-type.
406 (apply invoke "make" "install-nosysconf" make-flags)
407 ;; rename files so it can act as replacement for openssh
408 (with-directory-excursion "contrib"
409 (chmod "hpnssh-copy-id" #o555)
410 (install-file "hpnssh-copy-id" bindir)
411 (install-file "hpnssh-copy-id.1"
412 (string-append mandir "/man1/")))
413 (for-each
414 (lambda (file)
415 (when (string-prefix? (string-append bindir "/hpn") file)
416 (symlink (basename file)
417 (string-replace-substring file "/bin/hpn" "/bin/"))))
418 (find-files bindir))
419 (for-each
420 (lambda (file)
421 (when (string-prefix? (string-append sbindir "/hpn") file)
422 (symlink (basename file)
423 (string-replace-substring file "/sbin/hpn" "/sbin/"))))
424 (find-files sbindir))
425 (for-each
426 (lambda (file)
427 (when (string-prefix? "hpn" (basename file))
428 (symlink (basename file)
429 (string-replace-substring file "/hpn" "/"))))
430 (find-files mandir)))))))))
431 (native-inputs
432 (modify-inputs (package-native-inputs openssh)
433 (append autoconf automake)))
434 (synopsis "High performance SSH/SCP client, and server")
435 (description "HPN-SSH is a series of modifications to OpenSSH, the predominant implementation
436of the ssh protocol. It was originally developed to address performance issues when using ssh on high speed long distance networks.")
437 (home-page "https://hpnssh.org/")))
438
439(define-public hpn-ssh-sans-x
440 (package
441 (inherit hpn-ssh)
442 (inputs
443 (modify-inputs (package-inputs hpn-ssh)
444 (delete "xauth")))
445 (synopsis "High performance SSH/SCP client, and server without X11 support")))
446
447(define-public guile-ssh
448 (package
449 (name "guile-ssh")
450 (version "0.18.0")
451 (home-page "https://github.com/artyom-poptsov/guile-ssh")
452 (source (origin
453 (method git-fetch)
454 (uri (git-reference
455 (url home-page)
456 (commit (string-append "v" version))))
457 (file-name (git-file-name name version))
458 (sha256
459 (base32
460 "0zh1spkjl5q778y4rd6ml68fvz1r62xmk03khi4kp74z2rxgzcxb"))))
461 (build-system gnu-build-system)
462 (outputs '("out" "debug"))
463 (arguments
464 `(;; It makes no sense to build libguile-ssh.a.
465 #:configure-flags '("--disable-static")
466
467 #:phases (modify-phases %standard-phases
468 (add-before 'bootstrap 'support-cross-compilation
469 (lambda _
470 ;; Support cross-compilation:
471 ;; <https://github.com/artyom-poptsov/guile-ssh/issues/30>.
472 (substitute* "libguile-ssh/Makefile.am"
473 (("\\$\\(guile_snarf\\)")
474 "CPP=\"$(CPP)\" $(guile_snarf)"))))
475 (add-before 'build 'fix-libguile-ssh-file-name
476 (lambda* (#:key outputs #:allow-other-keys)
477 ;; Build and install libguile-ssh.so so that we can use
478 ;; its absolute file name in .scm files, before we build
479 ;; the .go files.
480 (let* ((out (assoc-ref outputs "out"))
481 (lib (string-append out "/lib")))
482 (invoke "make" "install"
483 "-C" "libguile-ssh"
484 "-j" (number->string
485 (parallel-job-count)))
486 (substitute* (find-files "." "\\.scm$")
487 (("\"libguile-ssh\"")
488 (string-append "\"" lib "/libguile-ssh\""))))))
489 ,@(if (%current-target-system)
490 '()
491 '((add-before 'check 'fix-guile-path
492 (lambda* (#:key inputs #:allow-other-keys)
493 (let ((guile (assoc-ref inputs "guile")))
494 (substitute* "tests/common.scm"
495 (("/usr/bin/guile")
496 (string-append guile "/bin/guile"))))))))
497 (add-after 'install 'remove-bin-directory
498 (lambda* (#:key outputs #:allow-other-keys)
499 (let* ((out (assoc-ref outputs "out"))
500 (bin (string-append out "/bin"))
501 (examples (string-append
502 out "/share/guile-ssh/examples")))
503 (mkdir-p examples)
504 (rename-file (string-append bin "/ssshd.scm")
505 (string-append examples "/ssshd.scm"))
506 (rename-file (string-append bin "/sssh.scm")
507 (string-append examples "/sssh.scm"))
508 (delete-file-recursively bin)))))))
509 (native-inputs (list autoconf
510 automake
511 libtool
512 texinfo
513 pkg-config
514 which
515 guile-3.0)) ;needed when cross-compiling.
516 (inputs (list guile-3.0 libssh libgcrypt))
517 (synopsis "Guile bindings to libssh")
518 (description
519 "Guile-SSH is a library that provides access to the SSH protocol for
520programs written in GNU Guile interpreter. It is a wrapper to the underlying
521libssh library.")
522 (license license:gpl3+)))
523
524(define-public guile2.2-ssh
525 (package
526 (inherit guile-ssh)
527 (name "guile2.2-ssh")
528 (native-inputs
529 (modify-inputs (package-native-inputs guile-ssh)
530 (delete "guile")
531 (prepend guile-2.2 ;needed when cross-compiling.
532 )))
533 (inputs (modify-inputs (package-inputs guile-ssh)
534 (replace "guile" guile-2.2)))))
535
536(define-public corkscrew
537 ;; The last 2.0 release hails from 2009. Use a fork (submitted upstream as
538 ;; <https://github.com/patpadgett/corkscrew/pull/5>) that adds now-essential
539 ;; IPv6 and TLS support.
540 (let ((revision "0")
541 (commit "268b71e88ee51fddceab96d665b327394f1feb12"))
542 (package
543 (name "corkscrew")
544 (version (git-version "2.0" revision commit))
545 (source
546 (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url "https://github.com/rtgill82/corkscrew")
550 (commit commit)))
551 (sha256
552 (base32 "1rylbimlfig3ii4bqr4r058lkc43pqkxnxqpqdpm31blh3xs0dcw"))
553 (file-name (git-file-name name version))))
554 (build-system gnu-build-system)
555 (arguments
556 `(#:configure-flags
557 (list "--enable-ssl")
558 #:phases
559 (modify-phases %standard-phases
560 (add-after 'unpack 'update-metadata
561 (lambda _
562 (substitute* "configure.ac"
563 ;; Our version differs significantly.
564 (("2.0") (string-append ,version " (Guix)")))
565 (substitute* "corkscrew.c"
566 ;; This domain's since been squat.
567 (("\\(agroman@agroman\\.net\\)")
568 (format #f "<~a>" ,(package-home-page this-package))))))
569 (add-after 'install 'install-documentation
570 (lambda* (#:key outputs #:allow-other-keys)
571 (let* ((out (assoc-ref outputs "out"))
572 (doc (string-append out "/share/doc/" ,name "-" ,version)))
573 (install-file "README.md" doc)
574 #t))))))
575 (native-inputs
576 (list autoconf automake pkg-config))
577 (inputs
578 (list openssl))
579 (home-page "https://github.com/patpadgett/corkscrew")
580 (synopsis "SSH tunneling through HTTP(S) proxies")
581 (description
582 "Corkscrew tunnels SSH connections through most HTTP and HTTPS proxies.
583It supports proxy authentication through the HTTP basic authentication scheme
584with optional @acronym{TLS, Transport-Level Security} to protect credentials.")
585 (license license:gpl2+))))
586
587(define-public mosh
588 (package
589 (name "mosh")
590 (version "1.4.0")
591 (source (origin
592 (method url-fetch)
593 (uri (string-append "https://mosh.org/mosh-" version ".tar.gz"))
594 (sha256
595 (base32
596 "1pax8sqlvcc7ammsxd9r53yx4m2hg1827wfz6f4rrwjx9q9lnbl7"))))
597 (build-system gnu-build-system)
598 (arguments
599 (list
600 #:phases
601 #~(modify-phases %standard-phases
602 (add-after 'unpack 'patch-FHS-file-names
603 (lambda* (#:key inputs #:allow-other-keys)
604 (substitute* "scripts/mosh.pl"
605 (("/bin/sh" shell)
606 (search-input-file inputs shell)))))
607 (add-after 'install 'wrap
608 (lambda _
609 ;; Make sure 'mosh' can find 'mosh-client' and 'mosh-server'.
610 (let ((bin (string-append #$output "/bin")))
611 (wrap-program (string-append bin "/mosh")
612 `("PATH" ":" prefix (,bin)))))))))
613 (native-inputs
614 (list pkg-config))
615 (inputs
616 (list bash-minimal
617 boost
618 ncurses
619 openssl
620 perl
621 perl-io-tty
622 protobuf
623 zlib))
624 (home-page "https://mosh.org/")
625 (synopsis "Remote shell tolerant to intermittent connectivity")
626 (description
627 "Mosh is a remote terminal application that allows client roaming, supports
628intermittent connectivity, and provides intelligent local echo and line editing
629of user keystrokes. It's a replacement for SSH that's more robust and
630responsive, especially over Wi-Fi, cellular, and long-distance links.")
631 (license license:gpl3+)))
632
633(define-public dropbear
634 (package
635 (name "dropbear")
636 (version "2025.89")
637 (source
638 (origin
639 (method url-fetch)
640 (uri (string-append
641 "https://matt.ucc.asn.au/dropbear/releases/"
642 "dropbear-" version ".tar.bz2"))
643 (sha256
644 (base32 "0d1n26g8rddflyja0bgy08x25n6gp7575rl5ibf3dhyg26kpq7qd"))
645 (modules '((guix build utils)))
646 (snippet
647 '(begin
648 (delete-file-recursively "libtommath")
649 (delete-file-recursively "libtomcrypt")
650 (substitute* "configure"
651 (("-ltomcrypt") "-ltomcrypt -ltommath"))))))
652 (build-system gnu-build-system)
653 (arguments
654 (list
655 #:configure-flags #~(list "--disable-bundled-libtom")
656 ;; The test suite runs an instance of dropbear, which requires a
657 ;; resolver ("Error resolving: Servname not supported for ai_socktype").
658 #:tests? #f
659 #:phases #~(modify-phases %standard-phases
660 (add-after 'unpack 'enable-x11-forwarding
661 (lambda _
662 (substitute* "src/default_options.h"
663 (("#define DROPBEAR_X11FWD 0")
664 "#define DROPBEAR_X11FWD 1")))))))
665 (inputs (list libtomcrypt libtommath libxcrypt zlib))
666 (synopsis "Small SSH server and client")
667 (description "Dropbear is a relatively small SSH server and
668client. It runs on a variety of POSIX-based platforms. Dropbear is
669particularly useful for embedded systems, such as wireless routers.")
670 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
671 (license (license:x11-style "" "See file LICENSE."))))
672
673(define-public liboop
674 (package
675 (name "liboop")
676 (version "1.0.1")
677 (source
678 (origin
679 (method url-fetch)
680 (uri (string-append "http://ftp.lysator.liu.se/pub/liboop/"
681 name "-" version ".tar.gz"))
682 (sha256
683 (base32
684 "1q0p1l72pq9k3bi7a366j2rishv7dzzkg3i6r2npsfg7cnnidbsn"))))
685 (build-system gnu-build-system)
686 (home-page "https://www.lysator.liu.se/liboop/")
687 (synopsis "Event loop library")
688 (description "Liboop is a low-level event loop management library for
689POSIX-based operating systems. It supports the development of modular,
690multiplexed applications which may respond to events from several sources. It
691replaces the \"select() loop\" and allows the registration of event handlers
692for file and network I/O, timers and signals. Since processes use these
693mechanisms for almost all external communication, liboop can be used as the
694basis for almost any application.")
695 (license license:lgpl2.1+)))
696
697(define-public sshpass
698 (package
699 (name "sshpass")
700 (version "1.10")
701 (source
702 (origin
703 (method url-fetch)
704 (uri (string-append "mirror://sourceforge/sshpass/sshpass/"
705 version "/sshpass-" version ".tar.gz"))
706 (sha256
707 (base32 "1npfvxxqs77qg6l4s6cn8q3b98zwr9n8rb9vra2n3dfb0g10c4dd"))))
708 (build-system gnu-build-system)
709 (home-page "https://sourceforge.net/projects/sshpass/")
710 (synopsis "Non-interactive password authentication with SSH")
711 (description "sshpass is a tool for non-interactively performing password
712authentication with SSH's so-called @dfn{interactive keyboard password
713authentication}.")
714 (license license:gpl2+)))
715
716(define-public autossh
717 (package
718 (name "autossh")
719 (version "1.4g")
720 (source
721 (origin
722 (method url-fetch)
723 (uri (string-append
724 "https://www.harding.motd.ca/autossh/autossh-"
725 version ".tgz"))
726 (sha256
727 (base32 "0xqjw8df68f4kzkns5gcah61s5wk0m44qdk2z1d6388w6viwxhsz"))))
728 (build-system gnu-build-system)
729 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
730 (inputs (list openssh))
731 (synopsis "Automatically restart SSH sessions and tunnels")
732 (description "autossh is a program to start a copy of @command{ssh} and
733monitor it, restarting it as necessary should it die or stop passing traffic.")
734 (home-page "https://www.harding.motd.ca/autossh/")
735 (license
736 ;; Why point to a source file? Well, all the individual files have a
737 ;; copy of this license in their headers, but there's no separate file
738 ;; with that information.
739 (license:non-copyleft "file://autossh.c"))))
740
741(define-public pdsh
742 (package
743 (name "pdsh")
744 (version "2.35")
745 (source
746 (origin
747 (method url-fetch)
748 (uri (string-append "https://github.com/chaos/pdsh/"
749 "releases/download/pdsh-" version
750 "/pdsh-" version ".tar.gz"))
751 (sha256
752 (base32 "1ziw142im1hzj0wr20msrp97sp709x1c9ybgilzz9zs8g0s1bvvm"))))
753 (build-system gnu-build-system)
754 (arguments
755 `(#:configure-flags
756 (list "--with-ssh")
757 #:phases
758 (modify-phases %standard-phases
759 (add-after 'unpack 'patch-/bin/sh
760 (lambda _
761 (substitute* '("tests/t0006-pdcp.sh"
762 "tests/t0004-module-loading.sh"
763 "tests/t2001-ssh.sh"
764 "tests/t1003-slurm.sh"
765 "tests/t6036-long-output-lines.sh"
766 "tests/aggregate-results.sh"
767 "tests/t2000-exec.sh"
768 "tests/t0002-internal.sh"
769 "tests/t1002-dshgroup.sh"
770 "tests/t5000-dshbak.sh"
771 "tests/t0001-basic.sh"
772 "tests/t0005-rcmd_type-and-user.sh"
773 "tests/test-lib.sh"
774 "tests/t2002-mrsh.sh"
775 "tests/t0003-wcoll.sh"
776 "tests/test-modules/pcptest.c")
777 (("/bin/sh") (which "bash")))
778 #t))
779 (add-after 'unpack 'patch-tests
780 (lambda _
781 (substitute* "tests/t6036-long-output-lines.sh"
782 (("which") (which "which")))
783 #t)))))
784 (inputs
785 (list openssh mit-krb5 perl))
786 (native-inputs
787 (list which))
788 (home-page "https://github.com/chaos/pdsh")
789 (synopsis "Parallel distributed shell")
790 (description "Pdsh is a an efficient, multithreaded remote shell client
791which executes commands on multiple remote hosts in parallel. Pdsh implements
792dynamically loadable modules for extended functionality such as new remote
793shell services and remote host selection.")
794 (license license:gpl2+)))
795
796(define-public python-asyncssh
797 (package
798 (name "python-asyncssh")
799 (version "2.22.0")
800 (source
801 (origin
802 (method url-fetch)
803 (uri (pypi-uri "asyncssh" version))
804 (sha256
805 (base32 "0dxmirf6my22gh096dqs81dgzr9788wdsi18wr07pyg43fq75kn3"))))
806 (build-system pyproject-build-system)
807 (arguments
808 (list
809 #:test-flags
810 #~(list "-k" (string-join
811 (list
812 ;; TODO Test fails with:
813 ;; "Unable to sign with requested key"
814 "not test_confirm"
815 #$@(if (target-aarch64?)
816 (list
817 ;; Tests fail with: asyncssh.misc.ConnectionLost:
818 ;; Connection lost
819 "test_connect_non_tcp_sock"
820 "test_connect_reverse_proxy"
821 "test_get_server_auth_methods_no_sockn"
822 "test_get_server_auth_methods_no_sockname"
823 "test_get_server_host_key_proxy")
824 '()))
825 " and not " ))
826 #:phases
827 #~(modify-phases %standard-phases
828 (add-before 'check 'pre-check
829 (lambda* _
830 (substitute* "tests/test_connection.py"
831 ;; nc is always available.
832 (("which nc") "true")))))))
833 (native-inputs
834 (list netcat
835 openssh
836 openssl
837 python-aiofiles
838 python-fido2
839 python-pytest
840 python-setuptools))
841 (propagated-inputs
842 (list python-cryptography
843 python-pyopenssl
844 python-gssapi
845 python-bcrypt
846 python-typing-extensions))
847 (home-page "https://asyncssh.readthedocs.io/")
848 (synopsis "Asynchronous SSHv2 client and server library for Python")
849 (description
850 "AsyncSSH is a Python package which provides an asynchronous client and
851server implementation of the SSHv2 protocol on top of the Python 3.6+ asyncio
852framework.")
853 (license license:epl2.0)))
854
855(define-public python-mock-ssh-server
856 (package
857 (name "python-mock-ssh-server")
858 (version "0.9.1")
859 (source
860 (origin
861 (method git-fetch)
862 (uri (git-reference
863 (url "https://github.com/carletes/mock-ssh-server")
864 (commit version)))
865 (file-name (git-file-name name version))
866 (sha256
867 (base32 "0fmnn2ddfagi0qybnw1n10hn29jawnj01bgwl4p9lnwx71c7x5y8"))))
868 (build-system pyproject-build-system)
869 (native-inputs
870 (list inetutils
871 openssh
872 python-pytest
873 python-setuptools))
874 (propagated-inputs
875 (list python-paramiko))
876 (home-page "https://github.com/carletes/mock-ssh-server")
877 (synopsis "Mock SSH server for testing purposes")
878 (description
879 "@code{mock-ssh-server} packs a Python context manager that implements an
880SSH server for testing purposes. It is built on top of paramiko, so it does not
881need OpenSSH binaries to be installed.")
882 (license license:expat)))
883
884(define-public python-sshfs
885 (package
886 (name "python-sshfs")
887 (version "2025.11.0")
888 (source
889 (origin
890 (method git-fetch)
891 (uri (git-reference
892 (url "https://github.com/fsspec/sshfs")
893 (commit version)))
894 (file-name (git-file-name name version))
895 (sha256
896 (base32 "1igcjjsaa2x4zbdwzrybv077kghjair3ighs9jdmgsa7wj66pcaf"))))
897 (build-system pyproject-build-system)
898 (native-inputs
899 (list python-importlib-metadata
900 python-mock-ssh-server
901 python-pytest
902 python-pytest-asyncio
903 python-setuptools
904 python-setuptools-scm))
905 (propagated-inputs
906 (list python-asyncssh
907 python-bcrypt
908 python-fsspec))
909 (home-page "https://github.com/fsspec/sshfs")
910 (synopsis "SSH/SFTP implementation for fsspec")
911 (description
912 "This package provides an implementation of fsspec for the SFTP protocol
913using asyncssh, with the following features:
914
915@itemize
916@item A complete implementation of the fsspec protocol through SFTP
917@item Supports features outside of the SFTP
918@item Quite fast
919@item Builtin Channel Management
920@item Async
921@end itemize")
922 (license license:asl2.0)))
923
924(define-public clustershell
925 (package
926 (name "clustershell")
927 (version "1.9.3")
928 (source
929 (origin
930 (method git-fetch)
931 (uri (git-reference
932 (url "https://github.com/cea-hpc/clustershell")
933 (commit (string-append "v" version))))
934 (file-name (git-file-name name version))
935 (sha256
936 (base32 "0maw8y22gxva2ja0a4d4i3iibjn4yd2zvcx0r6sj8lksdqyavad1"))))
937 (build-system pyproject-build-system)
938 (arguments
939 (list
940 #:tests? #f ; tests require python-nose, and most of them fail
941 #:phases
942 #~(modify-phases %standard-phases
943 (add-before 'build 'fix-pathes
944 (lambda _
945 (let ((ssh #$(this-package-input "openssh")))
946 (substitute* (list "lib/ClusterShell/Worker/Ssh.py"
947 "lib/ClusterShell/Worker/fastsubprocess.py")
948 (("\"/bin/sh\"") (format #f "'~a'" (which "sh")))
949 (("\"ssh\"") (format #f "'~a/bin/ssh'" ssh))
950 (("\"scp\"") (format #f "'~a/bin/scp'" ssh)))
951 (substitute* (find-files "./tests" "\\.py$")
952 (("\"/bin/hostname\"") (format #f "'~a'" (which "hostname")))
953 (("/bin/sleep") "sleep")
954 (("/bin/echo") "echo")
955 (("/bin/uname") "uname")
956 (("/bin/false") "false")
957 (("/bin/true") "true")
958 (("/usr/bin/printf") "printf"))))))))
959 (native-inputs
960 (list python-setuptools))
961 (inputs
962 (list openssh))
963 (propagated-inputs
964 (list python-pyyaml))
965 (home-page "https://cea-hpc.github.io/clustershell/")
966 (synopsis "Scalable event-driven Python framework for cluster administration")
967 (description
968 "ClusterShell is an event-driven Python framework, designed to run local
969or distant commands in parallel on server farms or on large GNU/Linux
970clusters. It will take care of common issues encountered on HPC clusters,
971such as operating on groups of nodes, running distributed commands using
972optimized execution algorithms, as well as gathering results and merging
973identical outputs, or retrieving return codes. ClusterShell takes advantage
974of existing remote shell facilities such as SSH.")
975 (license license:lgpl2.1+)))
976
977(define-public endlessh
978 (package
979 (name "endlessh")
980 (version "1.1")
981 (source
982 (origin
983 (method git-fetch)
984 (uri (git-reference
985 (url "https://github.com/skeeto/endlessh")
986 (commit version)))
987 (file-name (git-file-name name version))
988 (sha256
989 (base32 "0ziwr8j1frsp3dajr8h5glkm1dn5cci404kazz5w1jfrp0736x68"))))
990 (build-system gnu-build-system)
991 (arguments
992 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
993 ,(string-append "CC=" (cc-for-target)))
994 #:tests? #f ; no test target
995 #:phases
996 (modify-phases %standard-phases
997 (delete 'configure)))) ; no configure script
998 (home-page "https://github.com/skeeto/endlessh")
999 (synopsis "SSH tarpit that slowly sends an endless banner")
1000 (description
1001 "Endlessh is an SSH tarpit that very slowly sends an endless, random SSH
1002banner. It keeps SSH clients locked up for hours or even days at a time. The
1003purpose is to put your real SSH server on another port and then let the script
1004kiddies get stuck in this tarpit instead of bothering a real server.
1005
1006Since the tarpit is in the banner before any cryptographic exchange occurs, this
1007program doesn't depend on any cryptographic libraries. It's a simple,
1008single-threaded, standalone C program. It uses @code{poll()} to trap multiple
1009clients at a time.")
1010 (license license:unlicense)))
1011
1012(define-public ssh-tools
1013 (package
1014 (name "ssh-tools")
1015 (version "1.9")
1016 (source
1017 (origin
1018 (method git-fetch)
1019 (uri (git-reference
1020 (url "https://codeberg.org/vaporup/ssh-tools")
1021 (commit (string-append "v" version))))
1022 (file-name (git-file-name name version))
1023 (sha256
1024 (base32 "1bh6pp5ic4b8pbgzwqr516z8466x62kzwyaka38agz294qwck5sh"))))
1025 (build-system go-build-system)
1026 (arguments
1027 (list
1028 #:modules '((srfi srfi-26)
1029 (guix build go-build-system)
1030 (guix build utils))
1031 #:install-source? #f
1032 #:import-path "codeberg.org/vaporup/ssh-tools/cmd/go/..."
1033 #:unpack-path "codeberg.org/vaporup/ssh-tools"
1034 #:test-flags
1035 ;; "non-constant format string in call to fmt.Fprintf"
1036 #~(list "-vet=off")
1037 #:phases
1038 #~(modify-phases %standard-phases
1039 (add-after 'install 'install-bash
1040 (lambda* (#:key unpack-path #:allow-other-keys)
1041 (let ((files (find-files (string-append "src/" unpack-path
1042 "/cmd/bash") "ssh-"))
1043 (bin (string-append #$output "/bin")))
1044 (for-each (cut install-file <> bin) files))))
1045 (add-after 'install-bash 'install-manpages
1046 (lambda* (#:key unpack-path #:allow-other-keys)
1047 (copy-recursively (string-append "src/" unpack-path "/man/")
1048 (string-append #$output "/share/man/man1")))))))
1049 (native-inputs
1050 (list go-golang-org-x-crypto
1051 go-sigs-k8s-io-yaml))
1052 (home-page "https://codeberg.org/vaporup/ssh-tools")
1053 (synopsis "Miscellaneous SSH utilities")
1054 (description
1055 "This package provides a suite of miscellaneous SSH-related utilities.
1056
1057This package includes the following commands:
1058@itemize
1059
1060@item @command{ssh-ping}: Checks if a host is reachable using
1061@code{ssh_config}.
1062
1063@item @command{ssh-last}: Like @command{last} but for SSH sessions.
1064
1065@item @command{ssh-certinfo}: Shows validity and information for SSH
1066certificates.
1067
1068@item @command{ssh-force-password}: Forces password authentication.
1069
1070@item @command{ssh-keyinfo}: Prints keys in several formats.
1071
1072@item @command{ssh-hostkeys}: Prints server host keys in several formats.
1073
1074@item @command{ssh-facts}: Gets some facts about the remote system.
1075
1076@item @command{ssh-diff}: Diffs a file over SSH.
1077
1078@item @command{ssh-version}: Shows version of the SSH server you are
1079connecting to.
1080
1081@item @command{ssh-pwd}: Quickly echos path to use for @command{scp} or
1082@command{rsync}.
1083
1084@item @command{ssh-authorized-keys}: Collects info from
1085@command{authorized_keys} files from every user it can find.
1086
1087@item @command{ssh-sig}: Makes @code{ssh-keygen -Y} easier to use.
1088
1089@end itemize")
1090 (license license:gpl3)))
1091
1092(define-public webssh
1093 (package
1094 (name "webssh")
1095 (version "1.6.3")
1096 (source
1097 (origin
1098 (method git-fetch)
1099 (uri (git-reference
1100 (url "https://github.com/huashengdun/webssh")
1101 (commit (string-append "v" version))))
1102 (file-name (git-file-name name version))
1103 (sha256
1104 (base32 "0gvs64xjm1pfwv6jyc71hsj0pwfhvmw8ahbx4y9p6isfwspcbmr0"))))
1105 (build-system pyproject-build-system)
1106 ;; FIXME: Errors with:
1107 ;; "AttributeError: 'AsyncHTTPTestCase' object has no attribute 'runTest'"
1108 (arguments (list #:tests? #f))
1109 (native-inputs
1110 (list python-pytest
1111 python-setuptools))
1112 (propagated-inputs
1113 (list python-paramiko
1114 python-tornado))
1115 (home-page "https://webssh.huashengdun.org/")
1116 (synopsis "Web application to be used as an SSH client")
1117 (description
1118 "This package provides a web application to be used as an SSH client.
1119
1120Features:
1121@itemize @bullet
1122@item SSH password authentication supported, including empty password.
1123@item SSH public-key authentication supported, including DSA RSA ECDSA
1124Ed25519 keys.
1125@item Encrypted keys supported.
1126@item Two-Factor Authentication (time-based one-time password) supported.
1127@item Fullscreen terminal supported.
1128@item Terminal window resizable.
1129@item Auto detect the ssh server's default encoding.
1130@item Modern browsers are supported.
1131@end itemize")
1132 (license license:expat)))
1133
1134(define-public x11-ssh-askpass
1135 (package
1136 (name "x11-ssh-askpass")
1137 (version "1.2.4.1")
1138 (source
1139 (origin
1140 (method url-fetch)
1141 ;; The project home page seams to be offline.
1142 (uri (string-append "https://pkgs.fedoraproject.org/repo/pkgs/openssh/"
1143 name "-" version ".tar.gz"
1144 "/8f2e41f3f7eaa8543a2440454637f3c3/"
1145 name "-" version ".tar.gz"))
1146 (sha256
1147 (base32 "124c1frwvdmg4nv8xqv435ibjhj2y8xc1bmfr6i8a8g75b1y63b2"))))
1148 (build-system gnu-build-system)
1149 (arguments
1150 (list
1151 #:tests? #f ;no tests
1152 #:make-flags
1153 #~(list (string-append "BINDIR=" #$output "/libexec")
1154 (string-append "MANDIR=" #$output "/share/man"))
1155 #:configure-flags
1156 #~(list (string-append "--mandir="
1157 "/usr/share/man/test")
1158 (string-append "--libexecdir="
1159 "/usr/lib/ssh/test")
1160 (string-append "--with-app-defaults-dir="
1161 "/usr/share/X11/app-defaults/test"))
1162 #:phases
1163 #~(modify-phases %standard-phases
1164 (add-after 'configure 'xmkmf
1165 (lambda* (#:key inputs #:allow-other-keys)
1166 (let ((imake #$(this-package-native-input "imake")))
1167 (invoke "xmkmf")
1168 (substitute* "Makefile"
1169 ;; These imake variables somehow remain undefined
1170 (("DefaultGcc2[[:graph:]]*Opt") "-O2")
1171 ;; Reset a few variable defaults that are set in imake
1172 ;; templates.
1173 ((imake) #$output)
1174 (("(MANPATH = )[[:graph:]]*" _ front)
1175 (string-append front #$output "/share/man"))))))
1176 (add-after 'xmkmf 'make-includes
1177 (lambda _
1178 (invoke "make" "includes")))
1179 (add-after 'install 'install/doc
1180 (lambda _
1181 (lambda _
1182 (invoke "make"
1183 (string-append "MANDIR=" #$output "/share/man")
1184 "install.man")))))))
1185 (native-inputs (list imake))
1186 (inputs (list libxt))
1187 (home-page "http://www.jmknoble.net/software/x11-ssh-askpass/")
1188 (synopsis "Lightweight passphrase dialog for SSH")
1189 (description "code{x11-ssh-askpass} is an X11-based pass-phrase dialog for
1190use with OpenSSH.")
1191 (license license:gpl2+)))