1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages ssh)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages gnupg)
24 #:use-module (gnu packages groff)
25 #:use-module (gnu packages elf)
26 #:use-module (gnu packages guile)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages texinfo)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages ncurses)
32 #:autoload (gnu packages protobuf) (protobuf)
33 #:autoload (gnu packages boost) (boost)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages tls)
36 #:use-module (gnu packages)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system cmake))
50 "https://red.libssh.org/attachments/download/121/libssh-"
54 "0b6wyx6bwbb8jpn8x4rhlrdiqwqrwrs0mxjmrnqykm9kw1ijgm8g"))))
55 (build-system cmake-build-system)
57 '(#:configure-flags '("-DWITH_GCRYPT=ON")
59 ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
61 (inputs `(("zlib" ,zlib)
62 ("libgcrypt", libgcrypt)))
63 (synopsis "SSH client library")
65 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for
66 client and server implementations. With libssh, you can remotely execute
67 programs, transfer files, and use a secure and transparent tunnel for your
68 remote applications.")
69 (home-page "http://www.libssh.org")
70 (license license:lgpl2.1+)))
72 (define libssh-0.5 ; kept private
73 (package (inherit libssh)
77 (uri (string-append "https://red.libssh.org/attachments/download/51/libssh-"
81 "17cfdff4hc0ijzrr15biq29fiabafz0bw621zlkbwbc1zh2hzpy0"))
82 (patches (list (search-patch "libssh-CVE-2014-0017.patch")))))))
84 (define-public libssh2
91 "http://www.libssh2.org/download/libssh2-"
94 "0vdr478dbhbdgnniqmirawjb7mrcxckn4slhhrijxnzrkmgziipa"))))
95 (build-system gnu-build-system)
96 ;; The installed libssh2.pc file does not include paths to libgcrypt and
97 ;; zlib libraries, so we need to propagate the inputs.
98 (propagated-inputs `(("libgcrypt" ,libgcrypt)
100 (arguments '(#:configure-flags `("--with-libgcrypt")))
101 (synopsis "Client-side C library implementing the SSH2 protocol")
103 "libssh2 is a library intended to allow software developers access to
104 the SSH-2 protocol in an easy-to-use self-contained package. It can be built
105 into an application to perform many different tasks when communicating with
106 a server that supports the SSH-2 protocol.")
107 (license license:bsd-3)
108 (home-page "http://www.libssh2.org/")))
110 (define-public openssh
116 (uri (let ((tail (string-append name "-" version ".tar.gz")))
117 (list (string-append "http://openbsd.cs.fau.de/pub/OpenBSD/OpenSSH/portable/"
119 (string-append "http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
121 (string-append "http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
124 "1rc52jyc5v5b8j9kvasrnz9vnj9b0i7fw4nqac8wix0r794k4ngx"))))
125 (build-system gnu-build-system)
126 (inputs `(("groff" ,groff)
130 `(#:test-target "tests"
133 'configure 'reset-/var/empty
134 (lambda* (#:key outputs #:allow-other-keys)
135 (let ((out (assoc-ref outputs "out")))
136 (substitute* "Makefile"
137 (("PRIVSEP_PATH=/var/empty")
138 (string-append "PRIVSEP_PATH=" out "/var/empty")))))
142 ;; remove 't-exec' regress target which requires user 'sshd'
143 (substitute* "regress/Makefile"
144 (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
145 (string-append pre post))))
148 (lambda* (#:key (make-flags '()) #:allow-other-keys)
149 ;; install without host keys and system configuration files
150 (zero? (apply system* "make" "install-nosysconf" make-flags)))
151 %standard-phases)))))
152 (synopsis "Client and server for the secure shell (ssh) protocol")
154 "The SSH2 protocol implemented in OpenSSH is standardised by the
155 IETF secsh working group and is specified in several RFCs and drafts.
156 It is composed of three layered components:
158 The transport layer provides algorithm negotiation and a key exchange.
159 The key exchange includes server authentication and results in a
160 cryptographically secured connection: it provides integrity, confidentiality
161 and optional compression.
163 The user authentication layer uses the established connection and relies on
164 the services provided by the transport layer. It provides several mechanisms
165 for user authentication. These include traditional password authentication
166 as well as public-key or host-based authentication mechanisms.
168 The connection layer multiplexes many different concurrent channels over the
169 authenticated connection and allows tunneling of login sessions and
170 TCP-forwarding. It provides a flow control service for these channels.
171 Additionally, various channel-specific options can be negotiated.")
172 (license (license:non-copyleft "file://LICENSE"
173 "See LICENSE in the distribution."))
174 (home-page "http://www.openssh.org/")))
176 (define-public guile-ssh
181 ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz
182 ;; exists, but the server appears to be too slow and unreliable.
185 (url "https://github.com/artyom-poptsov/libguile-ssh.git")
186 (commit (string-append "v" version))))
189 "1ld2khzylaylhqfsfcvbxs95frvm8pkr7dq40ia1wwn9c349fcdv"))))
190 (build-system gnu-build-system)
192 '(#:phases (alist-cons-after
194 (lambda* (#:key inputs #:allow-other-keys)
195 (chmod "doc/version.texi" #o777) ;make it writable
196 (zero? (system* "autoreconf" "-vfi")))
198 'install 'fix-libguile-ssh-file-name
199 (lambda* (#:key outputs #:allow-other-keys)
200 (let* ((out (assoc-ref outputs "out"))
201 (libdir (string-append out "/lib"))
202 (guiledir (string-append out
203 "/share/guile/site/2.0")))
204 (substitute* (find-files guiledir ".scm")
205 (("\"libguile-ssh\"")
206 (string-append "\"" libdir "/libguile-ssh\"")))
208 ;; Make sure it works.
209 (setenv "GUILE_LOAD_PATH" guiledir)
210 (setenv "GUILE_LOAD_COMPILED_PATH" guiledir)
212 (system* "guile" "-c" "(use-modules (ssh session))"))))
214 #:configure-flags (list (string-append "--with-guilesitedir="
215 (assoc-ref %outputs "out")
216 "/share/guile/site/2.0"))
218 ;; Tests are not parallel-safe.
219 #:parallel-tests? #f))
220 (native-inputs `(("autoconf" ,autoconf)
221 ("automake" ,automake)
224 ("pkg-config" ,pkg-config)
226 (inputs `(("guile" ,guile-2.0)
228 ("libgcrypt" ,libgcrypt)))
229 (synopsis "Guile bindings to libssh")
231 "Guile-SSH is a library that provides access to the SSH protocol for
232 programs written in GNU Guile interpreter. It is a wrapper to the underlying
234 (home-page "https://github.com/artyom-poptsov/libguile-ssh")
235 (license license:gpl3+)))
237 (define-public corkscrew
244 (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-"
247 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
248 (build-system gnu-build-system)
250 ;; Replace configure phase as the ./configure script does not link
251 ;; CONFIG_SHELL and SHELL passed as parameters
255 (lambda* (#:key outputs inputs system build target
256 #:allow-other-keys #:rest args)
257 (let* ((configure (assoc-ref %standard-phases 'configure))
258 (prefix (assoc-ref outputs "out"))
259 (bash (which "bash"))
260 ;; Set --build and --host flags as the provided config.guess
261 ;; is not able to detect them
262 (flags `(,(string-append "--prefix=" prefix)
263 ,(string-append "--build=" build)
264 ,(string-append "--host=" (or target build)))))
265 (setenv "CONFIG_SHELL" bash)
266 (zero? (apply system* bash
267 (string-append "." "/configure")
270 (home-page "http://www.agroman.net/corkscrew")
271 (synopsis "Tunneling SSH through HTTP proxies")
273 "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING:
274 At the moment only plain text authentication is supported, should you require
275 to use it with your HTTP proxy. Digest based authentication may be supported
276 in future and NTLM based authentication is most likey never be supported.")
277 (license license:gpl2+)))
285 (uri (string-append "https://mosh.mit.edu/mosh-"
289 "1qsb0y882yfgwnpy6f98pi5xqm6kykdsrxzvaal37hs7szjhky0s"))))
290 (build-system gnu-build-system)
292 '(#:phases (alist-cons-after
294 (lambda* (#:key outputs #:allow-other-keys)
295 ;; Make sure 'mosh' can find 'mosh-client' and
297 (let* ((out (assoc-ref outputs "out"))
298 (bin (string-append out "/bin")))
299 (wrap-program (string-append bin "/mosh")
300 `("PATH" ":" prefix (,bin)))))
303 `(("pkg-config" ,pkg-config)))
305 `(("openssl" ,openssl)
307 ("perl-io-tty" ,perl-io-tty)
310 ("protobuf" ,protobuf)
311 ("boost-headers" ,boost)))
312 (home-page "http://mosh.mit.edu/")
313 (synopsis "Remote shell tolerant to intermittent connectivity")
315 "Remote terminal application that allows roaming, supports intermittent
316 connectivity, and provides intelligent local echo and line editing of user
317 keystrokes. Mosh is a replacement for SSH. It's more robust and responsive,
318 especially over Wi-Fi, cellular, and long-distance links.")
319 (license license:gpl3+)))
321 (define-public dropbear
328 "http://matt.ucc.asn.au/" name "/releases/"
329 name "-" version ".tar.bz2"))
331 (base32 "1bjpbg2vi5f332q4bqxkidkjfxsqmnqvp4g1wyh8d99b8gg94nar"))))
332 (build-system gnu-build-system)
333 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
334 (inputs `(("zlib" ,zlib)))
335 (synopsis "Small SSH server and client")
336 (description "Dropbear is a relatively small SSH server and
337 client. It runs on a variety of POSIX-based platforms. Dropbear is
338 particularly useful for embedded systems, such as wireless routers.")
339 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
340 (license (license:x11-style "" "See file LICENSE."))))