Uploading a Public Key to a VM

This will allow for This guide assumes you are trying to access a VM with a different machine than the one used to originally create the VM. Obtaining Public Key First, check to see if you already have a public key for your machine: ls ~/.ssh If you don’t see an id_rsa.pub file, create a public/private key pair on the machine that will access the VM: ssh-keygen Uploading For the next step, you’ll need to use a machine that can access the VM – using the public key generated in the step above, SSH into the VM and run the following: scp /path/to/public_key username@server:~ mv id_rsa.pub ~/.ssh/authorized_keys Verification Finally, going back to the machine you want to SSH with, SSH into the VM to make sure access is working: ssh username@hostname You should be able to log into without a password.