You need to setup password less login using ssh keys; refer to following tutorials: + Howto Linux / UNIX setup SSH with DSA public key authentication (password less login) + SSH Public key based authentication – Howto #!/bin/bash # Remote Server Rsync backup Replication Shell Script # ————————————————————————- # Copyright (c) 2005 nixCraft project # [...]
A quick and usefull command for checking if a server is under ddos is: netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n That will list the IPs taking the most amount of connections to a server. It is important to remember that the [...]
A shell script to monitor server disk space and send an email alert to admin. This is useful if you are using rented dedicated / vps server and backup data to NAS everyday. This script will monitor disk space and it will send you an email. Make sure you setup your email id, NAS space [...]
#!/bin/bash # mybackupadd – Add file to ~/.mybackup file, then backup and email all # file as tar.gz to your email a/c. # # Usage : ./mybackupadd ~/public_html/ # # Copyright (C) 2004 nixCraft project # Email : http://cyberciti.biz/fb/ # Date : Aug-2004 # ————————————————————————- # This program is free software; you can redistribute it [...]
April 26th, 2013 |
admin |
#!/bin/bash # A simple shell to build and install suhosin as module for PHP under # CentOS, Fedora and RHEL / Redhat Enterprise Linux servers. # —————————————————————————- # Written by Vivek Gite <http://www.cyberciti.biz/> # (c) 2009 nixCraft under GNU GPL v2.0+ # —————————————————————————- # Home page: http://www.hardened-php.net # Last updated: 15/June/2010 # —————————————————————————- VERSION=”-${2:-0.9.31}” URL=”http://download.suhosin.org/suhosin${VERSION}.tgz” [...]
April 16th, 2013 |
admin |
#!/bin/bash # Shell script to find all programs and scripts with setuid bit set on. # If your system ever cracked (aka hacked) then system has this kind of binary # installed; besides the normal setuuid scripts/programs # # *TIP* # User directory /home and webroots such as /www canbe mounted with # nosuid option. [...]
April 12th, 2013 |
admin |
Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be [...]
April 6th, 2013 |
admin |
tail -1000 /var/log/maillog | grep host= | cut -d= -f2| cut -d” ” -f1|sort -n |uniq -c |sort -n Incoming search terms:cppop security (1)
April 5th, 2013 |
admin |
grep xxx@xxx.com /var/log/exim_mainlog | grep “<=” | awk {’print $3′} | wc -l
April 5th, 2013 |
admin |
If you need to get a full list of all created end-User E-Mail Accounts, you can use a script to do so: #!/bin/sh cd /etc/virtual for i in `cat domains`; do { if [ ! -s $i/passwd ]; then continue; fi for u in `cat $i/passwd | cut -d: -f1`; do { echo “$u@$i”; }; [...]