digital-oceanmeteor-up

SSH key not working with meteor-up and Digital Ocean


I'm using meteor-up and Digital Ocean. If I use the username and password for authentication it works fine. However when I try to use my SSH keys it gives an error, mup setup returns All configured authentication methods failed

Here is my mup.js file (I've changed my IP, password and username for security):

module.exports = {
    servers: {
        one: {
            // TODO: set host address, username, and authentication method
            host: '139.49.141.100',
            username: 'root',
            pem: '/Users/MYUSERNAME/.ssh/id_rsa',
            // pem: '~/.ssh/id_rsa',
            // password: 'MY-PASSWORD',
            // or neither for authenticate from ssh-agent
        },
    },

    app: {
        // TODO: change app name and path
        name: 'nomad',
        path: '../',

        servers: {
            one: {},
        },

        buildOptions: {
            serverOnly: true,
        },

        env: {
            // TODO: Change to your app's url
            // If you are using ssl, it needs to start with https://
            ROOT_URL: 'http://139.49.141.100',
            MONGO_URL: 'mongodb://localhost/meteor',
        },

        // ssl: { // (optional)
        //   // Enables let's encrypt (optional)
        //   autogenerate: {
        //     email: 'email.address@domain.com',
        //     // comma separated list of domains
        //     domains: 'website.com,www.website.com'
        //   }
        // },

        docker: {
            // change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
            image: 'abernix/meteord:node-8.4.0-base',
        },

        // Show progress bar while uploading bundle to server
        // You might need to disable it on CI servers
        enableUploadProgressBar: true,
    },

    mongo: {
        version: '3.4.1',
        servers: {
            one: {},
        },
    },
};

I've added the public part of my SSH key at https://cloud.digitalocean.com/settings/security

I've also tried generating a new SSH key but I get the same result.

In my terminal if I go to /Users/MYUSERNAME/.ssh/ or ~/.ssh/ I can see that id_rsa, id_rsa.pub, id_rsa_2 and id_rsa_2.pub are all there.


Solution

  • Adding an SSH key to your account isn't enough, you also need to add it to the bucket.

    I followed the instructions here: https://www.digitalocean.com/community/questions/add-ssh-key-after-creating-a-droplet

    Running this command from my local machine moved over the keys:

    cat ~/.ssh/id_rsa.pub | ssh root@your.ip.address "cat >> ~/.ssh/authorized_keys"
    

    Thanks Oliver for figuring this out (see the comment under my original question)