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

Read private key #12

Closed
jrootham opened this issue Jul 22, 2014 · 9 comments
Closed

Read private key #12

jrootham opened this issue Jul 22, 2014 · 9 comments

Comments

@jrootham
Copy link

Having a private key hardwired into a gruntfile seems to me to be a really bad idea. I think you need an option that specifies a key file to read.

@lepture
Copy link
Contributor

lepture commented Jul 22, 2014

It does support private key file: https://github.com/spmjs/grunt-scp#more-options

@jrootham
Copy link
Author

That would be the agent option? The documentation is not obvious.

@morrissinger
Copy link
Contributor

It does support private key, which by no means has to be hard-coded into the Gruntfile. For example, I use fs.readfilesync() to load my key from a file, and then pass the contents of the file as a buffer or string to options.privateKey in the Grunt task configuration.

The issue I see here is that if you do not provide a password in options.password, the Grunt task will automatically prompt you for one, even if you want to use privateKey authentication instead of password authentication. Seems like the Grunt task should be smart enough to figure out not only whether there is a password on the options object, but also whether it needs one in the first instance.

I've made the appropriate modification to the task, which is available in this pull request: #19

@johnkawakami
Copy link

npmjs.org still has 0.1.8 up there, and the bug that morrissinger fixed is still present. (How does this get updated?)

I used grunt.file.read() to read in the file.

options: {
    privateKey: grunt.file.read('/home/johnk/.ssh/thekeyfilenere'), ...
}

@morrissinger
Copy link
Contributor

@spmjs has to bump the version in package.json and npm publish the change.

@wfairclough
Copy link

@spmjs this still shows version 0.1.8 on npmjs looks like it has not been published yet even though the version has been bumped to 0.1.9

@dkurucz
Copy link
Collaborator

dkurucz commented Feb 29, 2016

Sorry for the delay, waiting on permissions to publish to npm.

@dkurucz
Copy link
Collaborator

dkurucz commented May 1, 2016

I'm not sure your if issue is fixed with 0.1.9 nor 0.1.10, but can you please verify? Current is at 0.1.10

@wfairclough
Copy link

@dkurucz v0.1.10 is working for me. Thanks!

@lepture lepture closed this as completed May 10, 2016
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

No branches or pull requests

6 participants