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))
49 (uri (string-append "https://red.libssh.org/attachments/download/87/libssh-"
53 "1jyaj9h1iglvn02hrvcchbx8ycjpj8b91h8mi459k7q5jp2xgd9b"))
55 ;; Apply the patch as discussed at
56 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00180.html>.
59 "http://git.libssh.org/projects/libssh.git/patch/?id=a033b93c616f4a81afc3fc6a017396d507d96c19")
63 "16fdkjcnhc6j7qxz9575fzr9044927ws5259yh0xb9yv1q14j0vh")))))))
64 (build-system cmake-build-system)
66 '(#:configure-flags '("-DWITH_GCRYPT=ON")
68 ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
70 (inputs `(("zlib" ,zlib)
71 ;; Link against an older gcrypt, because libssh tries to access
72 ;; fields of 'gcry_thread_cbs' that are now private:
73 ;; src/threads.c:72:26: error: 'struct gcry_thread_cbs' has no member named 'mutex_init'
74 ("libgcrypt", libgcrypt-1.5)))
75 (synopsis "SSH client library")
77 "libssh is a C library implementing the SSHv2 and SSHv1 protocol for
78 client and server implementations. With libssh, you can remotely execute
79 programs, transfer files, and use a secure and transparent tunnel for your
80 remote applications.")
81 (home-page "http://www.libssh.org")
82 (license license:lgpl2.1+)))
84 (define libssh-0.5 ; kept private
85 (package (inherit libssh)
89 (uri (string-append "https://red.libssh.org/attachments/download/51/libssh-"
93 "17cfdff4hc0ijzrr15biq29fiabafz0bw621zlkbwbc1zh2hzpy0"))
94 (patches (list (search-patch "libssh-CVE-2014-0017.patch")))))))
96 (define-public libssh2
103 "http://www.libssh2.org/download/libssh2-"
106 "0vdr478dbhbdgnniqmirawjb7mrcxckn4slhhrijxnzrkmgziipa"))))
107 (build-system gnu-build-system)
108 ;; The installed libssh2.pc file does not include paths to libgcrypt and
109 ;; zlib libraries, so we need to propagate the inputs.
110 (propagated-inputs `(("libgcrypt" ,libgcrypt)
112 (arguments '(#:configure-flags `("--with-libgcrypt")))
113 (synopsis "Client-side C library implementing the SSH2 protocol")
115 "libssh2 is a library intended to allow software developers access to
116 the SSH-2 protocol in an easy-to-use self-contained package. It can be built
117 into an application to perform many different tasks when communicating with
118 a server that supports the SSH-2 protocol.")
119 (license license:bsd-3)
120 (home-page "http://www.libssh2.org/")))
122 (define-public openssh
128 (uri (let ((tail (string-append name "-" version ".tar.gz")))
129 (list (string-append "ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
131 (string-append "ftp://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/"
134 "03hnrqvjq6ghg1mp3gkarfxh6g3x1n1vjrzpbc5lh9717vklrxiz"))))
135 (build-system gnu-build-system)
136 (inputs `(("groff" ,groff)
140 `(#:test-target "tests"
143 'configure 'reset-/var/empty
144 (lambda* (#:key outputs #:allow-other-keys)
145 (let ((out (assoc-ref outputs "out")))
146 (substitute* "Makefile"
147 (("PRIVSEP_PATH=/var/empty")
148 (string-append "PRIVSEP_PATH=" out "/var/empty")))))
152 ;; remove 't-exec' regress target which requires user 'sshd'
153 (substitute* "regress/Makefile"
154 (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
155 (string-append pre post))))
158 (lambda* (#:key (make-flags '()) #:allow-other-keys)
159 ;; install without host keys and system configuration files
160 (zero? (apply system* "make" "install-nosysconf" make-flags)))
161 %standard-phases)))))
162 (synopsis "Client and server for the secure shell (ssh) protocol")
164 "The SSH2 protocol implemented in OpenSSH is standardised by the
165 IETF secsh working group and is specified in several RFCs and drafts.
166 It is composed of three layered components:
168 The transport layer provides algorithm negotiation and a key exchange.
169 The key exchange includes server authentication and results in a
170 cryptographically secured connection: it provides integrity, confidentiality
171 and optional compression.
173 The user authentication layer uses the established connection and relies on
174 the services provided by the transport layer. It provides several mechanisms
175 for user authentication. These include traditional password authentication
176 as well as public-key or host-based authentication mechanisms.
178 The connection layer multiplexes many different concurrent channels over the
179 authenticated connection and allows tunneling of login sessions and
180 TCP-forwarding. It provides a flow control service for these channels.
181 Additionally, various channel-specific options can be negotiated.")
182 (license (license:non-copyleft "file://LICENSE"
183 "See LICENSE in the distribution."))
184 (home-page "http://www.openssh.org/")))
186 (define-public guile-ssh
193 (url "https://github.com/artyom-poptsov/libguile-ssh.git")
194 (commit (string-append "v" version))))
197 "1wcv10xv7ayrhrg77zyng6flknnlkzhni24nf8x9nic00zha8znk"))))
198 (build-system gnu-build-system)
200 '(#:phases (alist-cons-after
202 (lambda* (#:key inputs #:allow-other-keys)
203 (chmod "doc/version.texi" #o777) ;make it writable
204 (zero? (system* "autoreconf" "-vfi")))
206 'install 'fix-libguile-ssh-file-name
207 (lambda* (#:key outputs #:allow-other-keys)
208 (let* ((out (assoc-ref outputs "out"))
209 (libdir (string-append out "/lib"))
210 (guiledir (string-append out
211 "/share/guile/site/2.0")))
212 (substitute* (find-files guiledir ".scm")
213 (("\"libguile-ssh\"")
214 (string-append "\"" libdir "/libguile-ssh\"")))
216 ;; Make sure it works.
217 (setenv "GUILE_LOAD_PATH" guiledir)
218 (setenv "GUILE_LOAD_COMPILED_PATH" guiledir)
220 (system* "guile" "-c" "(use-modules (ssh session))"))))
222 #:configure-flags (list (string-append "--with-guilesitedir="
223 (assoc-ref %outputs "out")
224 "/share/guile/site/2.0"))
226 ;; Tests are not parallel-safe.
227 #:parallel-tests? #f))
228 (native-inputs `(("autoconf" ,autoconf)
229 ("automake" ,automake)
232 ("pkg-config" ,pkg-config)
234 (inputs `(("guile" ,guile-2.0)
236 ("libgcrypt" ,libgcrypt-1.5)))
237 (synopsis "Guile bindings to libssh")
239 "Guile-SSH is a library that provides access to the SSH protocol for
240 programs written in GNU Guile interpreter. It is a wrapper to the underlying
242 (home-page "https://github.com/artyom-poptsov/libguile-ssh")
243 (license license:gpl3+)))
245 (define-public corkscrew
252 (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-"
255 "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd"))))
256 (build-system gnu-build-system)
258 ;; Replace configure phase as the ./configure script does not link
259 ;; CONFIG_SHELL and SHELL passed as parameters
263 (lambda* (#:key outputs inputs system target
264 #:allow-other-keys #:rest args)
265 (let* ((configure (assoc-ref %standard-phases 'configure))
266 (prefix (assoc-ref outputs "out"))
267 (bash (which "bash"))
268 ;; Set --build and --host flags as the provided config.guess
269 ;; is not able to detect them
270 (flags `(,(string-append "--prefix=" prefix)
271 ,(string-append "--build=" system)
272 ,(string-append "--host="
273 (or target system)))))
274 (setenv "CONFIG_SHELL" bash)
275 (zero? (apply system* bash
276 (string-append "." "/configure")
279 (home-page "http://www.agroman.net/corkscrew")
280 (synopsis "Tunneling SSH through HTTP proxies")
282 "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING:
283 At the moment only plain text authentication is supported, should you require
284 to use it with your HTTP proxy. Digest based authentication may be supported
285 in future and NTLM based authentication is most likey never be supported.")
286 (license license:gpl2+)))
294 (uri (string-append "http://mosh.mit.edu/mosh-"
298 "0inzfmqrab3n97m7rrmhd4xh3hjz0xva2sfl5m06w11668r0skg7"))))
299 (build-system gnu-build-system)
301 '(#:phases (alist-cons-after
303 (lambda* (#:key outputs #:allow-other-keys)
304 ;; Make sure 'mosh' can find 'mosh-client' and
306 (let* ((out (assoc-ref outputs "out"))
307 (bin (string-append out "/bin")))
308 (wrap-program (string-append bin "/mosh")
309 `("PATH" ":" prefix (,bin)))))
312 `(("pkg-config" ,pkg-config)))
314 `(("openssl" ,openssl)
316 ("perl-io-tty" ,perl-io-tty)
319 ("protobuf" ,protobuf)
320 ("boost-headers" ,boost)))
321 (home-page "http://mosh.mit.edu/")
322 (synopsis "Remote shell tolerant to intermittent connectivity")
324 "Remote terminal application that allows roaming, supports intermittent
325 connectivity, and provides intelligent local echo and line editing of user
326 keystrokes. Mosh is a replacement for SSH. It's more robust and responsive,
327 especially over Wi-Fi, cellular, and long-distance links.")
328 (license license:gpl3+)))
330 (define-public dropbear
337 "http://matt.ucc.asn.au/" name "/releases/" name "-" version ".tar.bz2"))
339 (base32 "1bjpbg2vi5f332q4bqxkidkjfxsqmnqvp4g1wyh8d99b8gg94nar"))))
340 (build-system gnu-build-system)
341 (arguments `(#:tests? #f)) ; There is no "make check" or anything similar
342 (inputs `(("zlib" ,zlib)))
343 (synopsis "Small SSH server and client")
344 (description "Dropbear is a relatively small SSH server and
345 client. It runs on a variety of POSIX-based platforms. Dropbear is
346 particularly useful for embedded systems, such as wireless routers.")
347 (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html")
348 (license (license:x11-style "" "See file LICENSE."))))