我正在使用这里提供的rails-server-template(https://github.com/TalkingQuickly/rails-server-template)来配置使用Chef的Rails服务器(Ubuntu 12.04)。当我建立一个新的服务器时,我复制了我的公共ssh密钥ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
,并且能够进入我的服务器。在与厨师配置后失去对服务器的访问
但我下载此模板的新副本后(更新节点/我-server.json文件,这个:)
{
"environment": "production",
"authorization": {
"sudo": {
"users": ["deploy", "vagrant"]
}
},
"run_list": [
"role[server]",
"role[postgres-server]"
],
"automatic": {
"ipaddress": "my-server.amazonaws.com"
},
"postgresql": {
"password": {
"postgres": "password"
}
}
}
而且还更新在data_bags /用户deploy.json用户:
{
"id": "deploy",
// generate this with: openssl passwd -1 "plaintextpassword"
"password": "password",
"ssh_keys": [ "ssh-rsa my-public-key from ~/.ssh/id_rsa.pub"
],
"groups": [ "sysadmin"],
"shell": "\/bin\/bash"
}
出于某种奇怪的原因,供应与束EXEC刀独奏引导[email protected]服务器后,我得到了Permission denied (publickey)
错误。当试图使用ssh登录时,我被要求输入ubuntu用户的密码,但我不知道。我甚至无法使用Amazon EC2中的密钥对.pem文件登录。
我错过了什么吗?我没有改变server.json角色,我似乎无法弄清楚发生了什么。在配置期间是否改变了我的ssh配置?