A bash script for automated Samba server installation and configuration on AlmaLinux 9.5
This script automates the setup and configuration of a Samba file server on a Linux machine. It is designed for Almalinux 9.5, but can be adapted for other Red Hat distributions. It is suitable for various environments, such as Raspberry Pi, virtual machines, or physical servers.
-
Installs and configures Samba.
-
Creates a shared directory (/opt/share).
-
Sets up a dedicated Samba user.
-
Configures SELinux and firewall rules for Samba.
-
Provides a secure and easily customizable setup.
-
A Linux system with DNF package manager.
-
Root privileges to execute the script.
-
VM with 2core, 2gb ram, 32gb hdd/ssd.
- Update the system
sudo su dnf update -y dnf install git
- Clone the repository:
git clone https://github.com/eugeniogiusti/samba-almalinux-installer.git cd samba-almalinux-installer - Make the script executable:
chmod +x samba.sh
- Run the script as root:
sudo ./samba.sh
- Access to the share:
\\<SERVER-IP>\share # for Windows machine
smb://<SERVER-IP>/share # for Linux machine
Username: samba
Password: samba (Change it using smbpasswd samba).