Use it to share Linux directories with Windows clients, or when Windows cannot access a Samba share.
Samba
Samba implements SMB/CIFS file and print sharing on Linux, configured in /etc/samba/smb.conf, with users in its own database (smbpasswd) or joined to Active Directory (winbind/sssd).
1. testparm -s — config valid, share present?
2. systemctl status smb (or smbd).
3. smbclient //<server>/<share> -U <user> — connects?
4. Linux perms and SELinux label on the path.
5. Logs: /var/log/samba/.
smb.conf share → smbd listening on 445 → user authenticated → share and file permissions → access
For File Services → Samba, continue with the first unproven Topic check: Pin client, SMB identity/domain, share, backend path and exact operation. If that boundary is healthy, advance to the adjacent check: Inspect effective Samba config, listeners and active session/user mapping. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
smb.conf/includes → effective Samba config → services/listeners → SMB negotiation → authentication → identity mapping → share policy → Unix path permissions/ACL/LSM → SMB operation
Healthy evidence: effective configuration exposes intended share, listener/session negotiation succeeds, identity maps correctly and share plus filesystem policy permits required operations
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Pin client, SMB identity/domain, share, backend path and exact operation.
- Inspect effective Samba config, listeners and active session/user mapping.
- Trace authentication/authorization into Unix identity and backend permissions while correlating logs.
- Change only the confirmed Samba/identity/filesystem cause, reconnect and repeat the original operation.
Verification chain. smb.conf/includes → effective Samba config → services/listeners → SMB negotiation → authentication → identity mapping → share policy → Unix path permissions/ACL/LSM → SMB operation
Step 3 Specialized verification Verify boundary
Check config syntax and effective share definition, then confirm service/listener state and enumerate/test the share from a representative client with the intended account. On the server, resolve the resulting Unix identity and inspect path permissions/ACLs. Use a new session when testing authentication/config changes so cached credentials do not mask results. Correlate Samba logs to the client transaction and distinguish authentication failure from share authorization or backing filesystem denial.
Step 4 Commands Verify boundary
testparm -s
smbstatus
pdbedit -L
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: testparm/config is valid but wrong share/path wins, identity mapping differs from expectation, share permissions conflict with Unix ACL/SELinux, or guest/domain auth path differs from test
Step 6 Special cases and limits Narrow the fault
Successful SMB authentication does not show share authorization or filesystem access. Unix chmod can appear permissive while share ACL/policy denies access, and the reverse can occur. Existing sessions can survive a reload. DNS/Kerberos/AD problems can surface before Samba reaches file authorization. Keep protocol session, identity mapping, share policy and backing filesystem behavior separate.
Step 7 Common mistakes Narrow the fault
- Editing smb.conf without
testparm.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Check config with testparm. Samba users need a Samba password (smbpasswd -a) unless AD is used. Both share permissions and Linux file permissions apply; on RHEL SELinux needs samba_share_t labels.
showmount -e <server> / exportfs -v— NFS exportsfindmnt -t nfs,nfs4,cifs— mounted network sharessmbclient -L //<server> -U <user>— SMB sharestestparm -s— Samba configuration check
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Samba is confirmed when the intended SMB identity reaches the intended share and backend path with effective rights matching policy for the original operation.
In depth
Samba: SMB shares from Linux
Samba implements SMB file and print sharing on Linux, so Windows, macOS and Linux clients can use shares on a Linux server. It can also join an Active Directory domain, or act as a domain controller. The smb.conf(5) manual page describes the configuration:
- A
[global]section holds settings for the whole server, and defaults for the shares. - Every other section defines a share, with settings such as
path,read onlyandbrowseable(yes by default, which controls whether the share appears in browse lists). create masklimits the Unix permissions of new files: the computed mode is ANDed with the mask.- The special
[homes]section provides home directories, and%Scan build per-user paths. testparmshows the effective configuration, including defaults.
A departmental share
host$ cat /etc/samba/smb.conf
[global]
workgroup = EXAMPLE
server role = standalone server
server min protocol = SMB2_10
smb encrypt = desired
log file = /var/log/samba/log.%m
map to guest = never
[projects]
path = /srv/samba/projects
read only = no
valid users = @projects
force group = projects
create mask = 0660
directory mask = 2770
browseable = yes
host$ testparm -s 2>/dev/null | sed -n '/\[projects\]/,$p'
host$ sudo smbpasswd -a alice
host$ sudo systemctl enable --now smb nmb 2>/dev/null || sudo systemctl enable --now smbd
host$ sudo setsebool -P samba_export_all_rw on 2>/dev/null; sudo semanage fcontext -a -t samba_share_t "/srv/samba(/.*)?" && sudo restorecon -Rv /srv/samba
host$ sudo smbstatus --shares
Share settings explained
| Setting | Effect |
|---|---|
valid users = @projects | Only members of the Unix group projects |
force group = projects | Files are created with that group, so everyone in the group can edit them |
create mask / directory mask | Upper limits on new file and directory modes |
server min protocol = SMB2_10 | No SMB1 |
smb encrypt = desired | Encrypt with clients that support SMB3 |
Two layers of permission
Samba checks its share settings first. Then the Linux file system permissions (and ACLs, and SELinux labels) still apply to the underlying files. A user allowed by valid users can still get "access denied" if the Unix permissions don't allow the operation. Check both when troubleshooting.
Documented example, not captured output.
How it works at runtime
Samba is part of File Services → Samba. Samba implements SMB file services on Linux using smb.conf-derived service definitions, smbd-related runtime state, authentication/identity mapping and Unix filesystem permissions beneath share policy.
Topic-specific state model. Samba implements SMB file services on Linux using smb.conf-derived service definitions, smbd-related runtime state, authentication/identity mapping and Unix filesystem permissions beneath share policy.
Interpretation rule. - testparm success ≠ the intended share works.
- Share-level write permission ≠ backend filesystem write permission.
- Successful SMB authentication ≠ authorization to the requested path.
- A Linux username match ≠ the SMB identity maps to that Unix identity.
Specialized mechanics
Samba’s smbd service exposes SMB shares while combining SMB session authentication, share configuration, Unix identity mapping and backing filesystem permissions. Global and per-share smb.conf parameters determine protocol, security and path behavior. Client connections are stateful; an existing session can continue under old credentials or configuration assumptions while new sessions see different policy after reload. The effective access decision is the intersection of Samba policy, mapped Unix identity and backing-filesystem mode or ACL permissions.
Quick reference
Samba provides SMB file and print services and can join Active Directory.
# /etc/samba/smb.conf (AD member)
[global]
workgroup = CORP
realm = CORP.EXAMPLE.COM
security = ads
idmap config * : backend = tdb
idmap config * : range = 3000-7999
idmap config CORP : backend = rid
idmap config CORP : range = 10000-999999
server min protocol = SMB2_10
[projects]
path = /srv/projects
read only = no
valid users = @"CORP\projects-rw"
testparm
net ads join -U administrator; systemctl enable --now smb winbind
wbinfo -u; getent passwd 'CORP\alice'
smbstatus
On SELinux systems label shares samba_share_t.
Limits and how it fails
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Samba owns server implementation/configuration; SMB owns protocol/session semantics and File Share Troubleshooting owns isolation.
Specialized lifecycle
Validate smb.conf before reload and keep share paths, valid users/groups, guest policy and filesystem ownership aligned. Avoid using permissive force user/mode settings as a substitute for understanding identity mapping. Configure supported SMB dialect/security behavior intentionally; disabling signing/encryption or enabling legacy SMB versions should not be a generic compatibility fix. If AD/winbind is involved, treat directory identity resolution and Kerberos separately from local file permissions.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in File Services → Samba. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.samba.org/samba/docs/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: share/global configuration, reload semantics and active-connection boundaries. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Samba operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Samba.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Samba implements SMB file services on Linux using smb.conf-derived service definitions, smbd-related runtime state, authentication/identity mapping and Unix filesystem permissions beneath share policy. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin exact client/server + time + request/file operation → identify authoritative configuration → read back effective service/listener/session state → trace protocol selection/auth/identity → verify backend/upstream boundary → correlate logs → make smallest persistent change → repeat original workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | smb.conf/includes → effective Samba config → services/listeners → SMB negotiation → authentication → identity mapping → share policy → Unix path permissions/ACL/LSM → SMB operation | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Samba is proven when the intended SMB identity reaches the intended share and backend path with effective rights matching policy for the original operation. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux web/file-service evidence can establish this proof path: smb.conf/includes → effective Samba config → services/listeners → SMB negotiation → authentication → identity mapping → share policy → Unix path permissions/ACL/LSM → SMB operation | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Samba is proven when the intended SMB identity reaches the intended share and backend path with effective rights matching policy for the original operation. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven service boundary, capture adjacent effective state and protocol/application evidence, make only the demonstrated persistent change, then repeat the original client workload plus a regression check. | Continue to the next unresolved boundary while preserving the original test condition. |
Samba · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Samba |
|---|---|
| Topic path | File Services → Samba |
| Runtime state | Samba implements SMB file services on Linux using smb.conf-derived service definitions, smbd-related runtime state, authentication/identity mapping and Unix filesystem permissions beneath share policy. |
| Fast checks | - Pin client, SMB identity/domain, share, backend path and exact operation. - Inspect effective Samba config, listeners and active session/user mapping. - Trace authentication/authorization into Unix identity and backend permissions while correlating logs. - Change only the proven Samba/identity/filesystem cause, reconnect and repeat the original operation. |
| Verification chain | smb.conf/includes → effective Samba config → services/listeners → SMB negotiation → authentication → identity mapping → share policy → Unix path permissions/ACL/LSM → SMB operation Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Samba is proven when the intended SMB identity reaches the intended share and backend path with effective rights matching policy for the original operation. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
Samba · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Layers | SMB session → mapped identity → share policy → backing FS |
| Apply | testparm/config validation → reload → new session |
| Client proof | Authenticate and perform actual share operation |
| Boundary | Auth success ≠ share/Unix authorization |