Tripwire

Saturday, June 30, 2012

Open Source Tripwire® software is a security and data integrity tool useful for monitoring and alerting on specific file change(s) on a range of systems.

1) Download tripwire latest stable version from:
http://sourceforge.net/project/showfiles.php?group_id=3130

2) tar –xvf tripwire-2.4.1.2-src.tar

3) cd tripwire-2.4.1.2-src

4) ./configure --prefix=/usr/local/

5) make & make install

6) During installation it will ask for pass phrase, you can give it anything like ‘vmdfJH789zxnm’ more than 8 Characters

7) To test >> /usr/local/sbin/tripwire --test --email emailaddress@yahoo.com, you will receive an email from Tripwire. 
Continue Reading...

HotSaNIC


HotSaNIC is a very nice tool which combines all sorts of very important system graphs into a simple and easy to understand webpage. It allows the admin to take a quick glance at the graphs to see what may or may not be working with the system. With the new APPS graph it is also possible to watch as more processes are started which can be helpful in tracking down why the server load is increasing. For instance if you see a huge load spike but you see that the number of exim processes has gone up significantly at the same time you can start to investigate. It also just provides nice graphs to look at.

I built this guide on a cPanel server but it will work fine on an ensim box as well. I don't recall the plesk mailserver off the top of my head but changing that small part will make it work great fine plesk. This guide is also posted on my website.

First, we will need to install RRDtool

-----command-----
cd /usr/local/src/
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.48.tar.gz
tar -zxvf rrdtool-1.0.48.tar.gz
cd rrdtool-1.0.48
./configure
make
make install
make site-perl-install
cd ..
-----------------

Now we will install and configure HotSaNIC

-----command-----
cd /usr/local
wget http://downloads.sourceforge.net/hotsanic/hotsanic-0.5.0-pre5.tgz?modtime=1078012800&big_mirror=0
tar -zxf hotsanic-0.5.0-pre5.tgz
cd HotSaNIC
./setup.pl
-----------------


-----command-----

You will be asked a number of questions during the install script.

Module found: APCUSV Do you want to use this module?
Choose 'n'

Module found: APPS Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: BIND Do you want to use this module?
Choose 'n'

Module found: DISKIO Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: DNET Do you want to use this module?
Choose 'n'

Module found: MAILQ Do you want to use this module?
Choose 'n' (they only support postfix right now)

Module found: NETSTAT Do you want to use this module?
Choose 'n'

Module found: NETWORKS Do you want to use this module?
Choose 'n'

Module found: PART Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: SENSORS Do you want to use this module?
Choose 'n'

Module found: SHOUTCAST' Do you want to use this module?
Choose 'n'

Module found: SYSTEM Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: TRAFFIC Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: WORMS Do you want to use this module?
Choose 'n'

Found: eth0 - (y)es or (n)o
Choose 'y' (If you are prompted for any other interfaces starting with 'eth0' choose 'n')

Found: lo - (y)es or (n)o
Choose 'n'

0 /usr/local/cpanel/bin/rrdtoolinstall
1 /usr/local/cpanel/bin/rrdtoolcheck
2 /usr/local/cpanel/3rdparty/bin
by just pressing ´ENTER´, item "0" will be selected.
select item 0 ... 2? >

Select 0, we are going to change this below anyways.

You are now back at the command prompt. (If it asks you more questions, just accept the default answers.. we are using these settings below....)

Now we are going to start the manual configuration of hotsanic.


-----command-----
cd /usr/local/HotSaNIC/var/settings
vi main
-------------------

-----command-----

press [ctrl -w] then type 'binpath' then press [enter]. Find and change this line.

BINPATH="not configured"

change to

BINPATH="/usr/local/rrdtool-1.0.49/bin"

press [ctrl -w] again then type 'webdir' then press [enter]. Find and change this line.

WEBDIR="not configured"

change to

WEBDIR="/home/username/public_html/stats/"
Note you are going to put this to someplace that is acessible to the internet. I would recommend setting it to a subdomain or a directory within a domain.

press [ctrl -w] again then type 'ctime' then press [enter]. Find and change this line.

CTIME="24"

change to

CTIME="4"

press [ctrl -w] again then type 'convertpath' then press [enter]. Find and change this line. If may already be changed, if so do not worry.

CONVERTPATH="not configured"

change to

CONVERTPATH="/usr/bin/convert"

Finally, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

pico mod-traffic

Find and change this line:

SWAPIO="no"

change to

SWAPIO="yes"

Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

pico -w mod_system

Go to the bottom and where you see all the IRQ= lines that are not commented out simply delete them.

Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.


-----command-----
cat /proc/stat |grep disk_io
-----command-----
Edit the disk_io config file

-----command-----
pico -w mod_diskio
-----command-----

At the bottom add:

DEV=8_0,sda
DEV=8_1,sda

If your system has something other then the (8,0) and (8,1) as listed above make sure to put that in the config above. Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

-----command-----
pico -w mod_apps
-----command-----

This mod is going to allow you to track how many of a given service is running. I would say that apache, mysql, and email are the most important. Note that exim is what cPanel uses, if you are using ensim replace it with sendmail. Add the following to the bottom:

APP=httpd,Apache
APP=mysqld,Mysql
APP=exim,Exim

Again, to save and exit press [ctrl -x] Y then [enter]. Note that below when you make the directory it needs to be what you put in the configuration file above. At the prompt type.


-----command-----
cd /usr/local/HotSaNIC
mkdir /home/username/public_html/stats
./rrdgraph start
./makeindex.pl
./diagrams.pl
./convert.pl
-----command-----

You now have HotSaNIC installed

To view HotSaNIC go to http://yourIPaddress/stats/

(it will take a few mins for the graphs to generate data.

Now, Lets set HotSaNIC up so it will start when you reboot your server.

-----command-----
pico /etc/rc.local
-----command-----
Continue Reading...

16 Cool Ubuntu Tips For Linux Users


Yesterday, I wrote about books that beginners can download and read to teach themselves Linux. Today in the Linux section we have something for the power users. Here are a few tips you should try out if you are an avid Ubuntu Linux user:



1. Get lightning fast and clever at the command line

You can use keyboard shortcuts and other command line tricks to make entering commands easier and faster. You might already know about the ‘tab’ key which completes partial commands and even file and directory names.

Here are some other keyboard shortcuts you can use within terminal:
Ctrl-aMove to the start of the line.
Ctrl-eMove to the end of the line.
Alt-] xMoves the cursor forward to the next occurrence of x.
Alt-Ctrl-] xMoves the cursor backwards to the previous occurrence of x.
Ctrl-uDelete from the cursor to the beginning of the line.
Ctrl-kDelete from the cursor to the end of the line.
Ctrl-wDelete from the cursor to the start of the word.
Ctrl-yPastes text from the clipboard.
Ctrl-lClear the screen leaving the current line at the top of the screen.
Ctrl-x Ctrl-uUndo the last changes. Ctrl-_
Alt-rUndo all changes to the line.
Alt-Ctrl-eExpand command line.
Ctrl-rIncremental reverse search of history.
Alt-pNon-incremental reverse search of history.
!!Execute last command in history
!abcExecute last command in history beginning with abc
!nExecute nth command in history
^abc^xyzReplace first occurrence of abc with xyz in last command and execute it

2. Launch Ubuntu Linux Applications with keyboard

There are two ways you can achieve this:
  • Use applications like Launchy or Gnome-Do that make it easier to launch applications by typing a few characters of the application’s name.
  •  Or you can summon gconf editor (Alt+F2 then type gconf-editor and hit enter), and navigate to apps > metacity > global_keybindings, double click on any of the run_command_N and type in the keyboard shortcut you want to assign to an application then make a mental note of the number N. Then go to apps > metacity > keybinding_commands and double click on command_N (N being the number you used above) and type in the command you want to run. As an example if you wanted to run Firefox you would type in firefox.


3. Start from wherever you left off

You can make Ubuntu remember the applications you had open when you last logged out, so that when you log back in again you’ll find all those applications running and you can resume right from where you left off.

To achieve this go to System > Preferences > Startup Applications, then go to the options tab and check "Automatically remember running applications when logging out"

4. Create a Separate Ubuntu Linux Home Partition

New versions of Ubuntu arrive every 6 months. Although you can upgrade to the latest version via the update manager, sometimes the upgrade doesn’t work as expected so some users like to do a fresh clean install.

The disadvantage with that of course is that you lose data you had in your home directory. To overcome this you can create a separate Home partition when you are installing Ubuntu, size it according to your requirements and then when you decide to install Ubuntu the next time, simply specify this partition as the Home partition (by choosing /home as the mount point).

All your files and data on the Home partition will be preserved even after a fresh install.

5. Update and Install Ubuntu Linux Software Without Internet Connection
There are lots of way to do this, the easiest of all is to use APTonCD. APTonCD allows you to create CDs and DVD’s containing all the packages you want, which you can then use to install software on computers without an internet connection.

Note that APTonCD requires you to have an internet connection (or downloaded packages) to create the installed media. However once the media is ready you don’t need an internet connection for any of the machines you want to install the software on. Insert the appropriate CD/DVD and use apt-get as you would normally.

6. Install new fonts, Microsoft fonts and improve font rendering

Ubuntu doesn’t offer many choices when it comes to the fonts. However you can easily install new fonts including those from Microsoft like Arial, Verdana, impact and many more. You can use different sites to find the kind of font you are looking for.
7. Use PPAs, Install latest versions of software

There are a lot of steps that a software has to go through before it becomes part of Ubuntu or becomes available through the Ubuntu repositories. While all those steps lend additional stability, it generally means that you don’t get the latest versions of all the software as soon as they are released.

If you like to stay on the cutting edge, you can search for Personal Package Archives for your favorite software on Launchpad and add those to your installation’s software sources. I briefly touched on PPAs and how to use them here. If that seems like too much work, you can also download the latest deb packages and install them by double clicking (you won’t get automatic updates for the software if you install it this way).

Remember you might get into an occasional trouble or two with the latest versions, but mostly it wouldn’t be catastrophic. You can always hop over to the Ubuntu Forums to get quick help.

8. Be the root

The root account is disabled by default on Ubuntu installations, mainly to prevent you from doing something you didn’t intend to do. However if you "promise to be careful" you can enable root account as follows:

1. Type sudo passwd root and provide a root password.
2. Then head on over to System > Administration > Login Window, go to the Security tab and check "Enable local system administrator login"

You should now be able to login as root from the Login prompt. As an alternative you can use "sudo su" to provide your password and get root prompt.

9. Run Windows applications and games

Who wouldn’t like to play Counter Strike on Ubuntu (unless of course you are completely not into it) or perhaps even run Photoshop?

10. Shorten boot time with profiling

Ubuntu Linux devs have done a great job with the boot time, Jaunty is fast and Karmic is slotted to be even faster. There is however a bit more you can do by profiling your boot. Profiling lets Ubuntu make a list of all the files that are accessed during bootup, it then sorts the files according to how they are stored on your hard disk. So the next time the system is booted, the files would be read faster.

To profile boot you need to follow these steps

    * At the grub menu highlight the kernel you boot most often.
    * Press e for edit.
    * Choose the line starting with kernel and press e again. Now add the word profile to the end of this line. Hit Enter and then press b to boot

Note that while profiling, the system will boot slower this one time, the next time however you should see an improvement. Also keep in mind that all this is machine-dependent and also depends on the arrangement of files on your hard disk, so the difference you see might not be huge, or even nil in some cases.

11. Try out different Ubuntu Linux Desktop Environments and Desktop Managers

If you are looking for something different than the default Gnome interface, you should check out alternative desktop managers that you can use. If it is a complete Desktop Environment you are looking for, KDE4 has come a long way and is now impressively usable and fun. You can do a "sudo apt-get install kubuntu-desktop" to get KDE.

12. Create a media center or a media server

It would be great if you could easily browse and manage your huge collection of music, videos and pictures. Mesmerized by Windows Media Center’s slick interface? Wait till you see what all cool options you have to turn your Ubuntu system into a media center. You can even access your media collection on your phone, PSP or a different computer if you set up a media server on your Ubuntu machine.

13. Share Firefox profile data with Windows

Many people use Windows and Linux on the same machine. If you are one of them, there would have been times you couldn’t find that bookmark you created or password you stored when you were using Firefox from within Windows. For different computers you can of course use Weave.

14. Customize Nautilus to your liking

Nautilus is the default file manager on Ubuntu. While you may be content with what it does, there is lots more you can make it do. You can use extensions to improve functionality and even add custom functionality to Nautilus

15. Compile your own Kernel

If you can’t find something to keep you busy for the weekend and you have your customization hat on, how about building a kernel to specifically meet your requirements? This is frankly more of a learning experience. Some might say that it enables you to use just the features and drivers you require, but if everything is working fine with the kernel supplied and you don’t have any interest in the Linux kernel, skip ahead this one is not for you.

If however you require some of the experimental features of the kernel, or need it to be compiled in some other special way we say you check out this guide within Ubuntu Documentation.

16. Change Usplash Screen and create a custom splash screen for GRUB
So you didn’t count the last one? Here is another one then. A Usplash screen is Ubuntu text and a logo with a progress bar that you see when you boot up Ubuntu.

If you would like to change that to something more interesting follow these steps. What better way to show your Linux fu than customizing the very first screen that appears? You can create a custom splash screen using one of your photos, GIMP and a little tweaking. Here is the how-to.

Continue Reading...



Looking to for a place to download Linux for free? You have come to the right place! 

BEGINNER

For beginners to Linux, there are several different easy to use and easy to install distributions. Here are our recommendations for getting started with Linux.

Ubuntu Linux is a complete desktop Linux operating system, freely available with both community and professional support. The Ubuntu community is built on the ideas enshrined in the Ubuntu Manifesto: that software should be available free of charge, that software tools should be usable by people in their local language and despite any disabilities, and that people should have the freedom to customise and alter their software in whatever way they see fit. "Ubuntu" is an ancient African word, meaning "humanity to others". The Ubuntu Linux distribution brings the spirit of Ubuntu to the software world.
You can download it for free here.

Mandriva Linux (formerly Mandrakelinux), is a user-friendly distribution with enormous community support. It is easy to install and the hardware detection features and disk partitioning programs are often considered the best in the industry. Mandriva Linux offers all the power of Linux for the beginner in an easy-to-use and pleasant environment. Join those who are discovering Linux as a complete replacement for their previous operating system.
Free download here.

LIVE
For those who wish to try Linux without having to install it on their hard drive, there exists a number of LIVE CD distributions. They boot directly from the CD and don't install anything on the hard disk. Boot up time is of course slower than with a hard disk, but it is a great way to experiment with Linux.

 Knoppix is a bootable Linux CD with great automatic hardware detection (including support for many graphics cards, sound cards, SCSI and USB devices) Knoppix can be used as a Linux demo, educational CD or as a rescue system. It has on-the-fly decompression, which means that the CD can have up to 2 GB of executable software installed on it.
Download Knoppix for free.



MEPIS MEPIS Linux is a user-friendly operating system based on Debian Stable that "just works". It runs from your CD/DVD or USB drive so you can use it on your Windows or Mac machines without installing.
MEPIS comes with much of the software most users need, and hundreds of additional open-source programs are just a click away
Download your free copy of Mepis here.

SERVER

CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public by Red Hat, in other words CentOS is a clone of RHEL. However CentOS conforms fully with the Red Hat's redistribution policy and aims to be 100% binary compatible. CentOS is free.
You can get CentOS here.

Another great server version of Linux is Ubuntu Server. Ubuntu Server includes what is needed to provide a service, nothing more. This lean, efficient architecture sees more services delivered with less computing power and less resources required. Ubuntu Server is provided free of licensing and subscription fees. The Ubuntu security team provides vital maintenance and security updates for free.
Get Ubuntu Server here.


ADVANCED

For the advanced user there are a number of sophisticated distributions which work well on the desktop and as a server. Here our the Hungry Pengiun's choices...

Fedora Mention the word "Linux" and many people will think of the name Red Hat. It is probably the best-known Linux company in the world. In 2003, Red Hat Linux 9 became the last version in the Red Hat Linux product line, however it was was replaced by Fedora a Red Hat sponsored distribution of Linux. Much what goes into Fedora makes its way into Red Hat's enterprise Linux products.
Download this widley used distribution for free from the Fedora site.

SUSE Linux is a distribution with a desktop focus. It is easy to use and there is a professional attention to detail. Recently SUSE (now a Novell company) followed Red Hat in making its distribution more community focused. The openSUSE project is a community program sponsored by Novell (http://www.novell.com). Promoting the use of Linux everywhere, openSUSE.org provides free, easy access to the world's most usable Linux distribution, SUSE Linux. The openSUSE project gives Linux developers and enthusiasts everything they need to get started with Linux.
You can get it from their site

MINI
Along with the full blown LIVE CDs like Knoppix and MEPIS there is a collection of mini distirbutions who truly believe that small is beautful.

  Damn Small Linux, a.k.a. DSL is a very versatile 50MB mini desktop oriented Linux distribution. Despite its minuscule size it strives to have a functional and easy to use desktop. DSL include XMMS (for MP3), an FTP client, a web browser, a spreadsheet, an email client, a word-processor and much more. If you like Damn Small Linux you can install it on your hard drive. Because all the applications are small and light it makes a very good choice for older hardware.
Get DSL here

Feather Linux is a Linux distribution which runs completely off a CD or a USB pendrive and takes up under 115Mb of space. It is a Knoppix remaster (based on Debian), and tries to include software which most people would use every day on their desktop.
Download it for free.



Continue Reading...