{"size": 1439, "ext": "scrbl", "max_stars_repo_path": "doc/utils/rfc/ssh.scrbl", "max_stars_repo_name": "christoff-buerger/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/utils/rfc/ssh.scrbl", "max_issues_repo_name": "christoff-buerger/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/utils/rfc/ssh.scrbl", "max_forks_repo_name": "christoff-buerger/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 29.9791666667, "max_line_length": 77, "alphanum_fraction": 0.7310632384}
@; -*- coding:utf-8; -*-

@subsection[:tag "rfc.ssh"]{(rfc ssh) - SSH library}

@define[Library]{@name{rfc ssh}}
@desc{This library provides SSH programmatic operations. The library supports
only SSH2 defined in RFC 4250 - 4256.}

Following is the simple example to execute shell command via SSH:
@codeblock{
(import (rfc ssh))

(define transport 
  (open-client-ssh-transport! (make-client-ssh-transport "localhost" "22")))

(define user "guest1")
(define pass "pass1")

(ssh-authenticate transport +ssh-auth-method-password+ user pass)
(let-values (((status response) (ssh-execute-command transport "ls -l")))
  (print (utf8->string response)))
}

@subsubsection{SSH transport}

This represents SSH transport layer defined in RFC 4253.

@define[Function]{@name{ssh-transport?} @args{obj}}
@desc{Returns #t if the given @var{obj} is SSH transport, otherwise #f.}

@define[Function]{@name{make-client-ssh-transport} @args{server port}}
@desc{Creates a SSH transport which connects to given @var{server} on port
@var{port}. @var{server} and @var{port} must be srtings.

Creating SSH transport doesn't open socket. To connect to the @var{server}, 
@code{open-client-ssh-transport!} must be called.
}

@define[Function]{@name{open-client-ssh-transport!} @args{transport}}
@desc{Opens given @var{transport}. This procedure does the following steps:
@itemlist{
  @item{Make a client socket}
  @item{Version exchange}
  @item{Key exchange}
}
}

