How do I SSH into my virtual machine after I have created an SSH key pair?
To gain access to your virtual machine via secure shell (SSH) execute the following command:
ssh os-username@<vm's_public_ip> -i <path-to-your-SSH-private-key>
- "os-username" is replaced with the name of the operating system (OS) running on your virtual machine.
- For Ubuntu OS the username is ubuntu
- For Centos OS the username is centos
- For Debian OS the username is debian
- "<vm's_public_ip>" is replaced with the IP address of your virtual machine.
- "<path-to-your-SSH-private-key>" is replaced with the path to the private key associated with your SSH key pair.
References: