Hey @Shakira, follow these steps:
- Execute the following command to get the ssh key of ansible non root user
cat ~/.ssh/id_rsa.pub
- Copy the output onto your clipboard, open a new terminal and connect to your ansible host
ssh sam@ansible_host_ip
- switch to the client machine's root user
su
- open the authorized_keys within the ~/.ssh directory:
nano ~/.ssh/authorized_keys
exit
And you're done, Hope this helped :)