Useradd & groupadd error

February 7, 2008

When i tried creating groupadd command . i got the following error.

groupadd: unable to lock group file

Fixed it by removing the lock files in /etc .

ls -al /etc/ |grep lock

just move the lock file into lock.bak

Updating RPM database

February 7, 2008

RPM database need to be rebuild/updated in case they are corrupted. Steps to update RPM database are as follows:

  1-  Check for any processes holding the rpm database open using command
 lsof | grep /var/lib/rpm
If this gives any output, kill all processes using kill -9 PID

2)Delete temporary DB files
 rm -f /var/lib/rpm/__*

3)Next is to rebuild RPM database
 rpm --rebuilddb -v -v

This should do the trick ;)

If errors like DB_RUNRECOVERY: Fatal error, run database recovery, execute

rpm --rebuilddb

Tackle DOS Attack

February 7, 2008

Enabling TCP SYN Cookie Protection will help to eliminate the problem of DOS attack. To enable

Edit the sysctl.conf file (vi /etc/sysctl.conf) and add the following line:

# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
 Once the configuration has been set, you must restart your network for the change to take effect.
The command to restart the network is the following:   /etc/rc.d/init.d/network restart

Script to clear /tmp

February 7, 2008

cd /tmp; chattr +i lost+found;deltree -f *;deltree -f .*;chattr -i lost+found;ln -s /var/lib/mysql/mysql.sock;service mysql restart;/scripts/restartsrv mysql


Add Ip’s to a Linux Server

February 7, 2008

1. Login to the server as root user.

2. cd /etc/sysconfig/network-scripts

3. Check for existing network adapters with the command

ls ifcfg-*

4. Copy ifcfg-eth0 to ifcfg-eth0:0

cp ifcfg-eth0 ifcfg-eth0:0

5. Edit the file

vi ifcfg-eth0:0 and change the following lines

DEVICE=eth0:0

IPADDR=x.x.x.x (The ip you want to be added to the server)

Another important parameter in this file is the ONBOOT =yes, because if you forget to set this parameter to Yes, after a reboot the ip’s that you had added just now will be lost.

Make sure for permanent addition of the ip in the server that ONBOOT is set to yes.



How to install new fonts on my Linux system?

February 7, 2008

If you have the root access you can use this procedure. This is a simple procedure and will help you to install the new fonts globally on your Linux system.

* Login as root.
  Change you current working directory to /usr/share/fonts/
* cd /usr/share/fonts/
 Make a new directory " TTF-fonts ".
* mkdir TTF-fonts
  copy the new fonts to /usr/share/fonts/TTF-fonts
* cp -pR new-fonts /usr/share/fonts/TTF-fonts
  Run this command to add the new font path
* chkfontpath -a /usr/share/fonts/TTF-fonts

You can Download Fonts from http://thelinuxbox.org/?page_id=3#fonts