[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Looking for a one-time "change this password" script for login



On Tue, 15 Nov 2005 19:28:22 -0800 (PST) "ke6isf" <ke6isf@chez-vrolet.net> 
wrote:
>Every now and again, as is prone to happening on any server, I will create
>a new account for users, and set a generic password for them, and thusly
>instruct them on how to change it - ssh in, 'passwd', use the password I
>just issued them, and have them come up with a better password than the
>generic thing I just issued them.  Problem is, though, that most of my
>users are a little intimidated by the environment.
>
>So that said, what I'm looking for is a simple script that, on creation of
>an account, this script will wait for the new (l)user to log in via ssh,
>welcome them, give them instructions on what precisely to do ("Change your
>password now!"), ask for other miscellaneous options, and never come up
>again, favoring the typical motd and whatever shell they want.
>
>Is there a package I should look for, or is there a different (or
>otherwise fairly standard) way I should go about doing this?

While this would be a bit of a dirty hack, I would personally just write a 
small script to check for the existance of a flag file (say ".pwd-changed") 
and if it doesn't exist, run passwd. Then just add this to the user's 
.profile and you're done. You could actually add this to skel to have it in 
there automatically whenever you create a new user.

Definitely not an ideal solution, but it gets the job done.

-- 
Alex Malinovich



Reply to: