gnu: python-pysam: Delete bundled htslib.
[jackhill/guix/guix.git] / gnu / packages / ssh.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages ssh)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages base)
28 #:autoload (gnu packages boost) (boost)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages elf)
31 #:use-module (gnu packages gnupg)
32 #:use-module (gnu packages gperf)
33 #:use-module (gnu packages groff)
34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages m4)
37 #:use-module (gnu packages multiprecision)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages nettle)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:autoload (gnu packages protobuf) (protobuf)
43 #:use-module (gnu packages readline)
44 #:use-module (gnu packages texinfo)
45 #:use-module (gnu packages tls)
46 #:use-module (gnu packages xorg)
47 #:use-module (guix build-system cmake)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module ((guix licenses) #:prefix license:)
52 #:use-module (guix packages))
53
54 (define-public libssh
55 (package
56 (name "libssh")
57 (version "0.7.3")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append
61 "https://red.libssh.org/attachments/download/195/libssh-"
62 version ".tar.xz"))
63 (sha256
64 (base32
65 "165g49i4kmm3bfsjm0n8hm21kadv79g9yjqyq09138jxanz4dvr6"))))
66 (build-system cmake-build-system)
67 (arguments
68 '(#:configure-flags '("-DWITH_GCRYPT=ON")
69
70 ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
71 #:tests? #f))
72 (inputs `(("zlib" ,zlib)
73 ("libgcrypt" ,libgcrypt)))
74 (synopsis "SSH client library")
75 (description
76 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for
77 client and server implementations. With libssh, you can remotely execute
78 programs, transfer files, and use a secure and transparent tunnel for your
79 remote applications.")
80 (home-page "http://www.libssh.org")
81 (license license:lgpl2.1+)))
82
83 (define libssh-0.6 ; kept private for use in guile-ssh
84 (package (inherit libssh)
85 (version "0.6.5")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "https://red.libssh.org/attachments/"
89 "download/121/libssh-"
90 version ".tar.xz"))
91 (sha256
92 (base32
93 "0b6wyx6bwbb8jpn8x4rhlrdiqwqrwrs0mxjmrnqykm9kw1ijgm8g"))
94 (patches (search-patches
95 "libssh-0.6.5-CVE-2016-0739.patch"))))))
96
97 (define-public libssh2
98 (package
99 (name "libssh2")
100 (version "1.7.0")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append
104 "https://www.libssh2.org/download/libssh2-"
105 version ".tar.gz"))
106 (sha256
107 (base32
108 "116mh112w48vv9k3f15ggp5kxw5sj4b88dzb5j69llsh7ba1ymp4"))))
109 (build-system gnu-build-system)
110 ;; The installed libssh2.pc file does not include paths to libgcrypt and
111 ;; zlib libraries, so we need to propagate the inputs.
112 (propagated-inputs `(("libgcrypt" ,libgcrypt)
113 ("zlib" ,zlib)))
114 (arguments '(#:configure-flags `("--with-libgcrypt")))
115 (synopsis "Client-side C library implementing the SSH2 protocol")
116 (description
117 "libssh2 is a library intended to allow software developers access to
118 the SSH-2 protocol in an easy-to-use self-contained package. It can be built
119 into an application to perform many different tasks when communicating with
120 a server that supports the SSH-2 protocol.")
121 (license license:bsd-3)
122 (home-page "http://www.libssh2.org/")))
123
124 (define-public openssh
125 (package
126 (name "openssh")
127 (version "7.3p1")
128 (source (origin
129 (method url-fetch)
130 (uri (let ((tail (string-append name "-" version ".tar.gz")))
131 (list (string-append "http://openbsd.cs.fau.de/pub/OpenBSD/OpenSSH/portable/"
132 tail)
133 (string-append "http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
134 tail)
135 (string-append "http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
136 tail))))
137 (sha256 (base32
138 "1k5y1wi29d47cgizbryxrhc1fbjsba2x8l5mqfa9b9nadnd9iyrz"))))
139 (build-system gnu-build-system)
140 (inputs `(("groff" ,groff)
141 ("openssl" ,openssl)
142 ("pam" ,linux-pam)
143 ("zlib" ,zlib)
144 ("xauth" ,xauth))) ;for 'ssh -X' and 'ssh -Y'
145 (arguments
146 `(#:test-target "tests"
147 #:configure-flags '("--sysconfdir=/etc"
148
149 ;; Default value of 'PATH' used by sshd.
150 "--with-default-path=/run/current-system/profile/bin"
151
152 ;; Enable PAM support in sshd.
153 "--with-pam")
154
155 #:phases
156 (modify-phases %standard-phases
157 (add-after 'configure 'reset-/var/empty
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let ((out (assoc-ref outputs "out")))
160 (substitute* "Makefile"
161 (("PRIVSEP_PATH=/var/empty")
162 (string-append "PRIVSEP_PATH=" out "/var/empty")))
163 #t)))
164 (add-before 'check 'patch-tests
165 (lambda _
166 ;; remove 't-exec' regress target which requires user 'sshd'
167 (substitute* "regress/Makefile"
168 (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
169 (string-append pre post)))
170 #t))
171 (replace 'install
172 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
173 ;; install without host keys and system configuration files
174 (and (zero? (apply system* "make" "install-nosysconf" make-flags))
175 (begin
176 (install-file "contrib/ssh-copy-id"
177 (string-append (assoc-ref outputs "out")
178 "/bin/"))
179 (chmod (string-append (assoc-ref outputs "out")
180 "/bin/ssh-copy-id") #o555)
181 (install-file "contrib/ssh-copy-id.1"
182 (string-append (assoc-ref outputs "out")
183 "/share/man/man1/"))
184 #t)))))))
185 (synopsis "Client and server for the secure shell (ssh) protocol")
186 (description
187 "The SSH2 protocol implemented in OpenSSH is standardised by the
188 IETF secsh working group and is specified in several RFCs and drafts.
189 It is composed of three layered components:
190
191 The transport layer provides algorithm negotiation and a key exchange.
192 The key exchange includes server authentication and results in a
193 cryptographically secured connection: it provides integrity, confidentiality
194 and optional compression.
195
196 The user authentication layer uses the established connection and relies on
197 the services provided by the transport layer. It provides several mechanisms
198 for user authentication. These include traditional password authentication
199 as well as public-key or host-based authentication mechanisms.
200
201 The connection layer multiplexes many different concurrent channels over the
202 authenticated connection and allows tunneling of login sessions and
203 TCP-forwarding. It provides a flow control service for these channels.
204 Additionally, various channel-specific options can be negotiated.")
205 (license (license:non-copyleft "file://LICENSE"
206 "See LICENSE in the distribution."))
207 (home-page "http://www.openssh.org/")))
208
209 (define-public guile-ssh
210 (package
211 (name "guile-ssh")
212 (version "0.9.0")
213 (source (origin
214 ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz
215 ;; exists, but the server appears to be too slow and unreliable.
216 (method git-fetch)
217 (uri (git-reference
218 (url "https://github.com/artyom-poptsov/libguile-ssh.git")
219 (commit (string-append "v" version))))
220 (file-name (string-append name "-" version "-checkout"))
221 (sha256
222 (base32
223 "04zs1cykwdyj51ag62ymrkgsja9dbhbaaglkvbfbac0bkxl2ir6d"))))
224 (build-system gnu-build-system)
225 (arguments
226 '(#:phases (alist-cons-after
227 'unpack 'autoreconf
228 (lambda* (#:key inputs #:allow-other-keys)
229 (chmod "doc/version.texi" #o777) ;make it writable
230 (zero? (system* "autoreconf" "-vfi")))
231 (alist-cons-after
232 'install 'fix-libguile-ssh-file-name
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let* ((out (assoc-ref outputs "out"))
235 (libdir (string-append out "/lib"))
236 (guiledir (string-append out
237 "/share/guile/site/2.0")))
238 (substitute* (find-files guiledir ".scm")
239 (("\"libguile-ssh\"")
240 (string-append "\"" libdir "/libguile-ssh\"")))
241
242 ;; Make sure it works.
243 (setenv "GUILE_LOAD_PATH" guiledir)
244 (setenv "GUILE_LOAD_COMPILED_PATH" guiledir)
245 (zero?
246 (system* "guile" "-c" "(use-modules (ssh session))"))))
247 %standard-phases))
248 #:configure-flags (list (string-append "--with-guilesitedir="
249 (assoc-ref %outputs "out")
250 "/share/guile/site/2.0"))
251
252 ;; Tests are not parallel-safe.
253 #:parallel-tests? #f))
254 (native-inputs `(("autoconf" ,autoconf)
255 ("automake" ,automake)
256 ("libtool" ,libtool)
257 ("texinfo" ,texinfo)
258 ("pkg-config" ,pkg-config)
259 ("which" ,which)))
260 (inputs `(("guile" ,guile-2.0)
261 ("libssh" ,libssh-0.6)
262 ("libgcrypt" ,libgcrypt)))
263 (synopsis "Guile bindings to libssh")
264 (description
265 "Guile-SSH is a library that provides access to the SSH protocol for
266 programs written in GNU Guile interpreter. It is a wrapper to the underlying
267 libssh library.")
268 (home-page "https://github.com/artyom-poptsov/libguile-ssh")
269 (license license:gpl3+)))
270
271 (define-public corkscrew
272 (package
273 (name "corkscrew")
274 (version "2.0")
275 (source
276 (origin
277 (method url-fetch)
278 (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-"
279 version ".tar.gz"))
280 (sha256 (base32
281 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
282 (build-system gnu-build-system)
283 (arguments
284 ;; Replace configure phase as the ./configure script does not link
285 ;; CONFIG_SHELL and SHELL passed as parameters
286 '(#:phases
287 (modify-phases %standard-phases
288 (replace 'configure
289 (lambda* (#:key outputs inputs system build target
290 #:allow-other-keys #:rest args)
291 (let* ((configure (assoc-ref %standard-phases 'configure))
292 (prefix (assoc-ref outputs "out"))
293 (bash (which "bash"))
294 ;; Set --build and --host flags as the provided config.guess
295 ;; is not able to detect them
296 (flags `(,(string-append "--prefix=" prefix)
297 ,(string-append "--build=" build)
298 ,(string-append "--host=" (or target build)))))
299 (setenv "CONFIG_SHELL" bash)
300 (zero? (apply system* bash
301 (string-append "." "/configure")
302 flags))))))))
303 (home-page "http://www.agroman.net/corkscrew")
304 (synopsis "Tunneling SSH through HTTP proxies")
305 (description
306 "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING:
307 At the moment only plain text authentication is supported, should you require
308 to use it with your HTTP proxy. Digest based authentication may be supported
309 in future and NTLM based authentication is most likey never be supported.")
310 (license license:gpl2+)))
311
312 (define-public mosh
313 (package
314 (name "mosh")
315 (version "1.2.6")
316 (source (origin
317 (method url-fetch)
318 (uri (string-append "https://mosh.org/mosh-" version ".tar.gz"))
319 (sha256
320 (base32
321 "118fhpm754wpklf1blnlq5xbvrxqml6rdfs3b07wg666zkxvg0ky"))))
322 (build-system gnu-build-system)
323 (arguments
324 '(#:phases
325 (modify-phases %standard-phases
326 (add-after 'install 'wrap
327 (lambda* (#:key outputs #:allow-other-keys)
328 ;; Make sure 'mosh' can find 'mosh-client' and
329 ;; 'mosh-server'.
330 (let* ((out (assoc-ref outputs "out"))
331 (bin (string-append out "/bin")))
332 (wrap-program (string-append bin "/mosh")
333 `("PATH" ":" prefix (,bin)))))))))
334 (native-inputs
335 `(("pkg-config" ,pkg-config)))
336 (inputs
337 `(("openssl" ,openssl)
338 ("perl" ,perl)
339 ("perl-io-tty" ,perl-io-tty)
340 ("zlib" ,zlib)
341 ("ncurses" ,ncurses)
342 ("protobuf" ,protobuf)
343 ("boost-headers" ,boost)))
344 (home-page "https://mosh.org/")
345 (synopsis "Remote shell tolerant to intermittent connectivity")
346 (description
347 "Remote terminal application that allows roaming, supports intermittent
348 connectivity, and provides intelligent local echo and line editing of user
349 keystrokes. Mosh is a replacement for SSH. It's more robust and responsive,
350 especially over Wi-Fi, cellular, and long-distance links.")
351 (license license:gpl3+)))
352
353 (define-public dropbear
354 (package
355 (name "dropbear")
356 (version "2016.74")
357 (source (origin
358 (method url-fetch)
359 (uri (string-append
360 "https://matt.ucc.asn.au/" name "/releases/"
361 name "-" version ".tar.bz2"))
362 (sha256
363 (base32
364 "14c8f4gzixf0j9fkx68jgl85q7b05852kk0vf09gi6h0xmafl817"))))
365 (build-system gnu-build-system)
366 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
367 (inputs `(("zlib" ,zlib)))
368 (synopsis "Small SSH server and client")
369 (description "Dropbear is a relatively small SSH server and
370 client. It runs on a variety of POSIX-based platforms. Dropbear is
371 particularly useful for embedded systems, such as wireless routers.")
372 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
373 (license (license:x11-style "" "See file LICENSE."))))
374
375 (define-public liboop
376 (package
377 (name "liboop")
378 (version "1.0")
379 (source
380 (origin
381 (method url-fetch)
382 (uri (string-append "http://download.ofb.net/liboop/liboop-"
383 version ".tar.gz"))
384 (sha256
385 (base32
386 "0z6rlalhvfca64jpvksppc9bdhs7jwhiw4y35g5ibvh91xp3rn1l"))
387 (patches (search-patches "liboop-mips64-deplibs-fix.patch"))))
388 (build-system gnu-build-system)
389 (home-page "http://www.lysator.liu.se/liboop/")
390 (synopsis "Event loop library")
391 (description "Liboop is a low-level event loop management library for
392 POSIX-based operating systems. It supports the development of modular,
393 multiplexed applications which may respond to events from several sources. It
394 replaces the \"select() loop\" and allows the registration of event handlers
395 for file and network I/O, timers and signals. Since processes use these
396 mechanisms for almost all external communication, liboop can be used as the
397 basis for almost any application.")
398 (license license:lgpl2.1+)))
399
400 (define-public lsh
401 (package
402 (name "lsh")
403 (version "2.1")
404 (source (origin
405 (method url-fetch)
406 (uri (string-append "mirror://gnu/lsh/lsh-"
407 version ".tar.gz"))
408 (sha256
409 (base32
410 "1qqjy9zfzgny0rkb27c8c7dfsylvb6n0ld8h3an2r83pmaqr9gwb"))
411 (modules '((guix build utils)))
412 (snippet
413 '(begin
414 (substitute* "src/testsuite/functions.sh"
415 (("localhost")
416 ;; Avoid host name lookups since they don't work in
417 ;; chroot builds.
418 "127.0.0.1")
419 (("set -e")
420 ;; Make tests more verbose.
421 "set -e\nset -x"))
422
423 (substitute* (find-files "src/testsuite" "-test$")
424 (("localhost") "127.0.0.1"))
425
426 (substitute* "src/testsuite/login-auth-test"
427 (("/bin/cat") "cat"))))))
428 (build-system gnu-build-system)
429 (native-inputs
430 `(("m4" ,m4)
431 ("guile" ,guile-2.0)
432 ("gperf" ,gperf)
433 ("psmisc" ,psmisc))) ; for `killall'
434 (inputs
435 `(("nettle" ,nettle-2)
436 ("linux-pam" ,linux-pam)
437
438 ;; 'rl.c' uses the 'CPPFunction' type, which is no longer in
439 ;; Readline 6.3.
440 ("readline" ,readline-6.2)
441
442 ("liboop" ,liboop)
443 ("zlib" ,zlib)
444 ("gmp" ,gmp)
445
446 ;; The server (lshd) invokes xauth when X11 forwarding is requested.
447 ;; This adds 24 MiB (or 27%) to the closure of lsh.
448 ("xauth" ,xauth)))
449 (arguments
450 '(;; Skip the `configure' test that checks whether /dev/ptmx &
451 ;; co. work as expected, because it relies on impurities (for
452 ;; instance, /dev/pts may be unavailable in chroots.)
453 #:configure-flags '("lsh_cv_sys_unix98_ptys=yes")
454
455 ;; FIXME: Tests won't run in a chroot, presumably because
456 ;; /etc/profile is missing, and thus clients get an empty $PATH
457 ;; and nothing works.
458 #:tests? #f
459
460 #:phases
461 (modify-phases %standard-phases
462 (add-before 'configure 'pre-configure
463 (lambda* (#:key inputs #:allow-other-keys)
464 (let* ((nettle (assoc-ref inputs "nettle"))
465 (sexp-conv (string-append nettle "/bin/sexp-conv")))
466 ;; Make sure 'lsh' and 'lshd' pick 'sexp-conv' in the right place
467 ;; by default.
468 (substitute* "src/environ.h.in"
469 (("^#define PATH_SEXP_CONV.*")
470 (string-append "#define PATH_SEXP_CONV \""
471 sexp-conv "\"\n")))
472
473 ;; Same for the 'lsh-authorize' script.
474 (substitute* "src/lsh-authorize"
475 (("=sexp-conv")
476 (string-append "=" sexp-conv)))
477
478 ;; Tell lshd where 'xauth' lives. Another option would be to
479 ;; hardcode "/run/current-system/profile/bin/xauth", thereby
480 ;; reducing the closure size, but that wouldn't work on foreign
481 ;; distros.
482 (with-fluids ((%default-port-encoding "ISO-8859-1"))
483 (substitute* "src/server_x11.c"
484 (("define XAUTH_PROGRAM.*")
485 (string-append "define XAUTH_PROGRAM \""
486 (assoc-ref inputs "xauth")
487 "/bin/xauth\"\n")))))
488
489 ;; Tests rely on $USER being set.
490 (setenv "USER" "guix"))))))
491 (home-page "http://www.lysator.liu.se/~nisse/lsh/")
492 (synopsis "GNU implementation of the Secure Shell (ssh) protocols")
493 (description
494 "GNU lsh is a free implementation of the SSH version 2 protocol. It is
495 used to create a secure line of communication between two computers,
496 providing shell access to the server system from the client. It provides
497 both the server daemon and the client application, as well as tools for
498 manipulating key files.")
499 (license license:gpl2+)))
500
501 (define-public sshpass
502 (package
503 (name "sshpass")
504 (version "1.06")
505 (synopsis "Non-interactive password authentication with SSH")
506 (home-page "https://sourceforge.net/projects/sshpass/")
507 (source
508 (origin
509 (method url-fetch)
510 (uri (string-append "mirror://sourceforge/sshpass/sshpass/"
511 version "/sshpass-" version ".tar.gz"))
512 (sha256
513 (base32
514 "0q7fblaczb7kwbsz0gdy9267z0sllzgmf0c7z5c9mf88wv74ycn6"))))
515 (build-system gnu-build-system)
516 (description "sshpass is a tool for non-interactivly performing password
517 authentication with SSH's so-called @dfn{interactive keyboard password
518 authentication}.")
519 (license license:gpl2+)))