我正在使用meteor-up和Digital Ocean。如果我使用用户名和密码进行身份验证,它可以正常工作。但是,当我尝试使用我的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都在那里。
答案 0 :(得分:0)
仅为您的帐户添加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"
感谢Oliver搞清楚这一点(参见我原来问题的评论)