Steps to set up your VM to access a GitLab repository:
- Install Git:
sudo apt install git
If prompted, enter the password for user "student" on the VM.
- Set up a key pair to access the repository
- Create a key:
ssh-keygen
- Hit return twice, once to put the code in
~/.ssh
,
the other time for no passcode. You can enter a passcode if you like
- it does increase security a bit.
- Set up to use the key:
eval `ssh-agent`
- Add the key to the current keychain:
ssh-add
- Add the key to GitLab:
- Log in to GitLab and Edit profile from the menu by your icon
in the upper right corner.
- Click on SSH Keys
- Display your public key on the console in the VM:
cat
~/.ssh/id_rsa.pub
(cat
is short for concatenate and means
"concatenate these files to output")
- Use the mouse to select/copy/paste the full output of the
previous
cat
command (from ssh-rsa to the
account name at the end of the entry) into the Key field in
GitLab.
- Enter a Title that captures where you generated the key (so
you know what to delete later), something like "CS2040 VM Spring 2023".
- Create the repository in GitLab. If this is for a class, use the MSOE
email address for your instructor and give them Maintainer access.
- Use git clone to clone the repository, using the Clone
with SSH text.