1

How to give permission for the new user account to have access to passwd command to allow this new user account to be able to change other account password?

I tried zxcvbnm ALL= NOPASSWD:/etc/passwd but don't think my path name was correct. someone please help.

2
  • 1
    If you want to find out the path where an executable is stored, use the command which. So, on my machine (and probably yours to, but you should probably check), which passwd returns /usr/bin/passwd. With that said, what you are trying to do is a HUGE security risk, and I would not recommend it.
    – fouric
    Oct 29, 2013 at 15:31
  • Do you want to make this user an administrator: i.e. able to use sudo. If yes sudo adduser user sudo should do it replacing user with the user name of the user you want to be an administrator. Anything else makes no sense and would be a security risk. Oct 29, 2013 at 16:12

1 Answer 1

2

As changing another user's password is an administrative task it should be done from a user with administrator permissions. Any such administrator has access to sudo and will then be able to change another user's password with the following command:

sudo passwd USERNAME

You will be asked for your sudo password first, then you will have to enter the new password for the given user USERNAME twice.

From the security point of view it does not make much sense to let non admintrator users change the passwords of all users. This would be a perfect way to gain administrator access (or to accidentally lock the administrator out).

Therefore all users you need to be able to change the password of other users should have an administrator account (and be taught about the responsibility that comes with this).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .