From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Configuring security

Configuring security

Now that we have come this far, it's time to talk about security again. So we have been using SSH keys and passwordless pseudo-privilege escalation. That's not very secure. How can we change that? Well, you need to make sure that these passwordless or passphraseless SSH keys are no longer used and become-it's-true is also kind of annoying. Why would you use become-it's-true and run every playbook with sudo privileges? Another problem is the password-less privilege escalation. Now, there are options for increased security, but they are not convenient. For instance, you can use minus B minus uppercase K to specify that you need sudo privileges and prompt for the sudo password. And you can use minus K to prompt for an SSH password instead of using SSH keys. But that's not very convenient, particularly not if you want to run Ansible in an automated environment. Now, there are other things that you can do, but above all, you should know that in production, it's probably a very bad idea to…

Contents