CommandsLinux

How to Fix “passwd: Authentication token manipulation error” in Linux

Encountering the “passwd: Authentication token manipulation error” while trying to change a user’s password on a Linux system can be frustrating. However, there are several solutions you can try to resolve this issue and successfully change the password.

Use the sudo command: Instead of directly using the passwd command to change the password, try running it with sudo privileges. You can do this by using the following command:

$ sudo passwd

Replace <username> with the actual username for which you want to change the password. By entering this command, you will be prompted to enter a new password for the specified user.


Example output:

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Use the passwd command with the -e option: The -e (expire) option is used to expire the password, forcing you to change it upon next login. Use the following command:

$ sudo passwd -e <username> 

Again, replace with the desired username.

Example output:

Expiring password for user .
passwd: Success

Check the /etc partition: Ensure that the partition containing the /etc/passwd and /etc/shadow files is mounted in read-write mode. If the partition is mounted as read-only, changing the password will not be possible. You can use the mount command to check the status of partitions.

$ mount | grep -E '/etc/passwd|/etc/shadow'

If the partition is mounted as read-only, you should remount it as read-write or address any issues with the partition.

Example output:

/dev/sda1 on /etc type ext4 (rw)

Check the system disk: If the partition containing the /etc/passwd and /etc/shadow files is full, it can result in an error when changing the password. Check the available disk space on the system using the df -h command. If the partition is full, free up space by deleting unnecessary files or expand the partition.

$ df -h

Example output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       20G   18G  1.3G  94% /

Verify the /etc/passwd and /etc/shadow files: Check if these files are correct and not corrupted. Errors in these files can lead to the “passwd: Authentication token manipulation error” issue. If the files are damaged, you can restore them from a backup or regenerate them.


Example output:

/etc/passwd: file format: ASCII text
/etc/shadow: file format: ASCII text

By following these steps, you should be able to change the password without encountering the “passwd: Authentication token manipulation error” message. If the problem persists, further investigation and troubleshooting on your system may be required.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button