Skip to content

Commit

Permalink
output port
Browse files Browse the repository at this point in the history
  • Loading branch information
hloeffler committed Feb 4, 2017
1 parent 39bc88b commit 398834c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions _example/public_key/public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

}
2 changes: 1 addition & 1 deletion _example/simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

}

0 comments on commit 398834c

Please sign in to comment.