2010-01-11 17:32:00
Sometimes you're in a hurry and need to set a new, random password on an account. Don't feel your random banging the keyboard is random enough? Then use this script instead.
./boks_set_passwd.ksh [HGROUP|HOST]:USER Example: ./boks_set_passwd.ksh SUN:thomas ./boks_set_passwd.ksh solaris2:root
Three fields get echoed to stdout: the username, the password and the encrypted password string (should you ever need it).
$ wc boks_set_passwd.ksh 92 389 2369 boks_set_passwd.ksh $ cksum boks_set_passwd.ksh 2167470539 2369 boks_set_passwd.ksh
kilala.nl tags: boks, sysadmin,
View or add comments (curr. 2)
Posted by tristan
How do you set a BoKS unix account password to have a non expiry
Posted by Thomas
Hi Tristan,
BoKS security settings for things like passwords can be defined on three levels:
* The system default
* On a per-userclass level
* On a per-user level
I doubt that you want to disable password expiry for every user in your domain, so the first one's out ;)
If you want to disable password expiry for a group of accounts with a common userclass, then you'd turn to the "classadm" command. Otherwise, for the per-user settings, it's "modbks".
The easiest way to 'disable' password expiry, is to set password validity to a very large span of time. So, for example "modbks -l $HG:$USER -e pswvalidtime=6000" which would make the password valid well into 2027 :)
See the man pages for the commands if you want more details.
All content, with exception of "borrowed" blogpost images, or unless otherwise indicated, is copyright of Tess Sluijter. The character Kilala the cat-demon is copyright of Rumiko Takahashi and used here without permission.
You are free to use this specific work, to share and distribute it and to adapt it for your own purposes. However, you must attribute this work as mine and you must share all of your alterations. Click on the logo, or follow this link for full details.