Linux passwd authentication token manipulation error

Authentication token manipulation error

I forgot my Ubuntu password so I booted into recovery and dropped into a root shell prompt and this is what happened:

root@username-PC:~# passwd username Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchanged 

5 Answers 5

Also make sure you are mounting the file system read/write.

After immediately selecting ‘Drop into root shell prompt’ I found the filesystem was mounted read only, which prevents resetting the password.

Choosing the option to remount / as read/write and going back into the root shell prompt enabled the password change.

The command to run prior to changing the password is: mount -rw -o remount /

Odd. mount showed that / was already mounted as read/write, but mount -rw -o remount / still worked. No idea why.

i am simply one of those idiots who did not read the stdout and forgot to put in the «(current) Unix password» but the password that I want it to be 🙁

+1 — Obvious but not assumed. TY! Also, Ubuntu would be smart to mention this when dropping into root shell when using ‘recovery’ option.. along with a warning about root rw usage..

I’m not sure how it happened. A sudo user created my account then deleted it then created it again.

mount -o remount,rw / passwd passwd: Authentication token manipulation error 
ls -l /etc/passwd /etc/group /etc/shadow /etc/shadow- -rw-r--r-- 1 root root 767 May 7 16:45 /etc/group -rw-r--r-- 1 root root 1380 May 7 16:45 /etc/passwd -rw-r----- 1 root shadow 1025 May 8 09:11 /etc/shadow -rw------- 1 root root 1025 May 7 16:46 /etc/shadow- 
sudo cat /etc/shadow |grep oracle oracle:$6$FsPqyplr$DrIvjFDSx0ipHmECMw1AU5hTrbNMnnkGRdFlaQcM.p3Rdu2OLjY20tzUTW61HlFH16cal56rKlLuW4j2mK9D.:15833:0:99999:7. 

Showed user and encrypted password.

sudo cat /etc/shadow- |grep oracle 

Showed nothing. Not sure what that means but doesn’t look right.

sudo passwd -d oracle passwd 

So the solution was to delete the password then reset new password.

Use pam-auth-update to ensure that Kerberos is not used as one of pam authentication options — if so, passwd leads to Authentication token manipulation error

Funny: my problem was that «a sudo user created my account then deleted it» unbeknownst to me. As a sudo user myself, I «then created it again». Your last piece of code worked for me (Ubuntu 18.04).

Читайте также:  Linux забыл пароль grub

I got this error by changing password with device where date was not set. (ie. it was random after boot)

Basically what happened was that when I changed the password the illegal timestamp got updated to /etc/shadow . After that one could not use that account to login or change its password. Even with root account it was impossible to change that password again.

To fix the account I had to:

  1. Set the correct date
  2. Edit sane expiration/last password change dates to /etc/shadow file (I used last working shadow file)
  3. Change the password with root-rights to new one.

This error is coming from PAM (Pluggable Authentication Module) which says the module was unable to obtain the new authentication token (check auth.log for more details about this error).

This is related to your authorization settings found in /etc/pam.d/ directory (such as minimum_uid in common-auth or some other restrictions requisite marks). So please double check that the settings in PAM module are correct.

PAM_AUTHTOK_ERR : A module was unable to obtain the new authentication token.

Sometimes this error may happen when changing password for a user which didn’t have the current password set yet and passwd still asks for it, so the workaround is to force the change by adding sudo , e.g.: sudo passwd $USER .

Источник

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

In Linux, the passwd command is used to set or change user account passwords, while using this command sometimes users may encountered the error: “passwd: Authentication token manipulation error” as shown in below example.

Recently I was logging in to my CentOS server using my username “tecmint“. Once I am logged in I am trying to change my password using passwd utility, but a second after I am getting the following error messages.

# su - tecmint $ passwd tecmint Changing password for user tecmint Changing password for tecmint (current) UNIX password: passwd: Authentication token manipulation error 

In this article, we will explain different ways of fixing “passwd: Authentication token manipulation error” in Linux systems.

1. Reboot System

The first basic solution is to reboot your system. I can’t really tell why this worked, but it did worked for me on my CentOS 7.

If this fails, try out the next solutions.

2. Set Correct PAM Module Settings

Another possible cause of the “passwd: Authentication token manipulation error” is wrong PAM (Pluggable Authentication Module) settings. This makes the module unable to obtain the new authentication token entered.

The various settings for PAM are found in /etc/pam.d/.

$ ls -l /etc/pam.d/ -rw-r--r-- 1 root root 142 Mar 23 2017 abrt-cli-root -rw-r--r-- 1 root root 272 Mar 22 2017 atd -rw-r--r-- 1 root root 192 Jan 26 07:41 chfn -rw-r--r-- 1 root root 192 Jan 26 07:41 chsh -rw-r--r-- 1 root root 232 Mar 22 2017 config-util -rw-r--r-- 1 root root 293 Aug 23 2016 crond -rw-r--r-- 1 root root 115 Nov 11 2010 eject lrwxrwxrwx 1 root root 19 Apr 12 2012 fingerprint-auth -> fingerprint-auth-ac -rw-r--r-- 1 root root 659 Apr 10 2012 fingerprint-auth-ac -rw-r--r-- 1 root root 147 Oct 5 2009 halt -rw-r--r-- 1 root root 728 Jan 26 07:41 login -rw-r--r-- 1 root root 172 Nov 18 2016 newrole -rw-r--r-- 1 root root 154 Mar 22 2017 other -rw-r--r-- 1 root root 146 Nov 23 2015 passwd lrwxrwxrwx 1 root root 16 Apr 12 2012 password-auth -> password-auth-ac -rw-r--r-- 1 root root 896 Apr 10 2012 password-auth-ac .

For instance a mis-configured /etc/pam.d/common-password file can result into this error, running the pam-auth-update command with root privileges can fix the issue.

Читайте также:  Linux ssh доступ запрещен

3. Remount Root Partition

You might also see this error if the / partition is mounted as read only, which means no file can be modified thus a user’s password can’t be set or changed. To fix this error, you need to mount the root partition as as read/write as shown.

4. Set Correct Permissions on Shadow File

Wrong permissions on the /etc/shadow file, which stores actual passwords for user accounts in encrypted format can also cause this error. To check the permissions on this file, use the following command.

To set the correct permissions on it, use the chmod command as follows.

$ sudo chmod 0640 /etc/shadow

5. Repair and Fix Filesystem Errors

Minor storage drive or filesystem errors can also cause the error in question. You can use Linux disk scanning tools such as fsck to fix such errors.

6. Free Up Disk Space

Furthermore, if your disk is full, then you can not modify any file on the disk especially when file’s size is meant to increase. This can also cause the above error. In this case, read our following articles to clean up disk space can help solve this error.

You will also find these articles relating to managing user passwords in Linux.

That’s it for now! If you know any other solution to fix “passwd: Authentication token manipulation error”, let us know via the feedback form below. We will be grateful for your contribution.

Источник

Ошибка Authentication token manipulation error

Для смены паролей пользователей в Linux можно использовать утилиту passwd. Утилита позволяет сменить пароль для текущего пользователя или для любого другого, если у вас есть полномочия суперпользователя. Иногда при попытке смены пароля вы можете получить ошибку Authentication token manipulation error.

В этой статье мы рассмотрим, как исправить её, а также почему она возникает.

Читайте также:  Контроллер домена linux debian

Что значит «passwd: Authentication token manipulation error»?

Если переводить дословно, то эта ошибка означает, что утилита для управления паролями passwd не может манипулировать токеном. Под токеном здесь подразумивается хєш пароля, который вы указали. Это может возникнуть из-за невозможности записать новый хэш в файл конфигурации, потому что:

  • У программы нет прав на запись в файл /etc/shadow;
  • Файловая система примонтирована в режиме только для чтения;
  • Повреждение файловой системы;
  • На диске нет свободного места;
  • Используется неверный модуль аутентификации;

А теперь давайте рассмотрим, как исправить каждую из этих проблем, чтобы убрать ошибку.

Как исправить «Authentication token manipulation error»

1. Права доступа

Ошибка в работе утилиты может возникнуть, если установлены неправильные полномочия на файл /etc/shadow, в котором хранятся пароли. Смотрим текущие полномочия командой:

У вас чтение и запись должны быть выставлены как на снимке, если это не так, выполните такую команду:

sudo chmod 0640 /etc/shadow

2. Файловая система только для чтения

Если вы загрузились в режиме восстановления Ubuntu или подобном режиме другого дистрибутива, то по умолчанию файловая система будет находиться в режиме только для чтения, соответственно утилита не сможет ничего записать. Чтобы перемонтировать её для записи, используйте:

3. Модули аутентификации

Ещё одной причиной может быть неправильная настройка модулей аутентификации, из-за которой утилита не может сохранить пароль. Доступные модули можно посмотреть командой:

Запустить обновление настроек модулей можно, выполнив от имени суперпользователя:

На первом шаге надо нажать Ok:

Затем выбрать с помощью пробела и стрелок нужные модули, переключиться с помощью Tab на Ok и сохранить.

4. Свободное место на диске

Естественно, утилита не сможет изменить пароль, если на диске не будет свободного места. Убедитесь, что есть, как минимум, несколько сотен свободных мегабайт на корневом разделе. Это можно сделать с помощью команды:

А посмотреть, какие файлы занимают больше всего места, и удалить ненужное можно с помощью ncdu:

Если утилита не установлена, то её можно установить с помощью пакетного менеджера. Название пакета такое же как и у команды:

5. Ошибки файловой системы

Если файловая система была повреждена, то это тоже может стать причиной проблем с изменением пароля. Для проверки и восстановления файловой системы можно использоваться fsck. Но для работы утилиты файловая система должна быть отмонтирована.

Здесь вместо /dev/sda3 необходимо указать адрес вашего раздела жёсткого диска.

6. Другие решения

Ещё многие советуют перезагрузить систему, возможно, это поможет:

Также можно не изменять пароль, а сначала удалить старый такой командой:

sudo passwd -d имя_пользоватлея

sudo passwd имя_пользователя

Выводы

В этой статье мы рассмотрели, как исправить ошибку «passwd: Authentication token manipulation error». Теперь вы знаете, что с ней делать, если она возникнет на вашем компьютере.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

Оцените статью
Adblock
detector