How to grant other students SSH access to your VM
Introduction
When working on a group project, multiple students may need to access the same virtual machine (VM). One student in the group is responsible for creating the VM in XOA. This student can grant other group members SSH access by adding their SSH public keys to the VM.
Each student should use their own SSH key pair. Never share your private SSH key with other users.
This guide explains how to grant another student SSH access to your VM.
Prerequisites
Before granting access, make sure that:
- You have created your VM in XOA.
- You can connect to the VM via SSH.
- The other student has generated an SSH key pair.
- The other student has sent you their public key.
A public key typically starts with ssh-ed25519 or ssh-rsa and is a single line of text.
Obtain the other student's public key
Ask the student who needs access to send you their SSH public key.
Create the SSH configuration directory
Only run this command if the ~/.ssh directory does not already exist.
mkdir ~/.ssh
chmod 700 ~/.ssh
Add the public key
Open the authorized keys file: (instead of vi you can also use another editor such as nano)
vi ~/.ssh/authorized_keys
Set the correct permissions
chmod 600 ~/.ssh/authorized_keys
Security recommendations
- Never share your private SSH key.
- Only add public keys belonging to students who are authorized to access the VM.
- Remove public keys when access is no longer required.
- Keep your VM's operating system and software up to date.
- Remember that granting SSH access allows the other student to access the VM under their own VM account. Use separate Linux accounts for separate students where appropriate.