From the course: Learning Ansible

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Key versus password authentication

Key versus password authentication - Ansible Tutorial

From the course: Learning Ansible

Key versus password authentication

At this point, I've created my playbook, and I've created my inventory. But the next important key is to decide how to authenticate to the remote host. There are multiple options, but the two I'll be focusing on, as they are the most prevalent, is either password authentication or via SSH key. What makes sense for you depends on what you are automating against, your environment, or maybe even your corporate policies. Password-based authentication can be simpler to use, as most folks are familiar with it. It can, however, be less secure, as generally passwords are shorter and easier to guess over brute force. SSH key authentication is often more secure and less vulnerable to brute force. Once it's all set up, it can also be simpler and faster to connect to hosts. It is often slightly more cumbersome on an initial configuration, as an SSH public key has to be added to every host that needs to be connected to. For a simple lab environment for quick testing, password auth should work just…

Contents