Need script to change server password
Hi,
I need shell scrip to change server password on daily basis which will notify me by email. Please help me... Durgesh |
What do you have so far?
I would probably use the $RANDOM functionality in bash to generate a series of random numbers, and convert these to valid ascii characters, ultimately generating a string of random ascii N characters long. Then you can use passwd along with expect to set the password, and finally a command line mail program to send it to you. I would highly recommend writing out the password in an encrypted file for safe keeping though. If the network goes down or email service goes down, you'll lose access to the machine until it's back up, assuming the script keeps on working. |
Hi, welcome to LQ!
Quote:
exercise is ... what are you trying to achieve? Apart from the obvious, of course. Cheers, Tink |
Sounds a bit like homework; a new passwd every day is unusual, even in secure establishments.
Note also that email is sent plaintext (!). If you really want that sort of security, consider ssh+auth-keys and/or use RSA Token. PS: creating passwds: http://www.cyberciti.biz/faq/generat...ndom-password/ |
All times are GMT -5. The time now is 02:34 PM. |