rsync –delete –stats -vae ssh 12.123.123.123:/backup/cpbackup/daily/ /backup/cpbackup/daily/ –exclude-from ‘/root/exclude.txt’
I added the file exclude.txt because with this code you can have certain files not be transferred. In this case I added pending and spam emails.
So my exclude.txt file has this in it:
*.*.dwhs1234.dwhs.net
*.*.dwhs1234.dwhs.net:2,
*.*.dwhs1234.dwhs.net:2,*
*.msg”
core.*
*.*.mbox:2,
This is for a cpanel based server.
Entries from August 2009
Rsync
August 18th, 2009 by EZ linux · 1 Comment
Tags: Linux Commands · Linux Software / Scripts
chown
August 17th, 2009 by EZ linux · No Comments
chown -R cali:cali public_html
-R means reciprocal
Tags: Linux Commands
skdetect
August 17th, 2009 by EZ linux · No Comments
wget http://tsd.student.utwente.nl/skdetect/skdetect-1.0pre4cvs
./skdetect-1.0pre4cvs
Tags: Linux Commands · Linux Security · Linux Software / Scripts
Root check
August 17th, 2009 by EZ linux · No Comments
Install chkrootkit
To install chrootkit, SSH into server and login as root.
At command prompt type: cd /root/
At command prompt type: wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
At command prompt type: tar xvzf chkrootkit.tar.gz
At command prompt type: cd chkrootkit-0.47
At command prompt type: make sense
To run chkrootkit
At command prompt type: /root/chkrootkit-0.47/chkrootkit
Make sure you run it on a regular basis, perhaps including it [...]
Tags: Linux Commands · Linux Security · Linux Software / Scripts
Port listening check
August 17th, 2009 by EZ linux · 1 Comment
nmap localhost (checks listening ports)
lsof -i :1980 (checks what running on that port)
kill -15 (kills what’s running on that port)
—-check open ports—-
check for open ports: ‘netstat -a’
Tags: Linux Commands · Linux Security · Linux Software / Scripts · Ports
Log watch and root emailed
August 17th, 2009 by EZ linux · 1 Comment
—-Server e-mail every time someone logs in as root
To have the server e-mail you everytime someone logs in as root, SSH into server and login as root.
At command prompt type: pico .bash_profile
Scroll down to the end of the file and add the following line:
echo ‘ALERT – Root Shell Access on:’ `date` `who` | mail -s [...]
Tags: Linux Commands · Linux Software / Scripts
Iptables services
August 17th, 2009 by EZ linux · No Comments
service iptables start
service iptables stop
service iptables restart
Tags: Linux Commands · Linux Security
Iframe gariben hack removergariben
August 17th, 2009 by EZ linux · No Comments
iframe / gariben hack find and removers. iframe / gariben is a script kiddie code added usually via a cracked password or hidden mysql code added to a vulnerable script. I usually refreshes the web page to some sort of web page that downloads a virus.
1.
find /home/username \( -name “*.php” -o -name “*.html” -o -iname [...]
Tags: Linux Commands · Linux Security · Linux Software / Scripts
Install CSF on Cpanel
August 17th, 2009 by EZ linux · 1 Comment
Remove any old versions: rm -fv csf.tgz
Download and install:
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
To disable run this from root:
sh disable_apf_bfd.sh
To update from root run this:
/usr/sbin/csf -u
To flush all blocks run this:
/usr/sbin/csf -f
Usage: /usr/sbin/csf [option] [value]
Option Meaning
-h, –help [...]
Tags: Cpanel and WHM · Linux Commands · Linux Security · Linux Software / Scripts
SSH server to server
August 17th, 2009 by EZ linux · No Comments
ssh -l root 12.123.123.12
Tags: Linux Commands
