1

I know there have been a lot of posts about this, but cannot seem to find an answer that has worked for me.

I wanted to change the password of my root user, but have failed in doing so.

logged in as root; root@ubuntu:/ passwd

passwd: Permission denied

passwd: password unchanged

root@ubuntu:/ sudo passwd root passwd: Permission denied;; passwd: password unchanged;;

this is a ubuntu 10.04 system and i dont know how can i solve this. I have tried changing the PAM files as well as login.defs file,but to no avail. can anyone help me?

Vijit Jain
  • 23
  • 7

3 Answers3

1
sudo passwd root

Now u see it asking for the new password for root. So reset it and Enjoy :)

$su root

Give the new password that you have entered

Krishna Ghodke
  • 589
  • 2
  • 6
  • 26
0

Enter recovery mode through grub and choose to enter a root shell. From there:

passwd <user>

No unmounting of the drive is required.

Cameron
  • 84
  • 1
  • 11
  • I cannot afford to unmount the drive, as it runs critical applications for the Website. – Vijit Jain Jul 10 '13 at 17:59
  • yes, i am. Sudo works fine with everything. but, not when i want to change the password of the root user – Vijit Jain Jul 10 '13 at 18:06
  • What are the permissions of `/etc/passwd` and `/etc/shadow`? – Cameron Jul 10 '13 at 18:32
  • -rw-r--r-- 1 root root 1466 2013-06-09 23:04 /etc/passwd ### -rw-r----- 1 root root 986 2013-06-09 23:04 /etc/shadow – Vijit Jain Jul 10 '13 at 18:55
  • If changing the root password isn't time-critical, maybe just schedule server downtime and [unmount the drive](http://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password/24024#24024)? Not a solution, I know, but still... – Cameron Jul 10 '13 at 19:35
  • as the server is linked to a lot of company web servers, it is not feasible to unmount the drive. And changing the password is time critical for me right now. – Vijit Jain Jul 10 '13 at 19:49
0

Make sure your /etc/pam.d/common-password looks like this

# here are the per-package modules (the "Primary" block)
password        [success=1 default=ignore]      pam_unix.so obscure sha512
# here's the fallback if no module succeeds
password        requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password        required                        pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config
Pradeep Pathak
  • 444
  • 5
  • 6