LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Require Password Change script v2.

Posted 12-16-2008 at 07:11 PM by camh
Updated 12-16-2008 at 07:13 PM by camh (changed title to be more accurate)

Here is the second version of my required password change script. Added automated salt and password generation functionality, and removed the use of temp files.

If anyone knows how this can be optimized or improved, please comment. I'm still learning bash scripting and any help is appreciated.

Code:
#!/bin/bash

#Defines

SALT_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
SALT_LENGTH="2"
PW_CHARS="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()."
...
Member
Posted in Uncategorized
Views 988 Comments 0 camh is offline
Old

Script to require password change at next login

Posted 12-02-2008 at 06:11 PM by camh

Hi all,

I wrote up this little script to force a password change to a user account on next login. I've found it helpful when doing user administration, since I've found that users generally don't change their passwords unless you force it, and linux doesn't have a 'built-in' script to do so.

Code:
#!/bin/bash

if [ "$(whoami)" != 'root' ]; then
   echo "This program must be run as root"
   exit 1;
 elif [ -z $1 ]; then
...
Member
Posted in Uncategorized
Views 1460 Comments 0 camh is offline

  



All times are GMT -5. The time now is 09:54 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration