Merge pull request #21 from hloeffler/master

output port
This commit is contained in:
Jeff Lindsay 2017-02-04 16:51:04 -06:00 committed by GitHub
commit f3131153bc
2 changed files with 6 additions and 6 deletions

@ -17,17 +17,17 @@ func main() {
publicKeyString := keyType + " " + b64.StdEncoding.EncodeToString(s.PublicKey().Marshal())
io.WriteString(s, "Hello "+user+"\n")
io.WriteString(s, "your publicKey:\n")
io.WriteString(s, publicKeyString+"\n")
io.WriteString(s, "Hello "+user+"\n\n")
io.WriteString(s, "your public key:\n")
io.WriteString(s, publicKeyString+"\n\n")
})
publicKeyHandler := ssh.PublicKeyAuth(func(user string, key ssh.PublicKey) bool {
//allow all
// allow all keys
// use ssh.KeysEqual() to compare agains know keys
return true
})
log.Println("starting ssh server on port: 2222")
log.Fatal(ssh.ListenAndServe(":2222", nil, publicKeyHandler))
}

@ -14,6 +14,6 @@ func main() {
io.WriteString(s, "Hello "+user+"\n")
})
log.Println("starting ssh server on port: 2222")
log.Fatal(ssh.ListenAndServe(":2222", nil))
}