Webmin has a lot off functionality and hence configuration options. Manuals etc are available via:
This article describes some basic Webmin configuration on a Raspberry Pi 4. The information in this article is based on Webmin v2.021 released on 19-Mar-2023.
Also Webmin allows you to install additional standard modules, but also 3rd party modules:
Be aware that installing Webmin Modules does not mean the functionality is available. Webmin is a management UI, not a distribution of services and management tools and hence it does not install system packages. A Webmin module manages some service or application, it is not the actual service or application; so installing the Apache module in Webmin doesn’t install Apache, it only manages the Apache provided by the OS.
On the other hand Virtualmin (if installed) does install all the service packages, sets them up, turns them on, etc. and also installs a bunch of Webmin modules and sets them up correctly to work with all the services that were installed earlier in the install script.
The following configurations are described in this article:
- Setup SMART monitoring of drives
- Sending email
- Samba Windows File Sharing
- SSH Server
The numbers above refer to the sections in the next chapter.
2. Webmin configurations
2.1 Setup SMART monitoring of drives
SMART (Self-Monitoring, Analysis and Reporting Technology) is used detect and report various indicators of drive reliability with the intent of anticipating imminent hardware failures. This monitoring system is included included in hard disk drives and solid-state drives (SSD).
When SMART data indicates a possible imminent drive failure, software running on the host system may notify the user so preventive action can be taken to prevent data loss, and the failing drive can be replaced and data integrity maintained.
Webmin has a module to show the SMART information if the smartmontools have been installed on the Raspberry Pi 4. The smartmontools package contains two utility programs, smartctl and smartd, to control and monitor drives using SMART.
Follow the steps below to get it up and running:
- Assure packages are up to date
1sudo apt-get update
- Install smartmontools
1sudo apt install smartmontools
- Start your Webmin (<ip address>:10000)
- Select Refresh Modules and wait till finished.
- Go to Hardware > SMART Drive Status and click on the configuration button:
Change the settings as shown below and click save.
- The drive SMART details will be shown.
It is possible to get email notifications automatically about the status of the drive(s). See “How to configure smartd and be notified of hard disk problems via email“.
2.2 Sending email
Webmin can send notifications via email, such as from scheduled backups or background monitoring. Configuration is simple:
- Go to Webmin Configuration > Sending Email
- Set the settings as shown below:
- Click on save. Go back to the Send mail configuration as below the settings there is an option to send a test email. Test mails are being received by you.
2.3 Samba Windows File Sharing
To access Raspberry Pi 4 files from a Windows computer you need to configure Samba access. Easiest way is via the Webmin Samba Windows File Sharing module , which allows you to specify directories and printers to be shared to Windows clients using the SMB protocol (Server Message Blocks).
Note: The Webmin Samba module will re-read the configuration files as soon as it detects that they have been changed. For the manual seeL
2.3.1 Install Samba package
Before the Samba module in Webmin can be used the required Samba packages needs to be installed:
Execute the following steps to install Samba on the Raspberry Pi 4 (all commands to be entered in the terminal application on the Raspberry Pi 4:
- Assure your Raspberry Pi is up to date:
12sudo apt updatesudo apt upgrade
- Instal; Samba on your Raspberry Pi with the required packages through the following command:
1sudo apt install samba samba-common-bin
- Webmin should now recognise that the Samba packages have been installed.
2.3.2 Add Raspberry Pi 4 and Samba users via Webmin
It is wise to use different user for accessing the Raspberry Pi 4 via Windows. Before we setup new users we first convert existing users from Unix (i.e. Raspberry Pi 4) to Samba. Then we configure the Samba module to automatically create a Samba user for each Unix user created in Webmin via the user synchronisation settings. If required a new user can be added to the Raspberry Pi 4.
- Go to Servers > Samba Windows File Sharing > Convert unix users
In our case apart from the default user and the newly added user the system users “nobody” and “systemd-coredump” appeared in the Samba user list.
- Go to “User Synchronisation” in the Samba module and change the options as indicated below. Click on Apply.
- Go to System > Users and Groups and select “Create new user” to add a new user to the Raspberry Pi 4 (if required). In our case the Windows PC username and password was added. Enter the username and password and leave the rest at default.
You can also leave the password options, group membership and upon creation settings at their defaults and click on the Create button. If you want to use user groups first read:
- Step-by-Step Guide to Manage Users on Raspberry Pi (via LinuxHint)
- Overview of user groups and their purpose (via Debian Wiki)
Accessing the defined share from Windows did not work straight away. It turned out that the Samba user password needs to be set (although user was converted/synchronised from the Unix user list).
Select Samba Users and set the password again.
In our case the share was now accessible from Windows.
- In case it still does not work it could be that thee firewall needs to be configured:
12sudo firewall-cmd --add-service=sambasudo firewall-cmd --permanent --add-service=samba
2.4. SSH Server
To have access via the command line to a Raspberry Pi 4 we use the SSH protocol. Access via a Windows PC is for example possible by making use of PuTTY software. As this gives direct access to perform maintenance on your Rapsberry Pi 4 we should prevent as much as possible others get access. The least we can do is tightening the security by only allowing specific users to connet and login.
- Go to Servers > SSH Server.
- Select Authentication and select users which are allowed to have access via SSH.