Ubuntu SSH Key Requirements
SSH Key Requirements for Ubuntu VMs
Ubuntu 22.04 and 24.04 VMs on Rackspace OpenStack Public Cloud require the usage of SSH Keys to log into the VMs - there is no password supplied that can be used to log in by default for VMs built using these Operating Systems. This guide will walk you through how to add SSH Keys to your Rackspace OpenStack Public Cloud account and how to use them.
Using SSH Keys with Rackspace Cloud VMs (Ubuntu 22.04–24.04)
1. Generate an SSH Key
On your local machine (Linux, macOS, or WSL):
ssh-keygen -t rsa -b 4096 -f ~/.ssh/my_rackspace_key
-
Press Enter to accept the default path (
~/.ssh/my_rackspace_key
) -
Enter a passphrase (recommended) or leave blank
-
This creates the following files:
- Public key:
~/.ssh/my_rackspace_key.pub
- Private key:
~/.ssh/my_rackspace_key
- Public key:
2. Add Your SSH Key to Rackspace Cloud
-
Log in to the Rackspace Cloud Control Panel.
-
Along the top toolbar click: Select a Product > Rackspace Cloud
-
Click Servers > SSH Keys
-
Click Add Public Key
-
Give it a Name (e.g.,
my_rackspace_key
) -
Select the Region for the key.
-
Paste the contents of your public key, which you can view with any text editor or command line call to display the file output:
cat ~/.ssh/my_rackspace_key.pub
-
Click Add Public Key
NOTE: If you want to be able to log into VMs in any region from the same device and using the same SSH Key - just create a key with the same public key data in each region so that you can build VMs in any region and still log in from the same source machine.
3. Build a VM with the SSH Key Selected
- Go to Servers > Cloud Servers
- Click Create Server
- Under Image, choose Ubuntu 22.04 or 24.04
- Complete the following selections as desired.
- Under Advanced Options in the SSH Keys section select the key you uploaded earlier
- Continue configuration and click Create Server to launch the server.
4. Save and Use Your SSH Key to Log In
- Store your private key securely, e.g. in
~/.ssh/my_rackspace_key
- To connect:
ssh -i ~/.ssh/my_rackspace_key ubuntu@<your-server-ip>
NOTE: Ubuntu servers are accessed with the 'ubuntu' user instead of root.
Additional Tips
-
Ensure private key permissions are correct:
chmod 600 ~/.ssh/my_rackspace_key
-
Optional: Use
~/.ssh/config
to simplify SSH:
Host myrackspacevm
HostName your-server-ip
User root
IdentityFile ~/.ssh/my_rackspace_key
Then connect with:
ssh myrackspacevm
Updated about 18 hours ago