You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 weeks ago | |
|---|---|---|
| .. | ||
| config | 5 months ago | |
| tmpfiles.d | 5 months ago | |
| Makefile | 5 months ago | |
| README.md | 2 weeks ago | |
| hooks.mk | 7 months ago | |
| samba-build.timer | 7 months ago | |
| samba.build | 5 months ago | |
| samba.container | 5 months ago | |
| samba.target | 7 months ago | |
README.md
Podman Quadlet: Samba
Overview
Samba is an SMB/CIFS file sharing server started as a Podman Quadlet. It allows sharing files and directories over the network with Windows, macOS, and Linux clients.
This cookbook:
- Builds a custom Samba container image locally.
- Runs Samba with configurable shares via drop-in configuration files.
- Supports user authentication with system users mapped into the container.
- Includes a timer to periodically rebuild the container image.
- Only starts if at least one share configuration file exists.
Prerequisites
- Share configuration files must exist in
/etc/quadlets/samba/smb.conf.d/with names ending inshares.conf.
Usage
In a separate terminal, follow the logs.
sudo make tail-logs
Install the Podman Quadlets and start Samba.
sudo make clean install
You should see the samba-build.service building the Samba container image. Then, the samba.service should start up.
Verify Samba is running:
sudo systemctl status samba.service
Define a password for a user to access the Samba shares:
sudo podman exec -it samba smbpasswd -a john
Get a list of currently defined users:
sudo podman exec -it samba pdbedit -L
Test connectivity from a client:
smbclient -L //localhost -N
Connect to a share:
smbclient //localhost/sharename -U john
Add a share to /etc/fstab to mount it on boot:
//localhost/sharename /mnt/sharename cifs username=john,password=yourpassword 0 0
Restart the samba.target unit.
sudo systemctl restart samba.target
Finally, remove the quadlets, their configuration and their data.
sudo make uninstall clean
Integration tests
sudo make test