output port

This commit is contained in:
hloeffler 2017-02-04 22:45:40 +01:00
parent 39bc88bc6d
commit 398834c640
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))
}