Posts

Showing posts from December, 2010

Netstat Command

Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc., In this article, let us review 10 practical unix netstat command examples. 1. List All Ports (both listening and non listening ports) List all ports using netstat -a # netstat -a | more Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:30037 *:* LISTEN udp 0 0 *:bootpc *:* Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 6135 /tmp/.X11-unix/X0 unix 2 [ ACC ] STREAM LISTENING 5140 /var/run/acpid.socket List all tcp ports using netstat -at # netstat -at Active Internet conn...

Backup Remote Linux Host Using rsnapshot rsync Utility

1. Setup Key Based Authentication As we’ve explained earlier setup the key based authentication as explained either in ssh-keygen and ssh-copy-id article or openSSH article. [root@local-host]# ssh-keygen [root@local-host]# ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host 2. Verify the password less login between servers Login to the remote-host from local-host without entering the password. [root@local-host]# ssh remote-host Last login: Sun Mar 15 16:45:40 2009 from local-host [root@remote-host]# 3. Configure rsnapshot and specify Remote Host Backup Directories Define your remote-host destination backup directories in /etc/rsnapshot.conf as shown below. In this example, root@remote-host:/etc – Source directory on the remote-host that should be backed-up. i.e remote backup destination directory. remote-host-backup/ – destination directory where the backup of the remote-host will be stored. Please note that this directory will be created under local-host /.snapshots/{internal.n}/...

Backup Local Unix Host Using rsnapshot rsync Utility.

rsnapshot is an awesome free Linux backup utility to perform rsync backup of both local and remote file system. This is a series of two articles. In this article, let us review how to install and configure rsnapshot utility to take rsync backup of local file system. In next article, let us review how to setup rsnapshot utility to take rsync backup of remote file system. rsnapshot uses the combination of rsync and hard links to maintain full-backup and incremental backups. Once you’ve setup and configured rsnapshot, there is absolutely no maintenance involved in it. rsnapshot will automatically take care of deleting and rotating the old backups. It also takes very less disk space. The first full backup will take the same size as your original files and directories. Subsequent rsnapshot full backups takes only less space, as it takes backup of only the modified files from the previous full backup. 1. Download rsnapshot Linux Backup Utility Download the rsnapshot utility from rsn...

Back up Linux using dd command

Data loss will be costly. At the very least, critical data loss will have a financial impact on companies of all sizes. In some cases, it can cost your job. I’ve seen cases where sysadmins learned this in the hard way. There are several ways to backup a Linux system, including rsync and rsnapshot . This article provides 6 practical examples on using dd command to backup the Linux system. dd is a powerful UNIX utility, which is used by the Linux kernel makefiles to make boot images. It can also be used to copy data. Only superuser can execute dd command. Warning: While using dd command, if you are not careful, and if you don’t know what you are doing, you will lose your data! Example 1. Backup Entire Harddisk To backup an entire copy of a hard disk to another hard disk connected to the same system, execute the dd command as shown below. In this dd command example, the UNIX device name of the source hard disk is /dev/hda, and device name of the target hard disk is /dev/hdb....

Useful Linux Files.

• /boot/vmlinuz - the typical location and name of the Linux kernel. In the Slackware distribution, the kernel is located at /vmlinuz. • /dev/fd0 - first floppy disk drive • /dev/fd0H1440 - driver for the first floppy drive in high density mode. Generally, this is invoked when formatting a floppy drive for a particular density. Slackware comes with drivers that allow for formatting a 3.5" diskette with up to 1.7MB of space. Red Hat and Mandrake do not contain these device driver files by default. • /dev/fd1 - second floppy disk drive • /dev/hda - first IDE hard drive • /dev/hdc - on many machines, the IDE cdrom drive. Most often, there is a symbolic link called /dev/cdrom which is just a link to the true cdrom driver file. • /dev/null - used when you want to send output into oblivion  • /etc/aliases - file containing aliases used by sendmail and other MTAs (mail transport agents). After updating this file, it is necessary to run the newaliases utility for th...

User Administration

In Linux there are three type of users. 1. Super user or root user Super user or the root user is the most powerful user. He is the administrator user. 2. System users System users are the users created by the softwares or applications. For example if we install Apache it will create a user apache. This kind of users are known as system users. 3. Normal users Normal users are the users created by root user. They are normal users like John, Ramu etc. Only the root user has the permission to create or remove a user. In linux systems every user will have a unique user ID. It is known as UID. The Range of UIDs will be as follows: 1. Root user          UID will be "0" 2. Systems users      UID will be "1 - 499" 3. Normal users       UID will be "500 - 60000" The range of MIN_GID and MAX_GID is specified in the file  "/etc/login.defs". ######### There are three im...