RASPBERRY PI 4 + OPENSUSE + SAMBA

Introduction
Hello, in this article, I’ll explain how to install openSUSE Tumbleweed (however, these instructions would probably work in openSUSE Leap) in Raspberry Pi 4, plus install and configure a basic Samba server to share files from an external HDD.
The first thing to do is install the openSUSE Tumbleweed image on your Raspberry Pi 4. Go to the openSUSE Wiki page for Raspberry Pi 4 and download the image that you like to use.
There are six images available. Download the image you want (Leap is stable, and Tumbleweed is rolling) from here. Choose your desktop type:
- JeOS - Just enough Operating System - a very basic system, no graphical desktop
- E20 - Enlightenment desktop
- XFCE - XFCE desktop
- KDE - KDE desktop
- LXQT - LXQT desktop
- X11 - basic X11 system
The direct links did not work for me, so I went to the general download directory and downloaded the latest JeOS image named openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.aarch64.raw.xz
Preparing the media
As root extract the image onto your SD card or USB device(replace sdX with the device name of your SD card).
If possible, it is better to use a decent USB 3 device as the read and write speeds are greater than SD cards. I’ll use the USB device as the media used to install the image from now on.
|
|
After the image is extracted to the USB device, you can insert it into your Raspberry Pi 4 and turn it on.
You will need to discover the IP address of your Raspberry Pi 4. This can be done in a hundred different ways. For example, you can look at your router DHCP table for a MAC address that belongs to “Raspberry Pi Trading Ltd”.
Logging into the system
Wait 5 minutes before the first login as the OS will perform some tasks at the first boot, like resizing the ext4 filesystem to the entire disk.
SSH is enabled by default in openSUSE images so that you can log in as root with:
|
|
The default password is “linux”.
Configuring the system
Find your keyboard layout and load it. To search your keyboard, type:
|
|
In my case, I use a Brazilian keyboard layout called “br-abnt2”. Load your keyboard layout with:
|
|
For security reasons, change the default root password.
|
|
Type once and then confirm your new password.
Check for available system updates.
|
|
Install vim
and vim-data
to have a better editing experience. You can use the editor that you prefer.
|
|
Change the hostname as you like.
|
|
Create your user account.
|
|
Configure the sudo commands allowed for your account.
|
|
Add your_username ALL=(ALL) ALL
to the file and save it.
As the server administrator, I’ll give my user account the right to run all commands as root.
Now configure sudo to ask for your password instead of the root password.
|
|
Comment out the following lines:
|
|
Check if is everything correct with your sudo-related files.
|
|
If there is some problem, you can fix it by editing the file.
Set a password for your user account.
|
|
Reboot the system to be able to SSH with your user account instead of the root account.
|
|
Log in with your user account.
|
|
Dealing with the external HDD
Now we will mount the external HDD to /mnt/external-hdd/
.
First, we discover the UUID for the external HDD.
|
|
|
|
Create the mount point.
|
|
Edit the /etc/fstab
file and add the line for the external HDD.
Observe that in this case, the external HDD is formatted as ext4. Adjust according to your needs.
|
|
Test the mount point.
|
|
If everything worked correctly, you should see no output.
Configuring the Samba Server
Now you can install the Samba server.
|
|
Back up the original Samba configuration file.
|
|
To better understand the options, copy a fully commented example file from the Samba documentation.
|
|
In this article, other than users, I’ll use a group to control access to the shared folders.
Add a group called smbusers
or whatever you like.
|
|
Create a Samba password for the user that will have access to the shares. This password can be different from the user account password.
|
|
Edit the Samba configuration file. For simplicity, I’ll omit some comments, but I strongly recommend reading the Samba documentation to properly understand the options.
|
|
Some considerations:
- All shares will require the Samba password.
- I’ll use
your_username
to illustrate a real user; replace it with a proper user name.
|
|
Test the Samba configuration file.
|
|
Configuring the firewall
This final part enables the Firewall and allows the Samba ports through it.
|
|
In this case, we are using the “home” firewall zone and the interface “eth0”.
|
|
Allow the Samba service through the Firewall.
|
|
Reload the firewall configuration.
|
|
Enable and start the smb
and nmb
services.
|
|
Rebooting and testing
Reboot your Raspberry Pi, and you should have a working Samba server sharing your external HDD.
|
|