Samba shares, users, and client access
Objective 209 names Samba alongside NFS, and Samba is the half with a separate password database. This guide installs it, defines a share, creates an account that exists in both the unix and the Samba databases, and proves the whole thing from a second machine - including a write that succeeds, a credential that is refused, and a write refused by Samba while the filesystem still permits it.
202: File Sharing Guide 23 of 29 Intermediate
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- Block devicesone 50 GB disk
- TimeAbout 26 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC2-A01 | 192.168.0.78 | Ubuntu 26.04 LTS | Primary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk | 2 Core | 4 GB | 50 GB |
| LPIC2-C01 | 192.168.0.80 | Ubuntu 26.04 LTS | Client - resolves, mounts and connects, so every service is proven from a machine that is not running it | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a Windows client, a scanner or a colleague needs a directory from a Linux server. This matters because Samba keeps its own user database and its own per-share policy, so an account that logs in perfectly over SSH can be refused a share, and a share can refuse a write the unix permissions allow.
- installing Samba and confirming what it listens on
- defining a share, and validating the file with
testparmbefore any restart - creating an account in both the unix and the Samba databases
- listing, reading and writing the share from a second machine
- watching a wrong credential and a read-only share produce two different refusals
Before you start
- an-nfs-export-proved-from-two-clients
-
A server with no file sharing on it
-
A share, and the account that may reach it
-
The share definition, checked before any restart
-
The share, from a machine that is not the server
-
Writing back, and the two permission layers
-
Putting both machines back