Archive for April, 2008

Root Password Generation

Tuesday, April 8th, 2008

Creating and maintaining root passwords across a large number of servers is not something to take for granted. In networks there are often hundreds of servers to maintain. A good Sysadmin knows that for maximum security each and every server needs to have a unique root password. The practicality for this is [...]

Secure /tmp usage for bash scripting

Tuesday, April 8th, 2008

I’ll cut to the chase…
# Secure tmp directory usage.
tmp=${TMPDIR-/tmp}
tmp=$tmp/unf.$RANDOM.$RANDOM.$RANDOM.$$
(umask 077 && mkdir $tmp) || {
echo “Could not create temporary directory! Exiting.” 1>&2
exit 1
}
(umask 077 && mkdir $tmp/mebad) || {
echo “Could not create temporary directory! Exiting.” 1>&2
exit 1
}