Sunday, February 22, 2009

How to disable all logins?

Some servers are meant to only serve few specific ports and in this case, server administrator should disable the normal login process. In my case, I wanted to have alerts when someone tries to even login to this server and I configured /etc/hosts.deny file to send alerts to me. This is good for at least Solaris OS.

# cat /etc/hosts.deny
ALL: ALL: /usr/ucb/finger -l @%h 2>&1 | /bin/mailx -s "Someone is knocking at `hostname`"

No comments: