-1

I am trying to reset password for a user account for which current password is lost. I am logged in as root but still it is asking for current password. How do I fix this?

closed as unclear what you're asking by Jeff Schaller, G-Man, sebasth, dr01, Archemar Dec 8 '17 at 8:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    What exactly are you doing? passwd (username), when run as root, will not ask for the old password, for exactly that reason. – Ulrich Schwarz Dec 7 '17 at 19:00
  • 1
    Most likely you are not logged in as root: try id to verify. – NickD Dec 7 '17 at 19:05
  • on what system? – ilkkachu Dec 7 '17 at 19:12
  • I have checked everything. I logged in directly as root. No issues with passwd and shadow file. No faillogs. I have also tried to reboot the server. Still when I login as root and try to reset the password for a user account, it is asking for current password. Issue persists only for user accounts and not for admin accounts root and lmain. – Prateek Bansal Dec 10 '17 at 11:49
  • Is it possible that you changed the permissions for root? Perhaps you corrupted the passwd file? Makes sure this is the first line in your /etc/passwd file: root:x:0:0:root:/root:/bin/bash – Octavian Dec 11 '17 at 20:14
3

If you are logged in as root, then you simply type the new password twice. It will not ask for the old password. But you have to use the proper syntax:

passwd username

where username is the name of the user

i.e.;

root@Test:~# passwd someuser      
Enter new UNIX password:     
Retype new UNIX password:

Not the answer you're looking for? Browse other questions tagged or ask your own question.