1AKIFT CABS Test (Group A)

2025-11-17

Max. 100 points

Name:

Task Max. Achieved
1 40
2 15
3 20
4 25
Sum 100
Grading: >= 88: 1, >=76: 2, >=64 : 3, >50: 4, <=50: 5

user:
password:

  1. Linux command-line basics
    1. (5 points)
      To complete the remainder of the test, first log in to ls515-00.local via ssh with the user individually provided for the test.
      ssh ${provided_user}@ls515-00.local
    2. (5 points)
      In your test user's home directory is a directory old_data containing old files. Delete the directory including all files and subdirectories.
      rm -r ~/old_data
    3. (5 points)
      In the home directory is a directory repositories. Rename it to repos.
      mv ~/repositories ~/repos
    4. (5 points)
      Create the following directory tree. Note that you have to create four directories.
      └── school
          ├── dbi
          ├── pos
          └── syp
      
      mkdir -p ~/school/dbi ~/school/pos ~/school/syp
    5. (5 points)
      Create a new directory for a personal website. The directory must be given the appropriate name so that its contents could be accessed via ls515-00.local/~username/ (if there was a properly configured web server installed on ls515-00.local).
      mkdir ~/public_html
    6. (5 points)
      If neccesary, adjust the permissions of this folder in a way that any webserver could access (read-only) this directory and its contents. Note: do not adjust your user's home directory permissions.
      chmod o+rx ~/public_html
    7. (5 points)
      Create an empty index.html file inside this directory.
      touch ~/public_html/index.html
    8. (5 points)
      Create a new file ~/shortcuts. On the first line of that file write the keys a user has to press to clear the terminal.
      echo "Ctrl+l" > ~/shortcuts
  2. Linux administration
    1. (5 points)
      In your home directory, create a file administration. On the first line of that file, enter the command that allows you to execute a command with elevated priveleges ("run the rest of this line as administrator").
      echo sudo >> ~/administration
    2. (5 points)
      On the second line of the file write the command to download the current list of available packages. Finally, on the third line write the command for installing all available updates.
      echo "sudo apt update" >> ~/administration
      echo "sudo apt upgrade" >> ~/administration
    3. (5 points)
      On the fourth line of that file write the command to install the wget package.
      echo "sudo apt install wget" >> ~/administration
  3. Creating programs
    1. (5 points)
      Create the folder `~/bin` if it does not already exist.
      mkdir -p ~/bin
    2. (5 points)
      Your home directory contains a backup file (assignment.py~). Delete that file.
      rm ~/assignment.py~
    3. (5 points)
      Create a new empty Python program called `test.py` in your `~/bin` folder.
      touch ~/bin/test.py
    4. (5 points)
      Make the program `~/bin/test.py` executable for the current user. No one else should be able to execute the program.
      chmod u+x ~/bin/test.py
  4. Configuration
    1. (5 points)
      You intend to use ipython regularly. Create a persistant shortcut that allows you to type i to launch ipython.
      echo "alias i=ipython3" >> ~/.profile
    2. (5 points)
      Create a new SSH public-private key pair in the default location.
      ssh-keygen
    3. (5 points)
      Allow my user to log in to the current user by adding my public SSH key to the appropriate location. For the sake of this test, it is enough to abbreviate my key to
      ssh-ed25519 AAAA...jxT6 gerald@pc
      (note that using the abbreviation won't actually work).
      echo "ssh-ed25519 AAAA...jxT6 gerald@pc" > .ssh/authorized_keys
    4. (5 points)
      For security reasons, the file permissions of the file containing the allowed users should be very limited. Please take care of that.
      chmod 600 .ssh/authorized_keys
    5. (5 points)
      Create an ssh client configuration file that allows your user to log in as testuser to sandbox.bulme.at by simply typing ssh sandbox.
      Edit .ssh/config to contain
      Host sandbox
          User testuser
          Hostname sandbox.bulme.at