July 2018
Intermediate to advanced
504 pages
11h 34m
English
Ansible connects to other systems over SSH protocol, so it requires an SSH key pair. In this section, we are going to ensure SSH access from the root account of our VM to the root account of the same VM. This can be accomplished with the following commands:
# ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'.Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.…<output omitted>…# cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
You can check whether access is indeed enabled by running the following commands:
# ssh ...