SSH 密钥不适用于流星和数字海洋



我正在使用流星和数字海洋。如果我使用用户名和密码进行身份验证,它可以正常工作。但是,当我尝试使用SSH密钥时,它给出了一个错误,mup setup返回All configured authentication methods failed

这是我的mup.js文件(为了安全起见,我已经更改了IP,密码和用户名(:

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: {},
        },
    },
};

我已经在 https://cloud.digitalocean.com/settings/security 添加了 SSH 密钥的公共部分

我也尝试生成一个新的SSH密钥,但得到相同的结果。

在我的终端中,如果我去/Users/MYUSERNAME/.ssh/~/.ssh/我可以看到id_rsa,id_rsa.pub,id_rsa_2和id_rsa_2.pub都在那里。

向您的账户添加 SSH 密钥是不够的,您还需要将其添加到存储桶中。

我按照这里的说明进行操作:https://www.digitalocean.com/community/questions/add-ssh-key-after-creating-a-droplet

从我的本地计算机运行此命令会移动键:

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

感谢奥利弗弄清楚这一点(请参阅我原始问题下的评论(

最新更新