abbbi / go-sshd

sshd for test purpose written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-sshd PkgGoDev MIT licensed

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

This sshd is NOT production ready. I use this sshd for testing purpose only.

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

About

sshd for test purpose written in Go.

License:MIT License


Languages

Language:Go 100.0%