Archive for the 'General' Category

Create bootable USB drive with Fedora 10 live

How about having a linux bootable USB stick? You can insert that in to any PC, do the do without affecting settings of that PC at all. This is even more helpful for linux admins who find it hard to work on friend’s Windows PC instead of taking delicious dinner, after receiving an unrgent call from NOC Deptt.

Here are quick steps on CentOS 5.2 box (should be identical on any RH based distro):

1. Check whether required tools are already installed or not:

# rpm -q livecd
<no output>

2. Install tools:

Quickly change your ssh port from default 22 to something higher

In the era of daily brute force attacks, it is advisable to change your ssh port from default 22 to something higher, to lower your chances of being a victim.

I’m using CentOS 5.2 box here but the process should be identical in other RH based distros.

Step 1. Update /etc/ssh/sshd_config file, line 13 (it might be different in your file):

old line:
Port 22
Change it to:
Port 54545 # any port number you wish

if you rush and try to restart your ssh service, you may end with getting error:

# /etc/init.d/sshd restart
 Stopping sshd:                                             [  OK  ]
Starting sshd: /etc/ssh/sshd_config line 13: Badly formatted port number. [FAILED]

Change TimeZone in your Linux Server quickly:

In any Red Hat based (RHEL/CentOS/Fedora) Server, change time zone to PST/PDT quickly:

# mv /etc/localtime /etc/localtime.old && ln -s /usr/share/zoneinfo/PST8PDT /etc/localtime

or set zone to IST:
# mv /etc/localtime /etc/localtime.old && ln -s /usr/share/zoneinfo/Calcutta /etc/localtime

or Set the TZ environment variable for quick display time according to preferred Time Zone:
# export TZ=America/Los_Angeles
and then view the output of date command.

or If you have the utility rdate, update the current system time by executing
# rdate -s pool.ntp.org

or You can execute ‘system-config-date’ for setting up date/time and time zone:
# system-config-date

FTP Error: Could not write to socket: Broken pipe

By viewing this error while using your ftp server, you may get the impression of some bug/problem in your ftp server. This is exactly what happened in the early morning when I got call that vsftpd server in one of the Amazon EC2 server stopped working. When trying to transfer a file it’s showing something like this:

Error: Could not write to socket: Broken pipe
Unable to download file xxxx

In first, I checked the config of vsftpd, and restarted it. It’s working fine. Then got the clue from “unable to download file” messages which indicates that ftp server is not able to write/download file. When I checked the space:

Install and configure ejabberd jabber IM Server

ejabberd, as described in its home page:
” ejabberd is a distributed, fault-tolerant technology that allows the creation of large-scale instant messaging applications.The server can reliably support thousands of simultaneous users on a single node and has been designed to provide exceptional standards of fault tolerance. As an open source technology, based on industry-standards, ejabberd can be used to build bespoke solutions very cost effectively.”

Describing here Instructions I followed to install and configure ejabberd in CentOS 5:

Step 1. Download the current stable version of ejabberd from its official site. While writing this article the stable version was 2.0.6. I’ve download the binary file for 32 bit Linux machine and uncompress it: