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
Fixing errors like this? Get 500 free DevOps AI prompts
500 copy-paste AI prompts for the stack you actually run — one PDF, free.
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
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.