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