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
+89
View File
@@ -0,0 +1,89 @@
# Configure Samba Share
This recipe configures a basic Samba file share.
## Backup Existing Configuration
```bash
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
```
## Create Configuration
Replace the existing configuration.
```bash
sudo tee /etc/samba/smb.conf >/dev/null <<'EOF'
[global]
workgroup = WORKGROUP
server string = Samba Server
security = user
map to guest = Bad User
[Share]
path = /srv/samba
browseable = yes
writable = yes
guest ok = no
read only = no
create mask = 0664
directory mask = 0775
EOF
```
## Create Share Directory
```bash
sudo mkdir -p /srv/samba
```
## Configure Permissions
Replace `<username>` with your Linux username.
```bash
sudo chown -R <username>:<username> /srv/samba
sudo chmod -R 775 /srv/samba
```
## Create Samba User
If the user does not already exist on Linux, create it first.
```bash
sudo smbpasswd -a <username>
sudo smbpasswd -e <username>
```
## Validate Configuration
```bash
testparm
```
Expected output:
```text
Loaded services file OK.
```
## Restart Samba
```bash
sudo systemctl restart smbd
sudo systemctl restart nmbd
```
## Verify Share
```bash
smbclient -L localhost -U <username>
```
Expected output should include:
```text
Sharename Type
--------- ----
Share Disk
```