Generate and log in SSH with an RSA public key

1. Generate the key. ssh-keygen -t rsa -P 123456 -f host -C ‘key’ -t: key Type {dsa | ecdsa | ed25519 | rsa | rsa1}-P: Passpharse (empty for no passpharse)-f: key Filename/hostname-C: Comment 2. Add it to your server. scp host.pub root@your_server_ip:/root/cat /root/host.pub >> ~/.ssh/authorized_keyschmod 600 ~/.ssh/authorized_keys 3. Edit sshd_config.vim /etc/ssh/sshd_config Edit these configs. RSAAuthentication …