INNER CODE UNIT · Go
sshServer
yahoo/vssh · client_test.go:337
func sshServer() {
config := &ssh.ServerConfig{
PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) {
if c.User() == "vssh" && string(pass) == "vssh" {
return nil, nil
}
return nil, fmt.Errorf("password wrong for %q", c.User())
},
}
private, err := ssh.ParsePrivateKey(rsaPrivate)
if err != nil {
log.Fatal(err)
}
config.AddHostKey(private)
l, err := net.Listen("tcp", testSrvAddr)