Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(use minissh nrepl)
;; the default /dev/random causes hangs
(use tweetnacl) (current-entropy-port (open-input-file "/dev/urandom"))
;; the secret key would normally be kept safe
(define host-pk
(define host-sk
(print "test with: ssh localhost -p 22022 repl # any user, any password")
host-pk host-sk
(lambda (ssh)
(userauth-accept ssh password: (lambda _ #t) publickey: (lambda _ #t))
(tcp-read-timeout #f)
(lambda (ch)
(lambda ()
ch (lambda ()
(print "this is a CHICKEN SSH server, demoing minissh")
(cond ((channel-command ch) =>
(lambda (cmd) (print "-=- you ran command '" cmd "' -=-" )))
(else (print "-=- you ran ssh interactively -+-") )))))))
(lambda () (channel-accept ssh)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.