mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-26 12:39:36 -05:00
ssh: Add a longer SSH timeout by default.
* guix/ssh.scm (open-ssh-session): Add #:timeout parameter, and add call to 'session-set!' to honor it.
This commit is contained in:
parent
00d7321958
commit
81c5873ab7
1 changed files with 8 additions and 2 deletions
10
guix/ssh.scm
10
guix/ssh.scm
|
@ -61,11 +61,16 @@ (define %compression
|
||||||
"zlib@openssh.com,zlib")
|
"zlib@openssh.com,zlib")
|
||||||
|
|
||||||
(define* (open-ssh-session host #:key user port identity
|
(define* (open-ssh-session host #:key user port identity
|
||||||
(compression %compression))
|
(compression %compression)
|
||||||
|
(timeout 3600))
|
||||||
"Open an SSH session for HOST and return it. IDENTITY specifies the file
|
"Open an SSH session for HOST and return it. IDENTITY specifies the file
|
||||||
name of a private key to use for authenticating with the host. When USER,
|
name of a private key to use for authenticating with the host. When USER,
|
||||||
PORT, or IDENTITY are #f, use default values or whatever '~/.ssh/config'
|
PORT, or IDENTITY are #f, use default values or whatever '~/.ssh/config'
|
||||||
specifies; otherwise use them. Throw an error on failure."
|
specifies; otherwise use them. Install TIMEOUT as the maximum time in seconds
|
||||||
|
after which a read or write operation on a channel of the returned session is
|
||||||
|
considered as failing.
|
||||||
|
|
||||||
|
Throw an error on failure."
|
||||||
(let ((session (make-session #:user user
|
(let ((session (make-session #:user user
|
||||||
#:identity identity
|
#:identity identity
|
||||||
#:host host
|
#:host host
|
||||||
|
@ -86,6 +91,7 @@ (define* (open-ssh-session host #:key user port identity
|
||||||
;; Use public key authentication, via the SSH agent if it's available.
|
;; Use public key authentication, via the SSH agent if it's available.
|
||||||
(match (userauth-public-key/auto! session)
|
(match (userauth-public-key/auto! session)
|
||||||
('success
|
('success
|
||||||
|
(session-set! session 'timeout timeout)
|
||||||
session)
|
session)
|
||||||
(x
|
(x
|
||||||
(disconnect! session)
|
(disconnect! session)
|
||||||
|
|
Loading…
Reference in a new issue