We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用了私钥登陆但是设置了私钥密码会有问题: unable to connect: parse private key failed: ssh: cannot decode encrypted private keys
可以支持下带密码的秘钥登陆: 原文 https://stackoverflow.com/questions/42105432/how-to-use-an-encrypted-private-key-with-golang-ssh
import "golang.org/x/crypto/ssh" With unencrypted key:
signer, err := ssh.ParsePrivateKey(key) With encrypted key:
signer, err := ssh.ParsePrivateKeyWithPassphrase(key, []byte("password")) Then:
config := &ssh.ClientConfig{ User: username, Auth: []ssh.AuthMethod{ ssh.PublicKeys(signer), }, }
The text was updated successfully, but these errors were encountered:
OK,非常感谢,已支持,版本 v0.1.8
Sorry, something went wrong.
No branches or pull requests
用了私钥登陆但是设置了私钥密码会有问题:
unable to connect: parse private key failed: ssh: cannot decode encrypted private keys
可以支持下带密码的秘钥登陆:
原文 https://stackoverflow.com/questions/42105432/how-to-use-an-encrypted-private-key-with-golang-ssh
import "golang.org/x/crypto/ssh"
With unencrypted key:
signer, err := ssh.ParsePrivateKey(key)
With encrypted key:
signer, err := ssh.ParsePrivateKeyWithPassphrase(key, []byte("password"))
Then:
config := &ssh.ClientConfig{
User: username,
Auth: []ssh.AuthMethod{
ssh.PublicKeys(signer),
},
}
The text was updated successfully, but these errors were encountered: