goph
goph copied to clipboard
how to connect with private key content, without file path
Thanks for this awesome library, I have a problem currently with the connection with private key,
I have a private key with an actual content exist int the memory "the private key is not stored on the file system" as the following:
-----BEGIN RSA PRIVATE KEY-----
key content
-----END RSA PRIVATE KEY-----
how can I use that private key to connect to the server, because it doesn't work with the following:
authKey, _ := goph.Key(serverData.SshPrivateKey, "")
fmt.Sprintf("------------- my dd %", authKey)
goph.Key()
client, err := goph.New(serverData.SshRootUsername, DEFAULT_SERVER_IP, authKey)