Wednesday, April 30, 2008

Protection Of SSH from Hackers

This Is used to add an additional layer to The System Security

# !/bin/sh
#
# swatch This shell script takes care of starting and stopping
# swatch.
#
# chkconfig: 2345 81 31
# description: Swatch is a System WATCHdog program that we are
# using here to block repeated failed ssh logins.
# processname: swatch


RETVAL=0
test -x /usr/bin/swatch || exit 0
start(){
echo "Starting swatch"
# Spawn a new swatch program
/usr/bin/swatch --config-file=/etc/swatchrc --tail-file=/var/log/secure --awk-field-syntax --tail-args "-F" &
echo $PID
return $RETVAL
}
stop () {
# stop daemon
echo "Stopping swatch:" $PROG
killall swatch
return $RETVAL
}
restart () {
stop
start
RETVAL=$?
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL

No comments:

IMPORTANT

All things mentioned here are solely related to Linux and its related things.The author has taken it from various thirdparty sites and creadit should be given accordingly.This has been done in order to simplify your searching task.The tips and tricks section hav various tricks mentioned.Please DO IT ON YOUR OWN RISK.THE AUTHOR DOESNOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE TO YOUR PROPERTY.

Add to Google Reader or Homepage Subscribe in NewsGator Online Add to My AOL