Getting Started with Ansible 02 - SSH overview & Setup

From Wiki
Jump to navigation Jump to search


Ansible is an incredible configuration management and provisioning utility that enables you to automate all the things. In this series, you'll learn everything you need to know in order to use Ansible for your day-to-day administration duties. In the second episode, we take a look at some foundational knowledge, specifically OpenSSH which is required for Ansible to work.

Relevant Links
Original Video

Generate an ssh key

 ssh-keygen -t ed25519 -C "jay default"

Copy the ssh key to the server(s)

 ssh-copy-id -i ~/.ssh/ <IP Adderss>

Generate an ssh key that's going to be specifically used for Ansible

 ssh-keygen -t ed25519 -C "ansible"

Copy the ssh key to the server(s)

 ssh-copy-id -i ~/.ssh/

Use an SSH key to connect to a server

 ssh -i .ssh/<key_name> <IP Address>

To cache the passphrase for our session, we can use the ssh agent

 eval $(ssh-agent)

Here's an alias you can put in your .bashrc, to simplify it

 alias ssha='eval $(ssh-agent) && ssh-add'