~/.ssh/id_rsa.pub not found error while installing

2019-09-06 16:55发布

I try to install https://github.com/roots/bedrock-ansible to get a bedrock deployment (http://roots.io/wordpress-stack/) running.

When I run "vagrant up", after some time I get the error:

TASK: [capistrano-setup | Setup deploy group] ********************************* 
skipping: [default]

TASK: [capistrano-setup | Setup deploy user] ********************************** 
skipping: [default]

TASK: [capistrano-setup | Adding public key to server] ************************ 
fatal: [default] => could not locate file in lookup: ~/.ssh/id_rsa.pub

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/Users/johannes/site.retry

default                    : ok=46   changed=16   unreachable=1    failed=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I do not have a clou how i can fix this. Do you have an idea?

1条回答
疯言疯语
2楼-- · 2019-09-06 17:04

It seems the role is trying to find your local public key. It should be in the location in the error message '~/.ssh/id_rsa.pub', but it's not. So either you don't have one, or you keep it in another location.

If you're not familiar with generating SSH keys you probably don't have one. I personally like the GitHub help page for this: https://help.github.com/articles/generating-ssh-keys/ (you only have to perform steps 1 and 2).

If you do have SSH keys, but in a different location, the capistrano-install role in bedrock uses some variables:

deploy_user: deploy
deploy_keys:
  - "~/.ssh/id_rsa.pub"

So you can set (multiple) public key files in the deploy_keys list and they will be added to the deploy_user's authorized keys.

All this is needed because Capistrano will use the deploy user to connect to the remote server later. http://blakesmith.me/2010/02/08/understanding-public-key-private-key-concepts.html

查看更多
登录 后发表回答