December 2010
18 posts
And, last but not least, Oracle 10g:
su - oracle
ksh
typeset -u uid
echo “which user ? \c”; read uid
sqlplus ‘/ as sysdba’ « EOF
update sys.user$ set ptime=’13-OCT-2037’ where name=’$uid’;
EOF
exit #ksh
exit #su
The NIS+ version of the last post:
ksh
echo “which user ? \c”; read uid
eshadow=`nismatch [name=$uid],passwd.org_dir | cut -d: -f9-`
edate=`echo $eshadow | cut -d: -f8`
if [ ${#edate} -eq 5 ]; then
newdt=`expr $edate + 10000`
newshadow=”$edate:$eshadow”
nistbladm -e shadow=”$newshadow” [name=$uid],passwd.org_dir
fi
exit #ksh
If you’re in a system that requires you to change your password every (x) days, you can (of course) avoid it by changing the “rules”. A less obvious way (if you cannot change the rules [auditors], but nonetheless still want to avoid them) is to change the date that the system thinks you changed your password. On Solaris 10, you can do this as follows (as root):
ksh
echo “which user ? \c”; read uid
edate=`grep “^$uid:” /etc/shadow | cut -d: -f3`
if [ ${#edate} -eq 5 ]; then
newdt=`expr $edate + 10000`
ed /etc/shadow « EOF
/^$uid:/
s/:$edate:/:$newdt:/
w
q
EOF
fi
exit #ksh
This tells Solaris that you changed your password 27+ years later than you really did. And since the password aging algorithm uses the date you last changed your password as its starting point, you’re now good for an extra 10,000 days.
You may be thinking of a long-winded diatribe on why password aging is good, and for the most part, I agree. But there are times when it does not make sense — and for those times (when you want to [have to] leave the system as it is), you have a choice …
Assuming that
grep “^aliases:” /etc/nsswitch.conf
comes up with files before nisplus, make an entry at the end of /etc/aliases like this:
unix_id:email_address
and then run
newaliases
to get the system to see it (creating a .forward won’t do what you want).
Please recommend me for the Developers Directory. Thanks.
“If Java had true garbage collection, most programs would delete themselves upon execution.” — Robert Sewell
On Tuesday 21st December 2010, @FunnyOrFact said:
If you can read this, your brain is 50% faster than those who can’t:
i cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno’t mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! if you can raed tihs forwrad it.