Use it to mount Windows/Samba shares on Linux, or when the mount fails.
SMB
SMB (Server Message Block) is the file-sharing protocol used by Windows and served by Samba on Linux; Linux clients mount SMB shares with mount.cifs (mount -t cifs).
1. smbclient -L //<server> -U <user> — share list visible?
2. Mount: mount -t cifs //<server>/<share> /mnt -o credentials=/root/.smbcred,vers=3.0.
3. Error in dmesg (CIFS: VFS: …).
4. Permission denied → credentials or share ACL.
5. fstab with _netdev.
client → TCP 445 → SMB negotiation (version, signing) → authentication → share mounted
For File Services → SMB, continue with the first unproven Topic check: Pin client, server/share, SMB dialect/security expectations, credentials and exact file operation. If that boundary is healthy, advance to the adjacent check: Verify negotiation/session/tree-connect evidence before blaming backend storage. 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
client → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → response
Healthy evidence: expected dialect and security mode negotiate, session authenticates, tree connect selects intended share and file operations complete with expected locking/access semantics
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Pin client, server/share, SMB dialect/security expectations, credentials and exact file operation.
- Verify negotiation/session/tree-connect evidence before blaming backend storage.
- Correlate client and server logs with one fresh operation including mapped server identity.
- Correct the first failed protocol/auth/share/filesystem boundary, reconnect and repeat the original workload.
Verification chain. client → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → response
Step 3 Commands Verify boundary
smbclient //fs01/share -U alice
mount -t cifs //fs01/share /mnt/share -o credentials=/root/.smbcred,vers=3.1.1
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: TCP works but negotiation/auth fails, credentials authenticate but share authorization fails, dialect/signing requirements mismatch, stale sessions hide changes, or backend permissions break file operations
Step 5 Common mistakes Narrow the fault
- Credentials in fstab instead of a protected credentials file.
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.
Specify the version (vers=3.0) — SMB1 is disabled almost everywhere. Store credentials in a root-only file (credentials=). Set uid/gid/file_mode for local ownership.
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 & boundaries5 sections · depth on demand
What this shows and what it does not
SMB health is confirmed only when the intended dialect/session identity completes the exact share and file operation; network connection or authentication alone is insufficient.
In depth
Mounting SMB shares on Linux clients
Linux mounts SMB shares with the kernel's cifs client, through mount -t cifs or fstab. The mount.cifs(8) manual page documents the important options:
username=andpassword=, or better,credentials=pointing to a file withusername,passwordanddomainlines, so passwords aren't in fstab.vers=selects the protocol. By default, the client negotiates the highest SMB2+ version both sides support, at least 2.1 in current versions. SMB1 isn't recommended.uid=,gid=,file_mode=anddir_mode=set ownership and modes when the server sends no Unix information.sec=chooses the authentication (ntlmssp is the default; krb5 for Kerberos).sealrequests SMB3 encryption.multiusergives each local user their own session.cache=strictis the current default. The manual warns thatloosecan corrupt data when several clients share files.
A persistent mount
| File | Content |
|---|---|
/etc/samba/creds-nas1 (mode 600, root) | username=svc-backup, password=<password>, domain=EXAMPLE |
/etc/fstab | //nas1.example.net/projects /srv/projects cifs credentials=/etc/samba/creds-nas1,vers=3.1.1,seal,uid=1003,gid=1020,file_mode=0660,dir_mode=0770,_netdev,nofail 0 0 |
Choosing ownership options
| Situation | Options |
|---|---|
| One local user or service uses the share | uid=, gid=, file_mode=, dir_mode= |
| Many local users, each with their own AD account | multiuser,sec=krb5 + cifscreds or Kerberos tickets |
| Samba server with Unix extensions (SMB1) | Server ownership is used; rarely relevant with SMB3 |
Troubleshooting
| Error | Typical cause |
|---|---|
mount error(13): Permission denied | Wrong credentials, domain or sec= |
mount error(95): Operation not supported | Protocol mismatch, e.g. the server allows only SMB1 |
Host is down | Port 445 blocked, or the name doesn't resolve |
| Files owned by root, read-only | Missing uid/gid/file_mode options |
host$ sudo install -m 600 /dev/null /etc/samba/creds-nas1
host$ printf 'username=svc-backup\npassword=<password>\ndomain=EXAMPLE\n' | sudo tee /etc/samba/creds-nas1 >/dev/null
host$ sudo mount -t cifs //nas1.example.net/projects /srv/projects -o credentials=/etc/samba/creds-nas1,vers=3.1.1,seal,uid=1003,gid=1020
host$ findmnt /srv/projects -o OPTIONS | tr ',' '\n' | grep -E "vers|seal|cache|uid|sec"
vers=3.1.1
seal
cache=strict
uid=1003
sec=ntlmssp
host$ dmesg | grep -i cifs | tail -2
Reading the mount options
The mount negotiated SMB 3.1.1 with encryption (seal) and strict caching, the safe default. The credentials file is root-only (mode 600), so the password isn't visible to other users, or in findmnt output.
Documented example, not captured output.
How it works at runtime
SMB is part of File Services → SMB. SMB is the network file-sharing protocol boundary covering dialect negotiation, session setup, authentication, tree connect/share authorization, file handles, locking and client-visible operations.
Runtime state ownership and mechanics. NFS and SMB expose remote filesystems through distinct protocol, authentication, caching and locking semantics. NFS depends on export policy, client identity and RPC/NFS version behavior; SMB adds session authentication, share policy and dialect/security negotiation.
Topic-specific state model. SMB is the network file-sharing protocol boundary covering dialect negotiation, session setup, authentication, tree connect/share authorization, file handles, locking and client-visible operations.
Technical metadata. Linux distribution + service/version + client/server/time + DNS/route/firewall + listener/socket + HTTP/TLS/vhost/proxy or NFS/SMB session + identity mapping + backend path/upstream + original workload result.
Interpretation rule. - TCP 445 reachable ≠ SMB negotiation succeeds.
- SMB authentication success ≠ tree-connect or file authorization.
- Share listing ≠ read/write/locking operations work.
- One client success ≠ other dialect, credential or cache contexts behave identically.
Quick reference
SMB client usage on Linux:
smbclient -L //fs01 -U 'CORP\alice'
smbclient //fs01/projects -U 'CORP\alice' -c 'ls'
mount -t cifs //fs01/projects /mnt/projects -o credentials=/root/.smbcred,vers=3.1.1,uid=1000,gid=1000,file_mode=0660,dir_mode=0770,seal
# Kerberos instead of password file
mount -t cifs //fs01.corp.example.com/projects /mnt/p -o sec=krb5,cruid=alice,multiuser
Credentials file: username=, password=, domain= with mode 600. seal requests SMB3 encryption.
Limits and how it fails
Primary failure point. SMB health is confirmed only when the intended dialect/session identity completes the exact share and file operation; network connection or authentication alone is insufficient.
NFS root squashing/UID mapping and SMB account/share ACLs can deny access even when Unix mode bits appear permissive. DNS success does not show protocol reachability.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. SMB owns protocol/session behavior; Samba owns common Linux server implementation and backend permissions remain separate.
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 → SMB. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.samba.org/samba/docs/ · confidence 94%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
SMB operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for SMB.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | SMB is the network file-sharing protocol boundary covering dialect negotiation, session setup, authentication, tree connect/share authorization, file handles, locking and client-visible operations. | 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 | client → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → response | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | SMB health is proven only when the intended dialect/session identity completes the exact share and file operation; network connection or authentication alone is insufficient. | 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: client → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → response | 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. SMB health is proven only when the intended dialect/session identity completes the exact share and file operation; network connection or authentication alone is insufficient. | 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. |
SMB · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | SMB |
|---|---|
| Topic path | File Services → SMB |
| Runtime state | SMB is the network file-sharing protocol boundary covering dialect negotiation, session setup, authentication, tree connect/share authorization, file handles, locking and client-visible operations. |
| Fast checks | - Pin client, server/share, SMB dialect/security expectations, credentials and exact file operation. - Verify negotiation/session/tree-connect evidence before blaming backend storage. - Correlate client and server logs with one fresh operation including mapped server identity. - Correct the first failed protocol/auth/share/filesystem boundary, reconnect and repeat the original workload. |
| Verification chain | client → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → response Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | SMB health is proven only when the intended dialect/session identity completes the exact share and file operation; network connection or authentication alone is insufficient. 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. |