goph icon indicating copy to clipboard operation
goph copied to clipboard

how to connect with private key content, without file path

Open tareksalem opened this issue 1 year ago • 0 comments

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)

tareksalem avatar Mar 12 '23 15:03 tareksalem