docs(samba): add install, configure, and uninstall recipes

This commit is contained in:
2026-07-04 15:33:16 -03:00
parent 229e183ec3
commit 988715b433
3 changed files with 268 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
# Install Samba
This recipe installs Samba on Ubuntu, enables the required services, and configures a basic file share.
## Install Packages
```bash
sudo apt update
sudo apt install -y samba
```
## Verify Installation
```bash
smbd --version
```
Expected output:
```text
Version 4.x.x
```
## Enable Services
```bash
sudo systemctl enable smbd
sudo systemctl enable nmbd
sudo systemctl start smbd
sudo systemctl start nmbd
```
## Verify Services
```bash
systemctl status smbd --no-pager
systemctl status nmbd --no-pager
```
Both services should be reported as **active (running)**.
## Configure Samba
Replace the default configuration.
```bash
sudo cp smb.conf /etc/samba/smb.conf
```
Validate the configuration.
```bash
testparm
```
Expected output:
```text
Loaded services file OK.
```
## Restart Samba
```bash
sudo systemctl restart smbd
sudo systemctl restart nmbd
```
## Configure Firewall (Optional)
If UFW is enabled:
```bash
sudo ufw allow samba
```
## Verify Listening Ports
```bash
sudo ss -tulpn | grep smb
```
Expected output should include ports **139** and **445**.
## Create Samba User (Optional)
```bash
sudo smbpasswd -a <username>
sudo smbpasswd -e <username>
```
List configured Samba users.
```bash
sudo pdbedit -L
```