Generate SSH Keypair on Linux Shell/Bash
An SSH Key allows you to log into your server without needing a password. The tools to create and use SSH are standard, and should be present on most Linux distributions. With the following commands, you can generate an ssh key and transfer it to the target server.
# generate keypair ssh-keygen -t rsa -b 4096 # copy key to target server ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-system # test if key is working on target server ssh -i /root/.ssh/id_rsa root@remote-system