Create key pair
To create a key pair, please follow these steps:Navigate to Compute → SSH Key Pairs → Create a SSH Key Pair.
Enter any name under “Name.”
Finally, click OK.
Then download the .key file:
Store key in local OS
In order for an SSH key to be used for authentication, it must be stored in the local operating system and managed with the SSH agent:
Linux & macOS
Move key to the .ssh directory (if not already there):
mv /path/to/abc-23M.key ~/.ssh/
Adjust permissions:
chmod 600 ~/.ssh/abc-23M.key
Add SSH key:
ssh-add ~/.ssh/abc-23M.key
Check:
ssh-add -l
Windows (PowerShell mit OpenSSH)
Move key to the .ssh directory:
Move-Item -Path C:\path\to\abc-23M.key -Destination $env:USERPROFILE\.ssh\
Start SSH agent:
Start-Service ssh-agent
Add key to SSH agent:
ssh-add $env:USERPROFILE\.ssh\abc-23M.key
Check:
ssh-add -l
Windows (PuTTY)
The PuTTY client must be installed and started.
Enter the IP address of the VM under Session.
Navigate to Connection → SSH → Auth.
Click Browse under Authentication parameters → Private key file for authentication.
Find your private key and click Open.
Finally, click Open again to log in to the VM using key pair authentication.
Add key to VM
When creating a VM, an SSH key can be added directly.
Under point 7, previously created SSH keys can be selected:
Log in to VM
Now you can log in to the VM with the following command:
ssh root@<IP>
Alternatively, you can specify the key with:
ssh -i /path/to/abc-23M.key root@<IP>
Depending on the template, you may need a different username to log in.
This is displayed as “root” when attempting to log in:
user@hostname ~ % ssh root@<IP>
Please login as the user "ubuntu" rather than the user "root".
You can then log in again using the specified user name, in this case “ubuntu”.