我用的是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都在那里。
发布于 2018-01-12 23:31:11
向您的帐户添加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解决了这个问题(参见我的原始问题下面的评论)
https://stackoverflow.com/questions/48227114
复制相似问题