Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / ssh.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
8 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
11 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2017 Nikita <nikita@n0.is>
13 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
14 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
15 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
16 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages ssh)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages crypto)
40 #:use-module (gnu packages elf)
41 #:use-module (gnu packages gnupg)
42 #:use-module (gnu packages gperf)
43 #:use-module (gnu packages groff)
44 #:use-module (gnu packages guile)
45 #:use-module (gnu packages libedit)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages logging)
48 #:use-module (gnu packages m4)
49 #:use-module (gnu packages multiprecision)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages nettle)
52 #:use-module (gnu packages kerberos)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages popt)
56 #:use-module (gnu packages protobuf)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-xyz)
59 #:use-module (gnu packages readline)
60 #:use-module (gnu packages texinfo)
61 #:use-module (gnu packages tls)
62 #:use-module (gnu packages xorg)
63 #:use-module (guix build-system cmake)
64 #:use-module (guix build-system gnu)
65 #:use-module (guix build-system python)
66 #:use-module (guix download)
67 #:use-module (guix git-download)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix utils)
71 #:use-module (srfi srfi-1))
72
73 (define-public libssh
74 (package
75 (name "libssh")
76 (version "0.9.4")
77 (source (origin
78 (method git-fetch)
79 (uri (git-reference
80 (url "https://git.libssh.org/projects/libssh.git")
81 (commit (string-append "libssh-" version))))
82 (sha256
83 (base32
84 "0qr4vi3k1wv69c95d9j26fiv78pzyksaq8ccd76b8nxar5z1fbj6"))
85 (file-name (git-file-name name version))))
86 (build-system cmake-build-system)
87 (outputs '("out" "debug"))
88 (arguments
89 '(#:configure-flags '("-DWITH_GCRYPT=ON")
90
91 ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
92 #:tests? #f))
93 (inputs `(("zlib" ,zlib)
94 ("libgcrypt" ,libgcrypt)
95 ("mit-krb5" ,mit-krb5)))
96 (synopsis "SSH client library")
97 (description
98 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for client
99 and server implementations. With libssh, you can remotely execute programs,
100 transfer files, and use a secure and transparent tunnel for your remote
101 applications.")
102 (home-page "https://www.libssh.org")
103 (license license:lgpl2.1+)))
104
105 (define-public libssh2
106 (package
107 (name "libssh2")
108 (version "1.9.0")
109 (source (origin
110 (method url-fetch)
111 (uri (string-append
112 "https://www.libssh2.org/download/libssh2-"
113 version ".tar.gz"))
114 (sha256
115 (base32
116 "1zfsz9nldakfz61d2j70pk29zlmj7w2vv46s9l3x2prhcgaqpyym"))))
117 (build-system gnu-build-system)
118 ;; The installed libssh2.pc file does not include paths to libgcrypt and
119 ;; zlib libraries, so we need to propagate the inputs.
120 (propagated-inputs `(("libgcrypt" ,libgcrypt)
121 ("zlib" ,zlib)))
122 (arguments `(#:configure-flags `("--with-libgcrypt")))
123 (synopsis "Client-side C library implementing the SSH2 protocol")
124 (description
125 "libssh2 is a library intended to allow software developers access to
126 the SSH-2 protocol in an easy-to-use self-contained package. It can be built
127 into an application to perform many different tasks when communicating with
128 a server that supports the SSH-2 protocol.")
129 (license license:bsd-3)
130 (home-page "https://www.libssh2.org/")))
131
132 (define-public openssh
133 (package
134 (name "openssh")
135 (version "8.3p1")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://openbsd/OpenSSH/portable/"
139 "openssh-" version ".tar.gz"))
140 (patches (search-patches "openssh-hurd.patch"))
141 (sha256
142 (base32
143 "1cl74ghi9y21dc3f4xa0qamb7dhwacbynh1ks9syprrg8zhgpgpj"))))
144 (build-system gnu-build-system)
145 (native-inputs `(("groff" ,groff)
146 ("pkg-config" ,pkg-config)))
147 (inputs `(("libedit" ,libedit)
148 ("openssl" ,openssl)
149 ("pam" ,linux-pam)
150 ("mit-krb5" ,mit-krb5)
151 ("zlib" ,zlib)
152 ("xauth" ,xauth))) ; for 'ssh -X' and 'ssh -Y'
153 (arguments
154 `(#:test-target "tests"
155 ;; Otherwise, the test scripts try to use a nonexistent directory and
156 ;; fail.
157 #:make-flags '("REGRESSTMP=\"$${BUILDDIR}/regress\"")
158 #:configure-flags `("--sysconfdir=/etc/ssh"
159
160 ;; Default value of 'PATH' used by sshd.
161 "--with-default-path=/run/current-system/profile/bin"
162
163 ;; configure needs to find krb5-config.
164 ,(string-append "--with-kerberos5="
165 (assoc-ref %build-inputs "mit-krb5")
166 "/bin")
167
168 ;; libedit is needed for sftp completion.
169 "--with-libedit"
170
171 ;; Enable PAM support in sshd.
172 "--with-pam"
173
174 ;; "make install" runs "install -s" by default,
175 ;; which doesn't work for cross-compiled binaries
176 ;; because it invokes 'strip' instead of
177 ;; 'TRIPLET-strip'. Work around this.
178 ,,@(if (%current-target-system)
179 '("--disable-strip")
180 '()))
181
182 #:phases
183 (modify-phases %standard-phases
184 (add-after 'configure 'reset-/var/empty
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let ((out (assoc-ref outputs "out")))
187 (substitute* "Makefile"
188 (("PRIVSEP_PATH=/var/empty")
189 (string-append "PRIVSEP_PATH=" out "/var/empty")))
190 #t)))
191 (add-before 'check 'patch-tests
192 (lambda _
193 (substitute* "regress/test-exec.sh"
194 (("/bin/sh") (which "sh")))
195
196 ;; Remove 't-exec' regress target which requires user 'sshd'.
197 (substitute* (list "Makefile"
198 "regress/Makefile")
199 (("^(tests:.*) t-exec(.*)" all pre post)
200 (string-append pre post)))
201 #t))
202 (replace 'install
203 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
204 ;; Install without host keys and system configuration files.
205 (apply invoke "make" "install-nosysconf" make-flags)
206 (install-file "contrib/ssh-copy-id"
207 (string-append (assoc-ref outputs "out")
208 "/bin/"))
209 (chmod (string-append (assoc-ref outputs "out")
210 "/bin/ssh-copy-id") #o555)
211 (install-file "contrib/ssh-copy-id.1"
212 (string-append (assoc-ref outputs "out")
213 "/share/man/man1/"))
214 #t)))))
215 (synopsis "Client and server for the secure shell (ssh) protocol")
216 (description
217 "The SSH2 protocol implemented in OpenSSH is standardised by the
218 IETF secsh working group and is specified in several RFCs and drafts.
219 It is composed of three layered components:
220
221 The transport layer provides algorithm negotiation and a key exchange.
222 The key exchange includes server authentication and results in a
223 cryptographically secured connection: it provides integrity, confidentiality
224 and optional compression.
225
226 The user authentication layer uses the established connection and relies on
227 the services provided by the transport layer. It provides several mechanisms
228 for user authentication. These include traditional password authentication
229 as well as public-key or host-based authentication mechanisms.
230
231 The connection layer multiplexes many different concurrent channels over the
232 authenticated connection and allows tunneling of login sessions and
233 TCP-forwarding. It provides a flow control service for these channels.
234 Additionally, various channel-specific options can be negotiated.")
235 (license (license:non-copyleft "file://LICENSE"
236 "See LICENSE in the distribution."))
237 (home-page "https://www.openssh.com/")))
238
239 ;; OpenSSH without X support. This allows to use OpenSSH without dragging X
240 ;; libraries to the closure.
241 (define-public openssh-sans-x
242 (package
243 (inherit openssh)
244 (name "openssh-sans-x")
245 (inputs (alist-delete "xauth" (package-inputs openssh)))
246 (synopsis "OpenSSH client and server without X11 support")))
247
248 (define-public guile-ssh
249 (package
250 (name "guile-ssh")
251 (version "0.12.0")
252 (home-page "https://github.com/artyom-poptsov/guile-ssh")
253 (source (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url home-page)
257 (commit (string-append "v" version))))
258 (file-name (string-append name "-" version ".tar.gz"))
259 (sha256
260 (base32
261 "054hd9rzfhb48gc1hw3rphhp0cnnd4bs5qmidy5ygsyvy9ravlad"))
262 (modules '((guix build utils)))))
263 (build-system gnu-build-system)
264 (outputs '("out" "debug"))
265 (arguments
266 `(;; It makes no sense to build libguile-ssh.a.
267 #:configure-flags '("--disable-static")
268
269 #:phases (modify-phases %standard-phases
270 (add-before 'build 'fix-libguile-ssh-file-name
271 (lambda* (#:key outputs #:allow-other-keys)
272 ;; Build and install libguile-ssh.so so that we can use
273 ;; its absolute file name in .scm files, before we build
274 ;; the .go files.
275 (let* ((out (assoc-ref outputs "out"))
276 (lib (string-append out "/lib")))
277 (invoke "make" "install"
278 "-C" "libguile-ssh"
279 "-j" (number->string
280 (parallel-job-count)))
281 (substitute* (find-files "." "\\.scm$")
282 (("\"libguile-ssh\"")
283 (string-append "\"" lib "/libguile-ssh\"")))
284 #t)))
285 ,@(if (%current-target-system)
286 '()
287 '((add-before 'check 'fix-guile-path
288 (lambda* (#:key inputs #:allow-other-keys)
289 (let ((guile (assoc-ref inputs "guile")))
290 (substitute* "tests/common.scm"
291 (("/usr/bin/guile")
292 (string-append guile "/bin/guile")))
293 #t)))))
294 (add-after 'install 'remove-bin-directory
295 (lambda* (#:key outputs #:allow-other-keys)
296 (let* ((out (assoc-ref outputs "out"))
297 (bin (string-append out "/bin"))
298 (examples (string-append
299 out "/share/guile-ssh/examples")))
300 (mkdir-p examples)
301 (rename-file (string-append bin "/ssshd.scm")
302 (string-append examples "/ssshd.scm"))
303 (rename-file (string-append bin "/sssh.scm")
304 (string-append examples "/sssh.scm"))
305 (delete-file-recursively bin)
306 #t))))
307 ;; Tests are not parallel-safe.
308 #:parallel-tests? #f))
309 (native-inputs `(("autoconf" ,autoconf)
310 ("automake" ,automake)
311 ("libtool" ,libtool)
312 ("texinfo" ,texinfo)
313 ("pkg-config" ,pkg-config)
314 ("which" ,which)
315 ("guile" ,guile-3.0))) ;needed when cross-compiling.
316 (inputs `(("guile" ,guile-3.0)
317 ("libssh" ,libssh)
318 ("libgcrypt" ,libgcrypt)))
319 (synopsis "Guile bindings to libssh")
320 (description
321 "Guile-SSH is a library that provides access to the SSH protocol for
322 programs written in GNU Guile interpreter. It is a wrapper to the underlying
323 libssh library.")
324 (license license:gpl3+)))
325
326 (define-public guile2.0-ssh
327 (package
328 (inherit guile-ssh)
329 (name "guile2.0-ssh")
330 (native-inputs
331 `(("guile" ,guile-2.0) ;needed when cross-compiling.
332 ,@(alist-delete "guile" (package-native-inputs guile-ssh))))
333 (inputs `(("guile" ,guile-2.0)
334 ,@(alist-delete "guile" (package-inputs guile-ssh))))))
335
336 (define-public guile2.2-ssh
337 (package
338 (inherit guile-ssh)
339 (name "guile2.2-ssh")
340 (native-inputs
341 `(("guile" ,guile-2.2) ;needed when cross-compiling.
342 ,@(alist-delete "guile" (package-native-inputs guile-ssh))))
343 (inputs `(("guile" ,guile-2.2)
344 ,@(alist-delete "guile" (package-inputs guile-ssh))))))
345
346 (define-public guile3.0-ssh
347 (deprecated-package "guile3.0-ssh" guile-ssh))
348
349 (define-public corkscrew
350 (package
351 (name "corkscrew")
352 (version "2.0")
353 (source
354 (origin
355 (method url-fetch)
356 ;; The agroman.net domain name expired on 2017-03-23, and the original
357 ;; "http://www.agroman.net/corkscrew/corkscrew-2.0.tar.gz" now returns
358 ;; bogus HTML. Perhaps it will yet return. Until then, use a mirror.
359 (uri (string-append "https://downloads.openwrt.org/sources/"
360 "corkscrew-" version ".tar.gz"))
361 (sha256 (base32
362 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
363 (build-system gnu-build-system)
364 (arguments
365 `(#:phases
366 (modify-phases %standard-phases
367 (replace 'configure
368 ;; Replace configure phase as the ./configure script does not like
369 ;; CONFIG_SHELL and SHELL passed as parameters
370 (lambda* (#:key outputs build target #:allow-other-keys)
371 (let* ((out (assoc-ref outputs "out"))
372 (bash (which "bash"))
373 ;; Set --build and --host flags as the provided config.guess
374 ;; is not able to detect them
375 (flags `(,(string-append "--prefix=" out)
376 ,(string-append "--build=" build)
377 ,(string-append "--host=" (or target build)))))
378 (setenv "CONFIG_SHELL" bash)
379 (apply invoke bash "./configure" flags))))
380 (add-after 'install 'install-documentation
381 (lambda* (#:key outputs #:allow-other-keys)
382 (let* ((out (assoc-ref outputs "out"))
383 (doc (string-append out "/share/doc/" ,name "-" ,version)))
384 (install-file "README" doc)
385 #t))))))
386 (home-page "http://www.agroman.net/corkscrew")
387 (synopsis "SSH tunneling through HTTP(S) proxies")
388 (description
389 "Corkscrew tunnels SSH connections through most HTTP and HTTPS proxies.
390 Proxy authentication is only supported through the plain-text HTTP basic
391 authentication scheme.")
392 (license license:gpl2+)))
393
394 (define-public mosh
395 (package
396 (name "mosh")
397 (version "1.3.2")
398 (source (origin
399 (method url-fetch)
400 (uri (string-append "https://mosh.org/mosh-" version ".tar.gz"))
401 (sha256
402 (base32
403 "05hjhlp6lk8yjcy59zywpf0r6s0h0b9zxq0lw66dh9x8vxrhaq6s"))))
404 (build-system gnu-build-system)
405 (arguments
406 '(#:phases
407 (modify-phases %standard-phases
408 (add-after 'install 'wrap
409 (lambda* (#:key outputs #:allow-other-keys)
410 ;; Make sure 'mosh' can find 'mosh-client' and
411 ;; 'mosh-server'.
412 (let* ((out (assoc-ref outputs "out"))
413 (bin (string-append out "/bin")))
414 (wrap-program (string-append bin "/mosh")
415 `("PATH" ":" prefix (,bin)))))))))
416 (native-inputs
417 `(("pkg-config" ,pkg-config)))
418 (inputs
419 `(("openssl" ,openssl)
420 ("perl" ,perl)
421 ("perl-io-tty" ,perl-io-tty)
422 ("zlib" ,zlib)
423 ("ncurses" ,ncurses)
424 ("protobuf" ,protobuf)
425 ("boost-headers" ,boost)))
426 (home-page "https://mosh.org/")
427 (synopsis "Remote shell tolerant to intermittent connectivity")
428 (description
429 "Mosh is a remote terminal application that allows client roaming, supports
430 intermittent connectivity, and provides intelligent local echo and line editing
431 of user keystrokes. It's a replacement for SSH that's more robust and
432 responsive, especially over Wi-Fi, cellular, and long-distance links.")
433 (license license:gpl3+)))
434
435 (define-public et
436 (package
437 (name "et")
438 (version "3.1.0")
439 (source
440 (origin
441 (method git-fetch)
442 (uri (git-reference
443 (url "https://github.com/MisterTea/EternalTCP.git")
444 (commit (string-append "et-v" version))))
445 (file-name (git-file-name name version))
446 (sha256
447 (base32 "1m5caxckn2ihwp9s2pbyh5amxlpwr7yc54q8s0kb10fr52w2vfnm"))))
448 (build-system cmake-build-system)
449 (arguments `(#:tests? #f))
450 (native-inputs
451 `(("pkg-config" ,pkg-config)))
452 (inputs `(("glog" ,glog)
453 ("gflags" ,gflags)
454 ("libsodium" ,libsodium)
455 ("protobuf" ,protobuf)))
456 (synopsis "Remote shell that automatically reconnects")
457 (description
458 "Eternal Terminal (ET) is a remote shell that automatically reconnects
459 without interrupting the session. Unlike SSH sessions, ET sessions will
460 survive even network outages and IP changes. ET uses a custom protocol over
461 TCP, not the SSH protocol.")
462 (home-page "https://eternalterminal.dev/")
463 (license license:asl2.0)))
464
465 (define-public dropbear
466 (package
467 (name "dropbear")
468 (version "2019.78")
469 (source
470 (origin
471 (method url-fetch)
472 (uri (string-append
473 "https://matt.ucc.asn.au/dropbear/releases/"
474 "dropbear-" version ".tar.bz2"))
475 (sha256
476 (base32 "19242qlr40pbqfqd0gg6h8qpj38q6lgv03ja6sahj9vj2abnanaj"))))
477 (build-system gnu-build-system)
478 (arguments `(#:tests? #f)) ; there is no "make check" or anything similar
479 ;; TODO: Investigate unbundling libtommath and libtomcrypt or at least
480 ;; cherry-picking important bug fixes from them. See <bugs.gnu.org/24674>
481 ;; for more information.
482 (inputs `(("zlib" ,zlib)))
483 (synopsis "Small SSH server and client")
484 (description "Dropbear is a relatively small SSH server and
485 client. It runs on a variety of POSIX-based platforms. Dropbear is
486 particularly useful for embedded systems, such as wireless routers.")
487 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
488 (license (license:x11-style "" "See file LICENSE."))))
489
490 (define-public liboop
491 (package
492 (name "liboop")
493 (version "1.0.1")
494 (source
495 (origin
496 (method url-fetch)
497 (uri (string-append "http://ftp.lysator.liu.se/pub/liboop/"
498 name "-" version ".tar.gz"))
499 (sha256
500 (base32
501 "1q0p1l72pq9k3bi7a366j2rishv7dzzkg3i6r2npsfg7cnnidbsn"))))
502 (build-system gnu-build-system)
503 (home-page "https://www.lysator.liu.se/liboop/")
504 (synopsis "Event loop library")
505 (description "Liboop is a low-level event loop management library for
506 POSIX-based operating systems. It supports the development of modular,
507 multiplexed applications which may respond to events from several sources. It
508 replaces the \"select() loop\" and allows the registration of event handlers
509 for file and network I/O, timers and signals. Since processes use these
510 mechanisms for almost all external communication, liboop can be used as the
511 basis for almost any application.")
512 (license license:lgpl2.1+)))
513
514 (define-public lsh
515 (package
516 (name "lsh")
517 (version "2.1")
518 (source (origin
519 (method url-fetch)
520 (uri (string-append "mirror://gnu/lsh/lsh-"
521 version ".tar.gz"))
522 (sha256
523 (base32
524 "1qqjy9zfzgny0rkb27c8c7dfsylvb6n0ld8h3an2r83pmaqr9gwb"))
525 (modules '((guix build utils)))
526 (snippet
527 '(begin
528 (substitute* "src/testsuite/functions.sh"
529 (("localhost")
530 ;; Avoid host name lookups since they don't work in
531 ;; chroot builds.
532 "127.0.0.1")
533 (("set -e")
534 ;; Make tests more verbose.
535 "set -e\nset -x"))
536
537 (substitute* (find-files "src/testsuite" "-test$")
538 (("localhost") "127.0.0.1"))
539
540 (substitute* "src/testsuite/login-auth-test"
541 (("/bin/cat") "cat"))
542 #t))))
543 (build-system gnu-build-system)
544 (native-inputs
545 `(("m4" ,m4)
546 ("guile" ,guile-2.0)
547 ("gperf" ,gperf)
548 ("psmisc" ,psmisc))) ; for `killall'
549 (inputs
550 `(("nettle" ,nettle-2)
551 ("linux-pam" ,linux-pam)
552
553 ;; 'rl.c' uses the 'CPPFunction' type, which is no longer in
554 ;; Readline 6.3.
555 ("readline" ,readline-6.2)
556
557 ("liboop" ,liboop)
558 ("zlib" ,zlib)
559 ("gmp" ,gmp)
560
561 ;; The server (lshd) invokes xauth when X11 forwarding is requested.
562 ;; This adds 24 MiB (or 27%) to the closure of lsh.
563 ("xauth" ,xauth)))
564 (arguments
565 '(;; Skip the `configure' test that checks whether /dev/ptmx &
566 ;; co. work as expected, because it relies on impurities (for
567 ;; instance, /dev/pts may be unavailable in chroots.)
568 #:configure-flags '("lsh_cv_sys_unix98_ptys=yes"
569
570 ;; Use glibc's argp rather than the bundled one.
571 "--with-system-argp"
572
573 ;; 'lsh_argp.h' checks HAVE_ARGP_PARSE but nothing
574 ;; defines it.
575 "CPPFLAGS=-DHAVE_ARGP_PARSE")
576
577 ;; FIXME: Tests won't run in a chroot, presumably because
578 ;; /etc/profile is missing, and thus clients get an empty $PATH
579 ;; and nothing works.
580 #:tests? #f
581
582 #:phases
583 (modify-phases %standard-phases
584 (add-before 'configure 'pre-configure
585 (lambda* (#:key inputs #:allow-other-keys)
586 (let* ((nettle (assoc-ref inputs "nettle"))
587 (sexp-conv (string-append nettle "/bin/sexp-conv")))
588 ;; Remove argp from the list of sub-directories; we don't want
589 ;; to build it, really.
590 (substitute* "src/Makefile.in"
591 (("^SUBDIRS = argp")
592 "SUBDIRS ="))
593
594 ;; Make sure 'lsh' and 'lshd' pick 'sexp-conv' in the right place
595 ;; by default.
596 (substitute* "src/environ.h.in"
597 (("^#define PATH_SEXP_CONV.*")
598 (string-append "#define PATH_SEXP_CONV \""
599 sexp-conv "\"\n")))
600
601 ;; Same for the 'lsh-authorize' script.
602 (substitute* "src/lsh-authorize"
603 (("=sexp-conv")
604 (string-append "=" sexp-conv)))
605
606 ;; Tell lshd where 'xauth' lives. Another option would be to
607 ;; hardcode "/run/current-system/profile/bin/xauth", thereby
608 ;; reducing the closure size, but that wouldn't work on foreign
609 ;; distros.
610 (with-fluids ((%default-port-encoding "ISO-8859-1"))
611 (substitute* "src/server_x11.c"
612 (("define XAUTH_PROGRAM.*")
613 (string-append "define XAUTH_PROGRAM \""
614 (assoc-ref inputs "xauth")
615 "/bin/xauth\"\n")))))
616
617 ;; Tests rely on $USER being set.
618 (setenv "USER" "guix"))))))
619 (home-page "https://www.lysator.liu.se/~nisse/lsh/")
620 (synopsis "GNU implementation of the Secure Shell (ssh) protocols")
621 (description
622 "GNU lsh is a free implementation of the SSH version 2 protocol. It is
623 used to create a secure line of communication between two computers,
624 providing shell access to the server system from the client. It provides
625 both the server daemon and the client application, as well as tools for
626 manipulating key files.")
627 (license license:gpl2+)))
628
629 (define-public sshpass
630 (package
631 (name "sshpass")
632 (version "1.06")
633 (synopsis "Non-interactive password authentication with SSH")
634 (home-page "https://sourceforge.net/projects/sshpass/")
635 (source
636 (origin
637 (method url-fetch)
638 (uri (string-append "mirror://sourceforge/sshpass/sshpass/"
639 version "/sshpass-" version ".tar.gz"))
640 (sha256
641 (base32
642 "0q7fblaczb7kwbsz0gdy9267z0sllzgmf0c7z5c9mf88wv74ycn6"))))
643 (build-system gnu-build-system)
644 (description "sshpass is a tool for non-interactivly performing password
645 authentication with SSH's so-called @dfn{interactive keyboard password
646 authentication}.")
647 (license license:gpl2+)))
648
649 (define-public autossh
650 (package
651 (name "autossh")
652 (version "1.4g")
653 (source
654 (origin
655 (method url-fetch)
656 (uri (string-append
657 "https://www.harding.motd.ca/autossh/autossh-"
658 version ".tgz"))
659 (sha256
660 (base32 "0xqjw8df68f4kzkns5gcah61s5wk0m44qdk2z1d6388w6viwxhsz"))))
661 (build-system gnu-build-system)
662 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
663 (inputs `(("openssh" ,openssh)))
664 (synopsis "Automatically restart SSH sessions and tunnels")
665 (description "autossh is a program to start a copy of @command{ssh} and
666 monitor it, restarting it as necessary should it die or stop passing traffic.")
667 (home-page "https://www.harding.motd.ca/autossh/")
668 (license
669 ;; Why point to a source file? Well, all the individual files have a
670 ;; copy of this license in their headers, but there's no separate file
671 ;; with that information.
672 (license:non-copyleft "file://autossh.c"))))
673
674 (define-public pdsh
675 (package
676 (name "pdsh")
677 (version "2.34")
678 (source
679 (origin
680 (method url-fetch)
681 (uri (string-append "https://github.com/chaos/pdsh/"
682 "releases/download/pdsh-" version
683 "/pdsh-" version ".tar.gz"))
684 (sha256
685 (base32 "1s91hmhrz7rfb6h3l5k97s393rcm1ww3svp8dx5z8vkkc933wyxl"))))
686 (build-system gnu-build-system)
687 (arguments
688 `(#:configure-flags
689 (list "--with-ssh")
690 #:phases
691 (modify-phases %standard-phases
692 (add-after 'unpack 'patch-/bin/sh
693 (lambda _
694 (substitute* '("tests/t0006-pdcp.sh"
695 "tests/t0004-module-loading.sh"
696 "tests/t2001-ssh.sh"
697 "tests/t1003-slurm.sh"
698 "tests/t6036-long-output-lines.sh"
699 "tests/aggregate-results.sh"
700 "tests/t2000-exec.sh"
701 "tests/t0002-internal.sh"
702 "tests/t1002-dshgroup.sh"
703 "tests/t5000-dshbak.sh"
704 "tests/t0001-basic.sh"
705 "tests/t0005-rcmd_type-and-user.sh"
706 "tests/test-lib.sh"
707 "tests/t2002-mrsh.sh"
708 "tests/t0003-wcoll.sh"
709 "tests/test-modules/pcptest.c")
710 (("/bin/sh") (which "bash")))
711 #t))
712 (add-after 'unpack 'patch-tests
713 (lambda _
714 (substitute* "tests/t6036-long-output-lines.sh"
715 (("which") (which "which")))
716 #t)))))
717 (inputs
718 `(("openssh" ,openssh)
719 ("mit-krb5" ,mit-krb5)
720 ("perl" ,perl)))
721 (native-inputs
722 `(("which" ,which)))
723 (home-page "https://github.com/chaos/pdsh")
724 (synopsis "Parallel distributed shell")
725 (description "Pdsh is a an efficient, multithreaded remote shell client
726 which executes commands on multiple remote hosts in parallel. Pdsh implements
727 dynamically loadable modules for extended functionality such as new remote
728 shell services and remote host selection.")
729 (license license:gpl2+)))
730
731 (define-public clustershell
732 (package
733 (name "clustershell")
734 (version "1.8.3")
735 (source
736 (origin
737 (method url-fetch)
738 (uri (string-append "https://github.com/cea-hpc/clustershell/releases"
739 "/download/v" version
740 "/ClusterShell-" version ".tar.gz"))
741 (sha256
742 (base32 "1qdcgh733szwj9r1gambrgfkizvbjci0bnnkds9a8mnyb3sasnan"))))
743 (build-system python-build-system)
744 (inputs `(("openssh" ,openssh)))
745 (propagated-inputs `(("python-pyyaml" ,python-pyyaml)))
746 (arguments
747 `(#:phases (modify-phases %standard-phases
748 (add-before 'build 'record-openssh-file-name
749 (lambda* (#:key inputs #:allow-other-keys)
750 (let ((ssh (assoc-ref inputs "openssh")))
751 (substitute* "lib/ClusterShell/Worker/Ssh.py"
752 (("info\\(\"ssh_path\"\\) or \"ssh\"")
753 (string-append "info(\"ssh_path\") or \""
754 ssh "/bin/ssh\"")))
755 #t))))))
756 (home-page "https://cea-hpc.github.io/clustershell/")
757 (synopsis "Scalable event-driven Python framework for cluster administration")
758 (description
759 "ClusterShell is an event-driven Python framework, designed to run local
760 or distant commands in parallel on server farms or on large GNU/Linux
761 clusters. It will take care of common issues encountered on HPC clusters,
762 such as operating on groups of nodes, running distributed commands using
763 optimized execution algorithms, as well as gathering results and merging
764 identical outputs, or retrieving return codes. ClusterShell takes advantage
765 of existing remote shell facilities such as SSH.")
766 (license license:lgpl2.1+)))
767
768 (define-public endlessh
769 (package
770 (name "endlessh")
771 (version "1.1")
772 (source
773 (origin
774 (method git-fetch)
775 (uri (git-reference
776 (url "https://github.com/skeeto/endlessh.git")
777 (commit version)))
778 (file-name (git-file-name name version))
779 (sha256
780 (base32 "0ziwr8j1frsp3dajr8h5glkm1dn5cci404kazz5w1jfrp0736x68"))))
781 (build-system gnu-build-system)
782 (arguments
783 '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
784 "CC=gcc")
785 #:tests? #f ; no test target
786 #:phases
787 (modify-phases %standard-phases
788 (delete 'configure)))) ; no configure script
789 (home-page "https://github.com/skeeto/endlessh")
790 (synopsis "SSH tarpit that slowly sends an endless banner")
791 (description
792 "Endlessh is an SSH tarpit that very slowly sends an endless, random SSH
793 banner. It keeps SSH clients locked up for hours or even days at a time. The
794 purpose is to put your real SSH server on another port and then let the script
795 kiddies get stuck in this tarpit instead of bothering a real server.
796
797 Since the tarpit is in the banner before any cryptographic exchange occurs, this
798 program doesn't depend on any cryptographic libraries. It's a simple,
799 single-threaded, standalone C program. It uses @code{poll()} to trap multiple
800 clients at a time.")
801 (license license:unlicense)))