Set sticky bits

This commit is contained in:
Bob Mottram 2016-11-30 13:40:17 +00:00
parent 3f58fc17d2
commit 5c79c584fc
1 changed files with 10 additions and 0 deletions

View File

@ -416,6 +416,14 @@ function remove_serial_logins {
fi fi
} }
function set_sticky_bits {
world_writable=$(find / -xdev -type d -perm -002 \! -perm -1000)
for w in $world_writable; do
echo "Setting sticky bit on $w"
chmod +t $w
done
}
function lockdown_permissions { function lockdown_permissions {
if [ -d /bin ]; then if [ -d /bin ]; then
chown root:root /bin/* chown root:root /bin/*
@ -466,6 +474,8 @@ function lockdown_permissions {
if [ -f /usr/sbin/exim4 ]; then if [ -f /usr/sbin/exim4 ]; then
chmod u+s /usr/sbin/exim4 chmod u+s /usr/sbin/exim4
fi fi
set_sticky_bits
} }
function disable_core_dumps { function disable_core_dumps {