How to install Webmin and Usermin to Manage Samba from Web

Introduction

Webmin is a web-based interface for system administration on Linux servers.
It allows administrators to manage users, services, and applications through a web browser.
Usermin is a lightweight tool for end-users to manage their email and other personal settings.
Together, these tools simplify server management, including Samba administration.

Why Use Webmin for Samba?

  • Manage Samba shares and users via GUI instead of CLI.
  • Create, modify, or delete shared directories easily.
  • Monitor Samba activity and generate reports.
  • Perform backups of Samba configuration and data.

Server Information

Operating System: Rocky 8
Server IP: 192.168.1.100
Webmin Port: 10000 (https)
Service Name: webmin
Samba Backup Directory: /srv/samba/backup

Step 1: Install Webmin on Linux


# Add Webmin repository and install dependencies
sudo dnf install wget -y
wget http://www.webmin.com/download/rpm/webmin-current.rpm

# Install Webmin
sudo dnf install perl -y
sudo dnf install webmin-current.rpm -y

# Start and enable Webmin service
sudo systemctl enable --now webmin
sudo systemctl status webmin

Step 2: Access Webmin

Open a web browser and visit:

https://192.168.1.100:10000

Login with your Linux root credentials.

Step 3: Install Usermin (Optional)


# Download and install Usermin
wget http://www.webmin.com/usermin-current.noarch.rpm
sudo dnf install usermin-current.noarch.rpm -y
sudo systemctl enable --now usermin

Step 4: Manage Samba via Webmin

  • Go to Webmin Dashboard -> Servers -> Samba Windows File Sharing
  • Add, modify, or delete shares.
  • Set access permissions and group/user restrictions.
  • Monitor active connections and Samba logs.

Step 5: Create Samba Backup

Backing up Samba ensures data safety and quick recovery in case of failure:


# Create backup directory
sudo mkdir -p /srv/samba/backup

# Backup Samba configuration
sudo cp /etc/samba/smb.conf /srv/samba/backup/smb.conf.bak

# Backup shared directories
sudo rsync -av /srv/samba/common /srv/samba/backup/
sudo rsync -av /srv/samba/user1 /srv/samba/backup/

Step 6: Restore Samba Backup


# Restore configuration
sudo cp /srv/samba/backup/smb.conf.bak /etc/samba/smb.conf

# Restore shared directories
sudo rsync -av /srv/samba/backup/common /srv/samba/
sudo rsync -av /srv/samba/backup/user1 /srv/samba/

# Restart Samba service
sudo systemctl restart smb nmb

Best Practices for Production Servers

  • Regularly backup Samba configuration and shared directories.
  • Use Webmin user permissions carefully to avoid unauthorized access.
  • Monitor logs for suspicious activity: /var/log/samba/
  • Keep Webmin and Usermin updated for security.

Conclusion

Using Webmin and Usermin simplifies Samba administration and enhances productivity.
Regular backups and proper user management ensure data safety and secure file sharing in enterprise or educational environments.

Leave a Reply

Your email address will not be published. Required fields are marked *