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