Using SSH-Key Authentication

AI Tools

To use key authentication, you must provide the SSH key file used in all the cluster servers to the hosts file, which is usually located from the light-app directory in this path: ansible/inventories/cluster_example/hosts.

To use SSH-key authentication instead of a plain text password, see the article on How To Configure SSH Key-Based Authentication on a Linux Server.

After you have configured the SSH key for authentication, you can connect from the installation server to the target with the ansible_ssh_private_key_file instead ofansible_ssh_pass, in the following format:

Bash
Copy

With the default configuration, the top section of the hosts file lines are configured as below:

Bash
Copy

As an example, assume that the SSH key for the servers is located at /root/mykey.txt. If so, change the configuration line to this:

Bash
Copy
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches