Skip links

Can’t find id_rsa.pub error

We recently had a report of the following error during vsd-predeploy:

TASK [vsd-predeploy : Get the public key for the current user] *************************************
fatal: [vsd1.xlelab.lab -> localhost]: FAILED! => {"changed": true, "cmd": ["cat", "~/.ssh/id_rsa.pub"], "delta": "0:00:00.022623", "end": "2018-10-09 10:57:24.514944", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-10-09 10:57:24.492321", "stderr": "cat: /root/.ssh/id_rsa.pub: No such file or directory", "stderr_lines": ["cat: /root/.ssh/id_rsa.pub: No such file or directory"], "stdout": "", "stdout_lines": []}
fatal: [vsd3.xlelab.lab -> localhost]: FAILED! => {"changed": true, "cmd": ["cat", "~/.ssh/id_rsa.pub"], "delta": "0:00:00.007484", "end": "2018-10-09 10:57:24.562216", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-10-09 10:57:24.554732", "stderr": "cat: /root/.ssh/id_rsa.pub: No such file or directory", "stderr_lines": ["cat: /root/.ssh/id_rsa.pub: No such file or directory"], "stdout": "", "stdout_lines": []}
fatal: [vsd2.xlelab.lab -> localhost]: FAILED! => {"changed": true, "cmd": ["cat", "~/.ssh/id_rsa.pub"], "delta": "0:00:00.009649", "end": "2018-10-09 10:57:24.584233", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-10-09 10:57:24.574584", "stderr": "cat: /root/.ssh/id_rsa.pub: No such file or directory", "stderr_lines": ["cat: /root/.ssh/id_rsa.pub: No such file or directory"], "stdout": "", "stdout_lines": []}

The key to diagnosing the problem is found in this text in the middle of the Ansible output:

["cat: /root/.ssh/id_rsa.pub: No such file or directory"]

MetroÆ uses Ansible’s passwordless ssh support to connect to the VSP components without prompting for password. This is done by inserting the user’s public ssh key, ~/.ssh/id_rsa.pub by default, into each VM’s /root/.ssh/authorized_keys file. In this case, the prerequisite that the user has a public key file available was not met.

Generate the key for the user using ssh-keygen and you are on your way.

Bitnami