Skip to content
DEPRECATED: Please use https://github.com/gliderlabs/ssh instead
Branch: master
Clone or download
Pull request Compare This branch is 6 commits behind hnakamur:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
.travis.yml
LICENSE
README.md
example_test.go
server.go

README.md

go-sshd Build Status Go Report Card GoDoc MIT licensed

A sshd written in Go. Forked from github.com/jpillora/go-and-ssh. Only supported request types are exec, shell, pty-req, and window-change.

Example usage

Run the example server.

Get the source.

go get github.com/hnakamur/go-sshd
cd $GOPATH/src/github.com/hnakamur/go-sshd/example

Generate the sever host key.

ssh-keygen -t rsa -b 2048 -f id_rsa -N ''

Run the server at the address 127.0.0.1:2022

go run main.go

Run a ssh client

Run a ssh client. You can see the password in the example source.

$ ssh -o UserKnownHostsFile=/dev/null -p 2022 foo@127.0.0.1
The authenticity of host '[127.0.0.1]:2022 ([127.0.0.1]:2022)' can't be established.
RSA key fingerprint is SHA256:wr...(masked)...wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[127.0.0.1]:2022' (RSA) to the list of known hosts.
foo@127.0.0.1's password:
$ ls
id_rsa  id_rsa.pub  main.go
$ exit
exit
Connection to 127.0.0.1 closed.

License

MIT

You can’t perform that action at this time.