ssh: Implement authentication for new ssh server
This commit is contained in:
parent
66b397e9da
commit
45f63935cd
10 changed files with 259 additions and 1 deletions
17
pkg/sshx/sshx.go
Normal file
17
pkg/sshx/sshx.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package sshx
|
||||
|
||||
import "github.com/gliderlabs/ssh"
|
||||
|
||||
// ParseAllKeys parses all keys from the list of bytes
|
||||
func ParseAllKeys(bytes []byte) (keys []ssh.PublicKey) {
|
||||
var key ssh.PublicKey
|
||||
var err error
|
||||
for {
|
||||
key, _, _, bytes, err = ssh.ParseAuthorizedKey(bytes)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
keys = append(keys, key)
|
||||
}
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue