Skip to content
New issue

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

enable connection using raw private key without file path #49

Merged

Conversation

tareksalem
Copy link

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)

auth.go Outdated
signer ssh.Signer
)

if err != nil {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the err is always nil

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback, changed it

@melbahja melbahja merged commit d955155 into melbahja:master Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants