Commit fe737ee9 authored by Eric's avatar Eric Committed by Eric_Lee

fix bugs: parse privatekey

parent f2d5a7d7
......@@ -58,7 +58,7 @@ func (sc *SSHClientConfig) Config() (config *gossh.ClientConfig, err error) {
}
}
if sc.PrivateKey != "" {
if signer, err := gossh.ParsePrivateKey([]byte(sc.PrivateKey)); err != nil {
if signer, err := gossh.ParsePrivateKeyWithPassphrase([]byte(sc.PrivateKey),[]byte(sc.Password)); err != nil {
err = fmt.Errorf("parse private key error: %s", err)
return config, err
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment