Accessing your instances

All instances can be accessed via the Instances tab using an IP address and your SSH key.

Step 1: Prepare Your Key

Before connecting, make sure you have the correct permissions on your private key file. You can do this with the following command:

chmod 600 /path/to/your/private/key

Replace /path/to/your/private/key with the path to your actual private key file.

Step 2: Connect to the Instance

Use the following command to connect to your instance:

ssh -i /path/to/your/private/key ubuntu@<ip>

Again, replace /path/to/your/private/key with the path to your actual private key file.

(Optional) Step 3: Add Additional Users and Keys

Once you are connected, you can add additional users and keys. Here's an example of how you can do this:

# Create a new user

sudo adduser new_user

# Switch to the new user

sudo su - new_user

# Create .ssh directory for the new user

mkdir ~/.ssh

# Change the directory permissions

chmod 700 ~/.ssh

# Create authorized_keys file

touch ~/.ssh/authorized_keys

# Add the public key to the authorized_keys file

echo "new_user_public_key" >> ~/.ssh/authorized_keys

# Change the file permissions

chmod 600 ~/.ssh/authorized_keys

Replace new_user with the username of the new user, and new_user_public_key with the new user's public SSH key.

Last updated