Complete steps to configure passwordless SSH login and avoid entering the passphrase every time:

Complete steps to configure password less SSH login and avoid entering the passphrase every time:




1. On your CentOS 8 master VM, generate an SSH key pair if you haven't already done so:

```

ssh-keygen

```

- Press Enter to accept the default file locations and optionally set a passphrase.


2. Start the SSH agent:

```

eval "$(ssh-agent)"

```


3. Add your private key to the SSH agent:

```

ssh-add

```

- Enter the passphrase for your private key when prompted.


4. Copy the public key from the master VM to each of the worker VMs. Replace `worker1`, `worker2`, and `worker3` with the actual IP addresses or hostnames of your worker VMs. Run the following command for each worker VM:

```

ssh-copy-id worker1

```

- Enter the password for the worker VM when prompted.


5. Test the password less SSH login to each worker VM:

```

ssh worker1

```

- If you can log in without being prompted for a password or passphrase, it means the password less SSH login has been successfully configured.


By following these steps, you should have Ansible installed on your master VM, password less SSH login set up between the master and worker VMs, and the passphrase for your SSH key stored in the SSH agent. This will allow you to connect to the worker VMs without entering the passphrase every time.

Post a Comment

0 Comments