Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

SMB

Direct answer

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).

When to use this

Use it to mount Windows/Samba shares on Linux, or when the mount fails.

First 30 seconds

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.

Operational verification

client → TCP 445 → SMB negotiation (version, signing) → authentication → share mounted

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to mount Windows/Samba shares on Linux, or when the mount fails.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • showmount -e <server> / exportfs -v — NFS exports
  • findmnt -t nfs,nfs4,cifs — mounted network shares
  • smbclient -L //<server> -U <user> — SMB shares
  • testparm -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= and password=, or better, credentials= pointing to a file with username, password and domain lines, 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= and dir_mode= set ownership and modes when the server sends no Unix information.
  • sec= chooses the authentication (ntlmssp is the default; krb5 for Kerberos).
  • seal requests SMB3 encryption.
  • multiuser gives each local user their own session.
  • cache=strict is the current default. The manual warns that loose can corrupt data when several clients share files.

A persistent mount

FileContent
/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

SituationOptions
One local user or service uses the shareuid=, gid=, file_mode=, dir_mode=
Many local users, each with their own AD accountmultiuser,sec=krb5 + cifscreds or Kerberos tickets
Samba server with Unix extensions (SMB1)Server ownership is used; rarely relevant with SMB3

Troubleshooting

ErrorTypical cause
mount error(13): Permission deniedWrong credentials, domain or sec=
mount error(95): Operation not supportedProtocol mismatch, e.g. the server allows only SMB1
Host is downPort 445 blocked, or the name doesn't resolve
Files owned by root, read-onlyMissing 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
smbserver message block linuxcifs smb linux
Embedded reference data

Quick lookup tables

SMB operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for SMB.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateSMB 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 verificationPin 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 chainclient → TCP/SMB negotiate → session authentication → tree connect → share authorization → file create/open/lock/read/write → server filesystem → responseTrace requested/configured state through effective state to the observed workload result.
Failure boundarySMB 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 evidenceCorrelated 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 → responseUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundarySMB
Topic pathFile Services → SMB
Runtime stateSMB 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 chainclient → 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 boundarySMB 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?