For any labs requiring a Linux-based OS, you may use the university's private cloud service (OpenStack).
Using this, you may create / administer your own Virtual Machines (using a Web-based UI). Note that you require some extra permissions on your student account before-hand (all course participants should have received them).
Since the VMs have private IPs (not usable from the Internet), you will also need special care when connecting (ssh
–ing in) to them.
That is, use a special frontend machine as proxy / intermmediary: fep.grid.pub.ro
.
You can do this either by ssh
–ing into fep
and, from there, ssh
-ing to your virtual machine's private IP address (written in OpenStack's UI when creating the VM), OR (the preferred method) by using an advanced ssh
' feature: jump hosts!
Here are the rough steps:
1. First time setup (only need to to this once, unless you lose your key!):
# first, check if a keypair already exists you@yourlaptop:~# ls -l ~/.ssh/ # if the files `id_ed25519` and `id_ed25519.pub` already exist, SKIP this next step: you@yourlaptop:~# ssh-keygen -t ed25519 # use elliptic curves, better + shorter keys! # answer the defaults (aka just press enter multiple times) you@yourlaptop:~# ls -l ~/.ssh/ -rw------- 1 root root 2602 Oct 15 12:59 id_ed25519 # <-- THE PRIVATE KEY, keep secret! -rw-r--r-- 1 root root 571 Oct 15 12:59 id_ed25519.pub # <-- your PUBLIC key to give away! # print and copy the private key (including the 'ssh-ed25519' prefix!): you@yourlaptop:~# cat ~/.ssh/id_ed25519.pub ssh-ed25519 AAAAB3NzaC... # a very long line containing the public key number
# first, login into fep using your Moodle account you@yourlaptop:~# ssh moodle.username@fep.grid.pub.ro # the first time, you'll need to authenticate using a browser, READ THE INSTRUCTIONS CAREFULLY! # we want to avoid this the next times we ssh into FEP, so we will do the following: [moodle.username@fep8 ~]$ mkdir -p ~/.ssh/ [moodle.username@fep8 ~]$ nano ~/.ssh/authorized_keys # paste your public key, INCLUDING THE ssh-ed25519 prefix! # save, then exit!
fep.grid.pub.ro
. It should NOT ask for two-factor authentication anymore!login.upb.ro
, then:SSH
and paste your public key (contents of id_ed25519.pub
). Note: you only need to do this once per your device's lifetime (redo only if you lose and re-generate the key!).2. Create a new Virtual Machine on the UPB's OpenStack private cloud platform:
ISC 2023
then click the up arrow icon to select it;m1.small
(1GB RAM, 10GB disk should be enough);vlan9
(click the up arrow icon);10.9…
; be careful: only search for the VM with your given name (don't worry, you will not be able to connect to other students' VMs without their private keys :P)!# note: -J receives your FEP URL; your VM has the `student` + your pubkey as credentials! you@yourlaptop:~# ssh -J moodle.username@fep.grid.pub.ro student@10.9.X.Y # when the VM is ready, authentication should proceed withut asking for any passwords!