Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user reset

Status
Not open for further replies.

rubbersoul

IS-IT--Management
Mar 20, 2003
88
CA
I want to write a script that will change the password to a users login name and also reset his/her login count.

I know the two lines I need but don't know if it's possible to just run the dcript and be promptd for the user name....here's what I have so far...


passwd $username
chsec -f /etc/security/lastlog -a 'unsuccessful_login_count = 0' -s $username

can this be done? It's just that I have to do these all the time and don't want to have to go into smit everytime!

 
Hi. Something like:

echo "Please enter the username: \c"
read USERNAME

The variable will then be stored in $USERNAME and can be used as above. Hope this helps.
 
why not pass the username to the script as a parameter?


chpawd.sh:
------------------
echo "change password to $1":
passwd $1
chsec -f /etc/security/lastlog -a 'unsuccessful_login_count = 0' -s $1


# chpawd.sh user
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top