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

Feature: feed private key from memory #8

Closed
dpogorzelski opened this issue Jul 24, 2020 · 2 comments
Closed

Feature: feed private key from memory #8

dpogorzelski opened this issue Jul 24, 2020 · 2 comments
Labels
question Further information is requested

Comments

@dpogorzelski
Copy link

Currently vssh.GetConfigPEM() function expects to read the key from a file on disk via:
key, err := ioutil.ReadFile(keyFile)
but when using vssh as a library it can be not very convenient to generate a new key, write it to disk and then read it from disk again in GetConfigPEM(). Instead it would be great to have the option to generate a private key and feed it directly from memory to either GetConfigPEM() or a similar function like GetConfigFoo(user string, block *pem.Block) or GetConfigFoo(user string, block []byte).
Let me know what are your thoughts :)

@mehrdadrad
Copy link
Contributor

vSSH uses standard ssh client config from Go ssh library (*ssh.ClientConfig) so developer can create their own function to generate it. as you said you can create GetConfigFoo(.....) *ssh.ClientConfig

vs := vssh.New().Start()
config := GetConfigFoo(........)
vs.AddClient("54.241.122.224:22", config, vssh.SetMaxSessions(4))
.
.
.
func GetConfigFoo(.....) *ssh.ClientConfig {

}

In fact I added the GetConfigPEM as sample at helper Go file but what I like in this case is remote secret managements like Vault Hashicorp. I think getting the pem block from them is a great solution!

@dpogorzelski
Copy link
Author

This is a good point thanks :)

@mehrdadrad mehrdadrad added the question Further information is requested label Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants