I've been trying to set my vps to use SSH keys for login instead of password. I've been reading tutorial after tutorial on how to set this up but I just can't set it up right.
So what I have done so far is the following
ssh-keygen -t rsa -b 4096
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
af:3a:f2:75:5f:c2:67:c8:ad:1d:0a:ab root@localhost
Copied Public Key into authorized_keys
cp root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
The issue is, how do I login via this key? Do I save the private key on notepad? Because if SSH key logs me in via ip, I don't think I can login because my ip is dynamic . Can someone help me?