Linux 1 – Linux operating system
Hardware 1
Course introduction
Course content
• On this part of the Hardware 1 course you will learn how to use
the Linux operating system. The main focus is in learning how
to use Linux on the command line.
• In groups, you will set up a Raspberry Pi computer with
Raspberry Pi OS.
• The system will be used as a part of the network for the
Hardware 2 project.
Hardware 2 project
Evaluation
• Group exercises:
• Graded on a scale of 0-2.
• 5 sets of weekly exercises.
• Each set has 3 tasks.
Exercise grade = (exercise points-6)/12
• Each task is 2 points.
• 18 points -> grade 1
Final grade = Exercise grade + Exam grade
• Grade < 1 = 0
• Final exam:
• Graded on a scale of 0-4.
• Only the final result will be rounded, all
exercise and exam points count.
• Attendance requirement 80%
• < 80% -> Minus 1 to the final grade.
• < 45 % -> Course is failed.
Linux operating system
What is Linux
• Linux is an open-source operating Applications
system (OS).
• Linux started as a hobby project by Shell
Linus Torvalds while he was studying
Kernel
Computer Science at the University of
Helsinki in 1991. Hardware
• Due to its flexibility, Linux is used in a CPU RAM I/O
variety of devices such as desktop
computers, servers, embedded
devices, smart phones and super
computers.
Linux distributions
• Linux distributions are ”versions” of the Linux operating system
targetting specific systems, users or use cases.
• The distributions consist of software packages that are installed
on top of the Linux kernel and include different tools, features
and applications for the operating system.
• Many Linux distributions are freely available online.
• Some well-known Linux distributions:
• RedHat, Fedora
• Ubuntu
• Debian, Kali Linux, Raspberry Pi OS
Raspberry Pi
• Raspberry Pi is a series of small single-
board computers (and microcontrollers)
• They are often used in teaching and
home or hobby projects.
• Raspberry Pi is similar to your own
computer in many ways:
• It runs a (Linux) operating system.
• You can connect peripherals such as a
mouse, keyboard or display.
• It connects to the Internet.
• However, in comparison to traditional
computers, Raspberry Pi are smaller, cheaper
and less powerful.
Raspberry Pi OS
• On this course you will set up a
Raspberry Pi computer running
the Raspberry Pi OS.
• Raspberry Pi OS is based on the
Debian Linux distribution and
intended to be used specifically on
Raspberry Pi computers.
Shell
• You can complete most tasks in a Linux system from the
command line:
• System and user management
• Adjusting settings
• Searching for files, tools and applications
• Running scripts and programs
• Accessing help for using commands
• Shell programs interpret commands and execute tasks for the
user.
• Raspberry Pi OS uses the Bash shell by default. Some other
common shell programs include ksh and zsh (macOS).
Shell commands
command option(s) argument(s)
prompt
output
Helpful features
• Most command line tools come with instructions on how to use
them.
• Man pages: Some tools and features have manual pages that
can be accessed by using the man command, such as man ls.
• Help: Most tools have instructions that can be viewed using the
help option, such as systemctl –h or systemctl --help.
The help pages are often shown also if you try to use a
command incorrectly.
Helpful features
• Bash also provides autocompletion that
can be used to complete commands,
names or paths by using the TAB key.
• Using your arrow keys you can browse
through old commands.
• You can clear the terminal by using the
clear command or the shortcut Ctrl + L.
• If you get stuck, or accidentally run a
command that takes a long time to finish,
you can escape with Ctrl + C.
Raspberry Pi OS installation
Raspberry Pi OS installation
• Get a Raspberry Pi device package from the library:
• Raspberry Pi 4 model B <- preferred
• (Raspberry Pi 3 model B)
• Download the Raspberry Pi Imager from:
• https://www.raspberrypi.com/software/
• Equipment needed:
• Raspberry Pi computer
• SD card
• SD card reader
• Power cable
• Network cable
Raspberry Pi OS installation
1. Insert the SD card to an SD card reader.
2. Open the Raspberry Pi Imager
3. For the device, choose Raspberry Pi 4 or 3 depending on the device you have.
4. For the operating system, choose the default 64-bit Raspberry Pi OS.
5. For storage, choose the SD card.
6. Click ”Next” and then ”Edit settings”.
Edit initial settings
1. Create a username and password for
one group member. The other users will
be created later.
2. Set the keyboard layout to fi (Finnish).
3. Do not set the wireless LAN settings.
Your Raspberry Pi will de connected to
the router with an Ethernet cable.
4. Do not save the settings yet.
Edit initial settings
1. Enter the ”Services” tab
2. Enable SSH with password authentication.
3. Save the settings and write the OS image to
the SD card. This will take a while.
4. When the write is done, make sure the
Raspberry Pi is disconnected from power
and insert the SD card to the slot in the
back.
5. Connect an Ethernet cable from the
Raspberry Pi to one of the yellow LAN ports
of your router.
6. Attach the power cable and wait for the
system to boot.
Remote connection over SSH
You can access the command line of the
Raspberry Pi from your computer using SSH.
To establish the connection:
1. Connect your computer to the group Wi-Fi.
2. Connect the Raspberry Pi to one of the
yellow LAN ports on the router.
3. Open the web management interface of the
router in http://www.asusrouter.com.
4. View the list of connected clients. Once the
Raspberry Pi has booted up, you should
see it on the list. Copy the IP address of
the Raspberry Pi.
Remote connection over SSH
To connect over SSH:
1. Open a terminal window on your computer. ssh username@192.168.1.1
2. Run the ssh command with your username
and the IP address of the Raspberry Pi.
3. The first time you connect over SSH, you Your username Raspberry Pi IP address
will be asked to accept the encryption key.
Type ’yes’ and press Enter.
4. You will be asked to enter your password.
Note that when you type the password in
Linux, you will not see the * symbols. This
does not mean that something is wrong.
5. The next slide shows a successful first-time
connection to Raspberry Pi over SSH.
Successful SSH connection