passwd Error: 'Authentication token manipulation error' — Cause, Fix, and Troubleshooting Guide
Fix 'passwd: Authentication token manipulation error': read-only /etc, missing/immutable shadow, full disk, or a network account. Diagnose and fix.
- #security
- #hardening
- #troubleshooting
- #linux
- #pam
Stuck on this DevOps Security & Hardening error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
What this error means
passwd (through pam_unix) could not write the new password hash into /etc/shadow. The “token” is the password record, and “manipulation error” means the update to the backing store failed — usually because the filesystem is read-only, the shadow file is missing/immutable, the disk is full, or the account is managed elsewhere.
passwd: Authentication token manipulation error
passwd: password unchanged
The same error surfaces when changing your own password interactively or when a hardening/rotation script tries to set one non-interactively.
Where it surfaces
passwd user(or self) ends withAuthentication token manipulation errorand no change.chpasswdin a provisioning script fails for one or more accounts.- It started after mounting
/read-only, a disk-full event, or a hardening step that set immutable bits. - Local users fail while directory-backed users are unaffected (or vice versa).
Identity and permission causes
- Read-only filesystem.
/or/etcis mounted read-only, so/etc/shadowcannot be rewritten. - Immutable shadow.
/etc/shadowcarries the+iattribute from a hardening step. - Disk full / no inodes. The write to
/etc/shadow(via a temp file) cannot complete. - Missing or corrupt shadow entry. The user has no
/etc/shadowline, or it has the wrong field count. - Network-managed account. The user comes from LDAP/AD; local
passwdcannot update the directory.
Tracing the failed authorization
# Is the filesystem writable?
mount | grep -E ' / | /etc '
touch /etc/.passwd_write_test 2>&1 && sudo rm -f /etc/.passwd_write_test
# Is shadow immutable or missing an entry?
lsattr /etc/shadow 2>/dev/null
sudo getent shadow appuser # empty => no local shadow record
# Disk / inode pressure?
df -h /; df -i /
# Where does the account come from?
getent passwd appuser
----i--------e-- from lsattr means immutable; a read-only mount or a full disk shows up in mount/df.
Resolution
1. Remount writable if / or /etc is read-only (then investigate why it went RO):
sudo mount -o remount,rw /
sudo passwd appuser
2. Clear an immutable bit set by hardening, change the password, and re-apply if your policy requires:
sudo lsattr /etc/shadow
sudo chattr -i /etc/shadow
sudo passwd appuser
# sudo chattr +i /etc/shadow # only if your baseline expects it
3. Free space / regenerate shadow for disk or missing-entry cases:
df -h / # clear space if full
sudo pwck # check passwd/shadow consistency
sudo pwconv # rebuild /etc/shadow entries where missing
4. For a network account, change the password in the directory (via kpasswd, ldappasswd, or AD tooling) — local passwd cannot.
Hardening access
- Do not hand-edit
/etc/shadow; usepasswd/chpasswd/pwconvto avoid corrupting field counts. - If a hardening baseline sets
+ion shadow, document it — every password change will otherwise fail mysteriously. - A read-only rootfs is often intentional (immutable infra); change the source image/policy rather than fighting it at runtime.
- In scripts, prefer
chpasswdwith hashed input from a secret store over echoing plaintext passwords.
Related identity errors
- chage ‘cannot change to shadow password aging’ Error Guide
- PAM ‘authentication failure’ Error Guide
- Auditing PAM and Password Policy with AI
Fixed it? Get 500 DevOps Security & Hardening & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Stuck on this? Start guided troubleshooting
Open an interactive diagnostic session with this error already loaded. Work a step-by-step plan, record what each check returns, land on a root cause, and export a clean incident summary — no account needed to start.
Did this fix your issue?
Solved it a different way?
Share the fix that worked for you — reviewed, then published to help the next engineer.
That looks like it may contain a secret (key, token, password, or connection string). Please remove it — a note with a detected secret can’t be published.
Thanks — that helps. Published notes appear after a quick review.
Trending errors this week
The error guides other engineers are actually reading right now.
- 1mount: wrong fs type, bad option, bad superblock
- 2Docker 'failed to set up container networking': Fix the Bridge and IP Pool
- 3Docker 'failed to create shim task': How to Fix the containerd Runtime Error
- 4Transport endpoint is not connected
- 5modprobe: FATAL: Module not found
- 6mount: wrong fs type, bad option, bad superblock
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.