Managing SSH Keys
SSH keys are the way to access your compute resources. OGC offers an SSH key management service that enables your to add and reuse keys across multiple machines.
Step 1: Generating the SSH Key Pair
You will first need to generate the SSH key pair (public / private key). The private key will be stored on the customer side while the public key will be used in OGC.
- MacOS / Linux
- Windows
- Open Terminal.
- Run the command:
ssh-keygen -t rsa -b 4096
. This creates a new RSA key pair with a 4096-bit length, offering strong security. - Follow the prompts to choose where to save the key and enter a passphrase for added security.
- Download and install PuTTY, which includes PuTTYgen, from the official site.
- Open PuTTYgen.
- Click on “Generate” and follow the instructions to create a new key. Usually, this involves moving your mouse around the blank area to generate randomness.
- Once the key is generated, you will see the public key displayed in the window.
- Save the private key to your computer by clicking “Save private key”. It’s advisable to use a passphrase for added security.
Step 2: Locating Your SSH Key
After generation, your public key will be located in the specified directory (default is usually ~/.ssh/
). The public
key file is typically named id_rsa.pub
.
Step 3: Using SSH Key
With the public key contents(single line of text starting with ssh-rsa
), you are now able to provision your compute
resource.
Step 4: Connecting to the machine
- MacOS / Linux
- Windows
- Open Terminal.
- Use the command
ssh username@ip_address -i /path/to/private/key
. - If it's your first time connecting, you'll be asked to confirm the server's authenticity. Type
yes
to continue. - Enter your passphrase if you set one.
- Open PuTTY.
- Enter the Machines's IP address and specify the port (usually port 22 for SSH).
- Go to “Connection” > “SSH” > “Auth” in the PuTTY configuration and load your private key file.
- Click “Open” to initiate the connection.
- If prompted, enter the username for your machine and the passphrase for your private key.