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

Using privateKey access AWS #366

Closed
toby1kenobi opened this issue Dec 4, 2015 · 2 comments
Closed

Using privateKey access AWS #366

toby1kenobi opened this issue Dec 4, 2015 · 2 comments

Comments

@toby1kenobi
Copy link

I'm using this module via grunt-scp, to try to transfer files to an AWS Ubuntu server. I have a *.pem file containing my private key (downloaded from AWS), should I be able to use this to connect? In my gruntfile I have something like this:

        scp: {
            options: {
                host: 'myhost.com',
                username: 'ubuntu',
                privateKey: require('fs').readFileSync('c:/Users/Toby/Documents/toby.pem')
            },
            default: {
                files: [{
                    cwd: '.',
                    src: ['admin/**'],
                    dest: '/home/ubuntu/'
                }]
            }
        }

When I try to execute my task it prompts me for a password, I just hit enter at this point, and then it tells me, "error Authentication failure. Available authentication methods: publickey". Am I doing something wrong here, or misunderstanding?

@mscdex
Copy link
Owner

mscdex commented Dec 4, 2015

It's certainly possible as long as grunt-scp supports that setting or it passes those options on directly to ssh2.

@mscdex
Copy link
Owner

mscdex commented Mar 5, 2016

Closing this for now. If you find that grunt-scp isn't passing on the required options supported by this module, you may want to file an issue at their repo. This module does support private keys of various types as well as encrypted keys (provided you also set the passphrase option as well). However, you may want to use an ssh agent to make things easier, especially if you have encrypted keys.

@mscdex mscdex closed this as completed Mar 5, 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

2 participants