Public Key authentication is one of the safest ways to log into a server. Instead of using a plain text password, Public Key authentication uses a Public/Private key pair to identify authorized users. The target server stores the Public Key while the user holds the Private Key. Step 1: Generating Public / Private Keys with…