SSH is widely used with automation scripting, as it makes it possible to remotely execute commands at remote hosts and read their outputs. Usually, SSH is authenticated with username and password, which are prompted during the execution of SSH commands. Providing passwords in automated scripts is impractical, so we need to automate logins. SSH has a feature which SSH allows a session to auto-login. This recipe describes how to create SSH keys for auto-login.
Password-less auto-login with SSH
Getting ready
SSH uses an encryption technique called asymmetric keys consisting of two keys–a public key and a private key for automatic authentication. The ssh-keygen application creates an authentication key pair. To automate the authentication, the public key must...