hi,

I am new to scripting.
I want to change username and password of a user 500 times.
I dont want to use except .....please somebody help.


Thanks in advance,
Pallavi

Recommended Answers

All 2 Replies

Hey there,

Generate some random string, Use Gnu passwd. It has a --stdin option. Repeat 500 times, possibly in a while loop.

Best wishes,

Mike

Hi ,

Thanks for reply somehow i manage to write till firing the command passwd username.
But i am not able to proceed further.
I dont know how to give input from the script when it asks me to enter the password.
idiraptor:/ # passwd pallavi
Changing password for pallavi.
New password:
Bad password: too simple
Re-enter new password:
Password changed
i am not allowed to use expect :(.

the script is supposed to give password1 as the 1st password.
then password2 .. password500.
Please HELP me out.

Thanks,
Pallavi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.