One-Command SSH Password to Key Pair Migration
Previously, when setting up a Kubernetes cluster on vSphere, all nodes were cloned from a single CentOS template. This meant every node shared the same password — which is not particularly secure. So I decided to disable password-based SSH login across all nodes.
Here is the script I wrote:
1 | !/bin/bash -e |
Before running this script, you need to install sshpass and run export SSHPASS=YOUR_PASSWAORD.