About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When mount -t cifs prints mount error(13): Permission denied, the server answered and refused. Error 13 is EACCES. The kernel's status-to-error mapping marks a failed logon, a locked account and an access-denied status as -EACCES. The message is followed by Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg), and the kernel log is where the server's reason appears. Read it before changing options.
What the error means
The mount.cifs helper calls the mount system call. If it fails, the helper prints mount error( followed by the error number, then the system's text for it, as the cifs-utils source shows (mount error(%d): %s). In the Linux errno header, EACCES is defined as 13, with the comment "Permission denied".
The kernel client turns the server's NT status into a Linux error. From kernel 7.0 the comments next to each status in smb2status.h indicate the mapping and are used to generate the table; before that, the table is written by hand in smb2maperror.c, with the same values for the statuses below. STATUS_LOGON_FAILURE (0xC000006D), STATUS_ACCESS_DENIED (0xC0000022) and STATUS_ACCOUNT_LOCKED_OUT (0xC0000234) are all marked -EACCES. So error 13 on its own does not say which of these the server sent. Other statuses give other numbers: the same header marks STATUS_ACCOUNT_DISABLED as -EKEYREVOKED and STATUS_BAD_NETWORK_NAME as -ENOENT.
The mapping code (smb2maperror.c) can print a notice with the form Status code returned 0x%08x followed by the status name. Whether it prints depends on the kernel version and on its logging flags. When it is present, it names the real reason.
Some options that look unrelated decide this error, and the mount.cifs manual documents the traps:
- User and domain are separate options. "Users must use the discrete password= and domain= options to specify relevant values. Including these in the username= option is no longer supported."
- Commas in a password break command-line parsing. "a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line." The same password in the
PASSWDenvironment variable, a credentials file, or at the prompt "will be read correctly". - The helper ignores
smb.conf. "mount.cifs ignores smb.conf completely", unlike some Samba client tools.
A different failure is worth separating from error 13. When the mount fails with EHOSTDOWN, the helper prints mount error: Server abruptly closed the connection. and says "This can happen if the server does not support the SMB version you are trying to use." That is not error 13. The mount.cifs manual says sec= accepts values such as ntlmssp and krb5 (default sec=ntlmssp since kernel 3.8), that signing "may be enabled automatically" when the server requires it, and that with vers=default the client "Tries to negotiate the highest SMB2+ version supported by both the client and server". The mount.cifs manual does not say that a dialect or signing mismatch ends as error 13.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Wrong user name or password | Kernel log shows a logon failure status | Test the same account on a Windows machine or a directory tool |
Domain given inside username= |
Fails with a domain account that works elsewhere | The mount command has DOMAIN\user in username= |
| Comma (or other delimiter) in the password | Works at the prompt, fails from the command line or /etc/fstab; the manual says only that the password "will fail to be parsed correctly", and the error text may differ |
Move the password into a credentials file and retry |
| Account locked out | Works earlier, now refused for the right password | Kernel log shows a lock-out status; the directory shows it locked |
| The user has no access to the share | Logon works for other shares, refused for this one | Access-denied status; check share permissions on the server |
Settings assumed from smb.conf |
No effect from client settings | mount.cifs ignores that file |
Prove the cause before changing anything
Steps 1, 3 and 4 only read. Steps 2 and 5 try a real mount, so each is marked. Keep any output private.
1. Read the kernel log for the status.
journalctl -k
The mount.cifs message itself points to the kernel log (dmesg). Look for a line that contains Status code returned near the time of the failed mount. Match its hexadecimal value against the smb2status.h values above.
2. Print what mount.cifs is doing. Risk: this is a real mount of the share, not a read-only check. Use an empty directory created for the test (/mnt/test here), because a mount hides what the directory held until it is unmounted, and the ro option keeps the test from writing. Unmount it straight after with umount /mnt/test.
mount -t cifs //files01.example.com/data /mnt/test --verbose -o username=svc-app,domain=EXAMPLE,ro
The manual lists ro as "mount read-only" and says --verbose "must be specified before the -o". The output may echo options, so check it for a password before you copy it anywhere.
3. Check the tool and module versions. mount.cifs -V shows the helper's version and modinfo cifs shows the module's, as the manual describes.
4. Check the dialect on a share that works. The manual says to refer to /proc/fs/cifs/DebugData to check the dialect in use.
5. Rule out parsing. First create the credentials file as described under "Use a credentials file" in the Fix section. Risk: this is a real mount of the share, with the same impact as step 2: a mount hides what the directory held until it is unmounted. Use the same empty test directory and ro:
mount -t cifs //files01.example.com/data /mnt/test -o credentials=/root/smb-cred-app01,ro
umount /mnt/test
If the mount works, the cause was parsing.
Fix
Use a credentials file
The manual says a credentials file "is preferred over having passwords in plaintext in a shared file, such as /etc/fstab". The format is lines username=value, password=value and optionally domain=value. The manual also says "Be sure to protect any credentials file properly." Create the file empty in your editor and save it, restrict it, and only then add the lines, so the password is never in a file other users can read:
chmod 600 /root/smb-cred-app01
The chmod manual accepts an octal mode, and 600 gives read and write to the owner only. Now reopen the file and add the lines. The bugs section of the manual adds that the credentials file cannot handle a user name or password that starts with a space.
Risk: mounting the share is a real mount, and a mount hides what /mnt/data held until it is unmounted. Use an empty directory. To back out after mounting, run umount /mnt/data.
Then mount:
mount -t cifs //files01.example.com/data /mnt/data -o credentials=/root/smb-cred-app01
Give the domain as its own option
Use domain=EXAMPLE (or workgroup= or dom=, which the manual lists as aliases) instead of putting the domain in username=.
Make it permanent in /etc/fstab
Disruptive step: an error in /etc/fstab can stall or break boot or mount handling. Copy the file first, then edit:
cp -a /etc/fstab /etc/fstab.2026-11-20
Add one line with the device //files01.example.com/data, the mount point /mnt/data, the type cifs and the options credentials=/root/smb-cred-app01, in that field order. The mount.cifs manual does not show an fstab line, so check fstab(5) for the last two fields. Then check the table with the documented verify option:
findmnt --verify
The findmnt manual says -x, --verify checks the mount table, by default /etc/fstab, for parsability and usability. Test the entry by mounting it by its mount point before any reboot. To back out, copy /etc/fstab.2026-11-20 over /etc/fstab, run findmnt --verify, and unmount the test mount.
If the helper reports the server closed the connection (not error 13)
The helper's own text suggests trying vers=1.0. The manual lists modes with the i suffix, such as ntlmsspi, that force packet signing. First copy the current mount command or /etc/fstab line, with its full option list, into a dated note. Risk: forcing a mode the server does not accept turns a working mount into a refused one. Leave sec= at its default unless the server needs a specific mode; if the mount line already forces one, test with it removed. To back out, put the option list from the dated note back, and unmount any test mount.
If the server needs an older dialect, vers= accepts values from 1.0 to 3.1.1. Risk: the manual describes SMB1 as having "much weaker security", so use vers=1.0 only for a device you cannot update, on a network you control, after a decision by whoever owns the risk. To back out, put the saved option list back.
Server-side faults
If the kernel log names a lock-out or an access-denied status, the fix is on the server: unlock the account, or grant the account access to the share. Those changes belong to the directory or file-server administrator.
Example (illustrative): app01 runs mount -t cifs //files01.example.com/data /mnt/data -o username=svc-app,password=OldPass1 and gets mount error(13): Permission denied. The password was changed on the server last week. journalctl -k shows a line with the status STATUS_LOGON_FAILURE, which the kernel maps to -EACCES. The administrator creates /root/smb-cred-app01 empty, sets mode 600, adds the current user name and password, and mounts with credentials=. The mount succeeds and ls /mnt/data lists the share.
Confirm the fix
- The mount command succeeds and
ls /mnt/datalists the share. findmnt --verifyreports no problem with/etc/fstab.- A reboot, or a test of the fstab entry, mounts the share again.
- The kernel log shows no new status lines for the account.
What to watch afterwards
- When a service account's password changes, update the credentials file in the same change.
- Keep the file's mode at 600 and its owner as root.
- Alert on failed logons for service accounts, which can lock the account.
- If a server change raises its security requirement, such as signing, test a mount before the change window.
Read next
Related articles you may want next.
- TroubleshootingSMB Signing Now Required: NAS and Old Client Access FailuresNAS share fails after Windows 11 24H2 or Server 2025? Tell signing (STATUS_INVALID_SIGNATURE) from blocked guest access, audit with SMBClient events, fix the device first.Read article
- Backup & RecoveryRestoring Linux files to Windows or SMB: the names, case and characters that do not surviveWhy Linux file names fail or collide on Windows restores: reserved characters and names, case, path length, Samba name mangling and vfs_catia, with a plan.Read article
- TroubleshootingNFS "Stale file handle": what changed on the server and how to remountNFS Stale file handle means the server no longer honours a handle the client holds. Find what changed on the server, then unmount and remount safely.Read article
Risks and limits
- These commands have not been run or lab-tested.
- Kernel log wording depends on the kernel version; the
Status code returnedtext is from current mainline source. - The status-to-error table is written by hand in
smb2maperror.cin kernel v6.6 and v6.12. In v7.0 and on the master branch,smb2maperror.cincludes a generatedsmb2_mapping_table.c, built from the comments insmb2status.h. The table may change. --verboseoutput can include sensitive option text.- The page date for
mount.cifs(8)is not shown; the colophon says it was obtained on 2026-08-03. - Windows-side signing and guest-access policy changes are a separate topic; see "SMB Signing Now Required: NAS and Old Client Access Failures".
Sources
- mount.cifs(8) — cifs-utils manual page, no page date shown (colophon: obtained 2026-08-03), accessed 20 November 2026
- cifs-utils: mount.cifs.c — cifs-utils maintainer's repository, master branch, no date shown, accessed 20 November 2026
- Linux kernel: smb2status.h — Linux kernel source, master branch, no date shown, accessed 20 November 2026
- Linux kernel: smb2maperror.c — Linux kernel source, master branch, no date shown, accessed 20 November 2026
- Linux kernel v7.0: smb2status.h — Linux kernel source, tag v7.0, no date shown, accessed 20 November 2026
- Linux kernel v7.0: smb2maperror.c — Linux kernel source, tag v7.0, no date shown, accessed 20 November 2026
- Linux kernel v6.12: smb2maperror.c — Linux kernel source, tag v6.12, no date shown, accessed 20 November 2026
- Linux kernel v6.6: smb2maperror.c — Linux kernel source, tag v6.6, no date shown, accessed 20 November 2026
- Linux kernel: errno-base.h — Linux kernel source, master branch, no date shown, accessed 20 November 2026
- findmnt(8) — util-linux 2.43.devel, 2026-08-03, accessed 20 November 2026
- chmod(1) — GNU coreutils 9.11, April 2026, accessed 20 November 2026
- cp(1) — GNU coreutils 9.11, April 2026, accessed 20 November 2026
- journalctl — systemd documentation, no date shown, accessed 20 November 2026
This article was originally published on .