Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Linux Administration Basics

The whole lesson is here to read. Create a free account to run it in a live lab.

Virtual machine lab5 min read4 commands

What you will do

A server needs somebody to look after it: to decide who may log in, what each of them may touch, and what runs by itself. That person is the administrator. You will look around a server and see what it has and what it does not have yet. You will not change anything: the four jobs are the lab's own task.

Before you start

Note

Press Start the lab on the bar at the top of this lesson. This lab is a whole Ubuntu machine of your own, so it takes a little longer to come up than a container. Each Run button below types its command into the machine's terminal, one after another. If one says the machine is still starting, wait a few seconds and press it again. To watch them, or to type your own, press Open terminal on the bar.

1. Who are you?

id says who is logged in: your user name, student, and the groups you belong to. A user is a name the machine knows, and a group is a list of users that can be given something together.

Command
id

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

2. Is there a team group yet?

getent group devs looks in the machine's list of groups for one called devs. It prints nothing at all: there is no such group. A command that finds nothing often says nothing, and that is an answer too.

Command
getent group devs

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

3. Who may use the projects folder?

ls -ld shows a folder itself and not what is inside it. The line starts with drwxr-xr-x: d is a folder, then three letters each for the owner, the group and everybody else. The owner and the group are both root, the administrator's own account, so only the owner can write here.

Command
ls -ld /srv/projects

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

4. What runs by itself?

Jobs that run on a timetable are listed in /etc/cron.d, one file for each. There is no file called backup there yet, although the lab has left a backup script in /usr/local/bin, waiting to be scheduled.

Command
ls /etc/cron.d

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Now do the lab

Tip

You have found what is missing: a group and a user, a folder for the team, a scheduled job and a service. Making them is the task of this lab: open README.md in your home folder with cat README.md in the terminal. It says what to do and gives none of the answers.

For teachers

Tip

This lesson is a small example of a lesson worked in a lab: the steps and the Run buttons are the lesson, and the lab is each student's own copy. This lesson is worked in a VM lab: each student has an Ubuntu server of their own and a Run types into its terminal and shows what it printed. The lab itself has a check that marks the four jobs from what was saved and says which one failed. Copy it into your own module and change it, or build one from scratch with the Lab menu in the lesson builder.

About this lab and its source: Linux administration lab: users, permissions, cron and systemd in your browser

Teaching a class? Set these lessons for your students with marking and a lab for every student.