Just to post a few commands that you can use that may help some of you. I will better organize them when I can.
Apache Start
/etc/init.d/httpd stop
/etc/init.d/httpd start
/etc/init.d/httpd restart
APF Firewall
/usr/local/sbin/apf -r
nano /etc/apf/allow_hosts.rules
nano /etc/apf/deny_hosts.rules
nano /etc/apf/conf.apf
nano /etc/apf/ad/conf.antidos
/usr/local/sbin/apf -f
/etc/apf -d
Backup Linux TMP Files
cp -Rp /tmp /tmp_backup
Backup using cPanel
/scripts/cpbackup
Relace blackhole and aliases
replace :blackhole: :fail: -- /etc/valiases/*
replace '/dev/null' ':fail:' -- /etc/valiases/*
Broadcast Message
wall [message]
CGI Fix
In order to CGI's work properly on your server for any account, you will have to add an entry as ScriptAlias under those accounts. Add in /usr/local/apache/conf/httpd.conf
Change server password
/root/.my.cnf
Check Drives
df -h
Check Messages
grep -i memory /var/log/messages
Hostname
/etc/sysconfig/network
Check Open Ports
nmap -sT -O localhost
Chown
chown -R username:username /home/username/public_html/directory/
Ports
/etc/services
cPanel restart
/etc/init.d/cpanel restart
SSH MySQL command for adding data
mysql -u petfel -p petfel_nuke < /home/petfel/public_html/petfel_nuke.sql
****petfel is the username example nuke.sql is the name of the example database. Make sure you upload your sql to your public_html directory. Keep all in one line.
DDOS Check
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
Dictionary Attack
grep "dictionary attack" /var/log/exim_mainlog
Find Large files
find /home -size +100000k
Disable Root Logins
/etc/ssh/sshd_config
Force cPanel Update
/scripts/upcp --force
Find Pid
/usr/sbin/lsof | grep add Pid number here
Kill Pid
kill -9 add pid number here
Locate large logs
/scripts/biglogcheck -v
Locate cPanel Users
/var/cpanel/users
More Commands in Finding Domains & Users
/var/named/
/etc/named.conf
/usr/local/apache/conf/httpd.conf
/etc/localdomains
/etc/userdomains
/etc/valiases/
/etc/vdomainaliases
Locate User Cron Jobs
cd /var/spool/cron
Locate User Aliases
/etc/valiases/
Rotate Logs
/usr/sbin/logrotate -vf /etc/logrotate.conf
Lsof TMP
lsof | grep /tmp
Mail Logs
/var/log/maillog
Optimize all MySQL Databases On The Server
mysqlcheck -o -u root -p --all-databases
Show Process
ps axuf
Shutdown Fix Now
/sbin/shutdown -rF now
Start Name and fix name
/scripts/fixndc
/etc/init.d/named stop
/etc/init.d/named start
Restart Cron
service crond restart
Tail error messages
tail -f /var/log/messages
Tar Command
tar -xvzf
Who has been on the server
who /var/log/wtmp
Find out what is happening on your server
/usr/bin/w
/usr/bin/top
Find out who is logged on - Make sure this is blocked at the firewall!!
/usr/bin/finger
Find out information about your server
/bin/uname -a
/sbin/ipconfig
List contents of a directory
/bin/ls
/bin/ls -a list all files including hidden
/bin/ls -l list files showing their attributes
/bin/ls -lla list all files showing their attribute
L (list)
mv (move)
cd (change directory)
uptime - How long since you're last reboot
For Red Hat and CentOS:
service httpd stop
service httpd start
service httpd restart
Also to copy
cp srcdirectory destinationdirectory

LinkBack URL
About LinkBacks









Reply With Quote



Bookmarks