Kraegar has asked for the wisdom of the Perl Monks concerning the following question:

I have been given the task of writing something that will allow people who do not know the root password to reset passwords on a DG/UX system (that is using shadow passwords).
Basically what I'm wanting to do is write something that will be used as a specific user, so when you log on as that user it asks what account you would like to reset the password for, makes sure it is not root, then assigns a default password such as abc123 that must be changed at the next login.
Any tips on how to go about writing something like this?

A sample session should look like this:
login: resetpassword
password:
What account would you like to reset?
$users account reset, must be changed at next login.
exit

Replies are listed 'Best First'.
•Re: Resetting passwords
by merlyn (Sage) on Oct 12, 2002 at 17:17 UTC
    It begs the question:
    How do you know the user is resetting his own password, and not someone else's password?

    You can't use their password to authenticate, or it wouldn't require resetting!

    -- Randal L. Schwartz, Perl hacker

      This is not for users - perhaps I wasn't clear.
      Basically, I want to allow our "Support Center" workers to reset other user's passwords. The support center would log on as the "resetpassword" account and be prompted for the user account to reset.
        OK, this is getting more interesting.
        The support center would log on as the "resetpassword" account and be prompted for the user account to reset.
        So, how do you have individual accountability for whomever it was that reset a password if you have a shared "resetpassword" account?

        And how do you ensure the security of that password if it's shared?

        And what kind of authentication are you using to the web service? Why is this a web service at all?

        Even if you keep them from not resetting "root", perhaps they can reset the password of someone who can become root. This seems like false security.

        Enquiring minds want to know.

        -- Randal L. Schwartz, Perl hacker

Re: Resetting passwords
by Marza (Vicar) on Oct 12, 2002 at 22:37 UTC

    I don't think you want to use Perl for this task. If you want to use something you should look into "super user do" It allows you to hand out some root stuff.

    sudo