RSS

Nice Cacti Install How To

0 Comments | This entry was posted on Apr 21 2009

RedHat / CentOS Install and Configure Cacti Network Graphing Tool

Reset file permissions of RPM packages

0 Comments | This entry was posted on Apr 16 2009
Unlimited Online backup for 4.95/month

A disastrous mistake anyone can make on their Linux server is to chown or chmod their entire filesystem.

You can reset the permissions of packages installed with rpm.

To reset file permissions:

root@empulse:$ rpm --setperms {packagename}

To reset ownership permissions:

root@empulse:$ rpm --setugids {packagename}

Security Articles

0 Comments | This entry was posted on Apr 05 2009

Hacking-Gurus: Network and Server Security Blog really has some useful information documented.  Check out these articles.

Basic Linux Server Security

Linux Security Tools


SQL CheatSheet


SQL Injection article

0 Comments | This entry was posted on Apr 05 2009
Go Daddy $7.49 .com domains 468x60

This is an article I found on Twitter from Hacking-Gurus on SQL injection. Check it out.

MySQL: Secure Web Apps – SQL Injection techniques

One-Liners

0 Comments | This entry was posted on Apr 04 2009

Search for multiple processes in one command. Example in using multiple variables.

root@empulse:$ ps auxf | grep -P '(wincompd:|proftpd:)'

Lower the reserved disk space to 0%. By default Linux will reserve 5% of each file system as reserve free disk space.

root@empulse:$ tune2fs -m 0 /dev/hda5 remove reserved space

Compare two files on two remote file systems. I saw this on Command-line-fu.

root@empulse:$ diff <(ssh alice cat /etc/apt/sources.list) <(ssh bob cat /etc/apt/sources.list)

Frequently used Linux one-liners

0 Comments | This entry was posted on Mar 30 2009

I just submitted a couple of one-liners that I frequently use to Command-line-Fu.

Find brute force attempts on SSHd – Searches the /var/log/secure log file for Failed and/or invalid user log in attempts.
root@empulse:$ cat /var/log/secure | grep sshd | grep Failed | sed 's/invalid//' | sed 's/user//' | awk '{print $11}' | sort | uniq -c | sort -n


List SMTP connections by host – Searches /var/log/secure for smtp connections then lists these by number of connections made and hosts.
root@empulse:$ cat /var/log/secure | grep smtp | awk '{print $9}' | cut -f2 -d= | sort | uniq -c | sort -n | tail

Command-line-Fu

0 Comments | This entry was posted on Mar 29 2009
GoDaddy.com Hosting & Servers

If you haven’t seen this site you need to check it out. Command-line-Fu is running list of submitted Linux one-liner commands.  Some of these are really cool and you can of course submit your own for peer review.

Here are a couple of examples you may find.

Update twitter via curl

username@computername:$ curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml

List of commands you use most often

username@computername:$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head

Linux Security Quick Reference Guide

0 Comments | This entry was posted on Mar 29 2009

I just found this quick reference sheet on Linux security topics from Apache and DNS security to  crucial system files, tcp wrappers, and configuring syslog. This document from LinuxSecurity.com is available as a pdf download is provided below.

Linux Security Quick Reference Guide (pdf)

Excerpt: “Regularly audit your systems for any unauthorized and unnecessary use of the setuid or setgid permissions.”

Quick tip: Find all setuid and setgid programs

root# find / -type f -perm +6000 -ls

More Tech Notes

0 Comments | This entry was posted on Oct 29 2008

I just created linux.empulsegroup.com to place my Voodoo pad notes. I touch on the various Linux topics that I see on a day to day basis. This includes Apache, MySQL, mail services, and my notes to study for the RHCE exam which I recently received.

http://linux.empulsegroup.com

RPM Database Corruption

1 Comment | This entry was posted on Apr 03 2008

So I recently came across a situation where rpm would just hang or give out transaction errors. It turns out that the database cache files became corrupt. Here is an example of one of the errors:

warning: waiting for transaction lock on /var/lock/rpm/transaction

# cd /var/lib/rpm

Look for the files that start with double underscores “__”. These are the cache files, and you will want to delete all of them.

# rpm __*

# rpm –rebuilddb