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