Posts

Linux Interview Questions: Experienced

1) How to implement Squid proxy ? 2) How to see bandwidth used by ftp user? 3)H ow to implement Squid as reverse proxy ? 4) How to see logs of Squid proxy ? /var/log/squid/access.log : You can use this file to find out who is using squid server and what they are doing etc /var/log/squid/cache.log : The cache.log file contains the debug and error messages that Squid generates. If you start your Squid using the default RunCache script, or start it with the -s command line option, a copy of certain messages will go into your syslog facilities. /var/log/squid/store.log : The store.log file covers the objects currently kept on disk or removed ones. As a kind of transaction log it is ususally used for debugging purposes. 5) How to see cache in Squid proxy ? 6) How to clear Cache in Squid proxy? Ans.: just stop squid, and erase all the files in your cache directory... for example: Code: squid -k shutdown rm -fr /var/lib/squid/cache/* then re-create the swap dir...

LINUX INTERVIEW QUESTIONS : FTP

LINUX INTERVIEW QUESTIONS : FTP 1)What is the difference between TFTP and FTP servers? A) Both are file transfer servers but slight difference is TFTP server uses UDP protocol and FTP uses TCP protocol. TFTP is good for slow connection paths. 2)What is the port no for FTP? A)20 for Data and 21 for Control(normally when an interviewer ask's ftp port number just say 21. 3)What is the port no for TFTP? A) 69. 4) How to restrict users to their home directories? A) By setting up "chroot_local_user=YES". 5)How to restrict total number of users accessing FTP server? A1) If Vsftpd is running under xinted service, then you can use xineted to get per-service per IP connection limits or A2) If you run vsftpd in "standalone" mode with the "setting listen=YES" , then you can investigate the setting (e.g.) : "max_clients=10" 6)I want to copy multiple files with out prompting for any info, how can I do that one? A) Simply do ...

How To Install YUM Server In Redhat(RHEL5)

In linux you can install packages through many ways like. 1. Through RPM, 2. Through shell script 3. Through source tar balls etc. YUM (Yellow-dog Updater and Modifier) is another and advanced way of installing the packages in Linux distros such as Red-hat, Fedora . In RHEL4 installing packages is a tedious process, some times its headache to install all the dependencies. So Red-hat people come with a solution to overcome this problem in most situations, i.e. nothing but YUM implementation which will resolve this dependency issue . Here I am going to present some basic way how to use YUM utility to install packages locally(there are so many ways to install packages from different sources such as ftp, http etc). You can get the full details about YUM in my google docs here. One Two Three Four Five Six Seven Eight Nine Ten Basic YUM implementation locally: Step1 : Copy the entire OS cd's content to Hard-drive as below. #cp -ar /media/cdrom/* /destinationfo...

Some Interview Topics

If you are preparing for interviews for linux admin jobs you should be familiar with below concepts.. 1) Port number of different servers {cat /etc/services} 2) Linux Installation(through FTP,HTTP,NFS) 3) Boot process 4) Diff b/w ext3 and ext2 5) RAID LEVELS and Selection of raid 6) backup methods 7) Package management such as Yum server 8) Kernel Tuning 9) IPTABLES 10) TCP WRAPPERS 11) DIFFERENT RUN LEVELS 12) USER AND GROUP MANAGEMENT 13) QUOTA SETTING(user and group) 14) DIFF B/W CRON AND AT 15) BASIC SHELL SCRIPTING 16) Troubleshooting different issues. 17) Tell me why we should hire you? 18) DAILY ACTIVITES IN YOUR CURRENT COMPANY 19) RECENTLY SOLVED CRITICAL ISSUE 20) LVM (Very Imp) 21) vertias Volume manager 22) cluster basic like HAD , GAB , LLT , HEARTBEAT , CONFIG FILES , RESOURSE , SERVICE GROUPS etc 23 ) kernel panic troubleshooting 24) Process management 25)Configuration part of NFS , NIS , Samba , DHCP , DNS,Apache, Sendmail etc. 26)Remote admi...

RAID01 Vs RAID10

So what is the difference between RAID01 and RAID10 ? >>>>When we are dealing with RAID01 we are actually implementing RAID0 first then RAID1 on it. Ok little bit confused? Let me put it in this way RAID0 is nothing but stripeset writing of data and RAID1 is Mirring of data on to disks.For example lets take 8 disks, so first we are writing whole data on 4 disks then we are mirring it on to remaining disks. Where as in RAID10 we are first mirring disk and then striping data on mirrered disks In general RAID01 is "a mirrior of 2 strips" and RIAD10 is "a single strip on mirrered disks" So here one more question arises... which one is good? RAID10 is good, the difference is that the chance of system failure with two drive failures in a RAID 0+1 system with two sets of drives is (n/2)/(n - 1) where "n" is the total number of drives in the system. The chance of system failure in a RAID 1+0 system with two drives per mirror is 1/(...

Implementing RAID10 in Linux

RAID10 can be implemented by first implement RAID1(ie mirring) then implementing RAID0(stripeset on different disks) on it. Configuring RAID10 Step1:Get the info who many devices are participating, for example here we taken 4 disks(/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1). Step2:Implement RAID1 on four drives(taking 2 each) #mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]1 #mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd]1 Step3:Now implement RAID0 on two of RAID1 devices(/dev/md0,/dev/md1) #mdadm --create /dev/md2 --chunk=64 --level=0 --raid-devices=2 /dev/md[01] Step4:Format the RAID10 device with ext3 and mount the device #mke2fs -j /dev/md2 #mkdir /store #mount /dev/md2 /store Unconfiguring RAID10 Step1:Unmount the RAID device /dev/md2 #umount /dev/md2 or #umount /store Step2:Stop the RAID device #mdadm --manage /dev/md2 --stop #mdadm --manage /dev/md1 --stop #mdadm --manage /dev/md0 --stop Step3:Remove the Disks(/dev/sda1,/dev/sdb1,/dev/sdc1,/dev...

Configuring and Installing YUM server in RHEL4

If you are looking for YUM server in RHEL5 you can clickhere other wise just read on.. Recently I came across a strange issue.. ie implementing YUM(Yellow dog Updater and Modifier) server in RHEL4 :(. By the time of RHEL4 released there is no YUM server implementation.. so I did some research and collected some documentation on net and implemented YUM server in RHEL4 configuring YUM server in RHEL4 as follows.. Stpe1:Download following packages sqlite-2.8.16-1.2.el4.rf.i386.rpm python-sqlite-0.5.0-1.2.elr4.rf.i386.rpm python-urlgrabber-2.9.6-1.2.el4.rf.noaarch.rpm pytyhon-elementtree-1.26-1.2.el4.rf.noarch.rpm python-celementtree-1.0.2-1.2.el4.rf.i386.rpm yum-2.4.2-1.noarch.rpm yum-utils-0.3.1-1.fc4.noarch.rpm ( we need for repository) createrepo-0.3.1-1.noarch.rpm Stpe2: Install the above mention packages in the same sequence once you download them. rpm -Uvh sqlite-2.8.16-1.2.el4.rf.i386.rpm rpm -Uvh python-sqlite-0.5.0-1.2.elr4.rf.i386.rpm rpm -Uvh python-urlgrabber-2.9.6-1.2...

Rsync Command ::: All Linux Admin Should Know

Recently I came accross rsync utility ... Its an awesome command it is a sub service under xinetd along with some other services such as tftp, rcp, rsh, rlogin, telnet etc.. Let us list advantages of this command then we will know how to configure it. Advantages of rsync : This tool will keep both the destination and source folder synced. rsync is fast, because it will not copy entire data every time it got synced, it just copes the date which got changed from previous copy. For security reasons, rsync will support ssh to transfer data between two machines. rsync is used to download RPM updated repository to local machine. And lot more advantages are there.. please share your valuable experiences here. Configuration : rsync Some points to be remembered when dealing with rsync This utility is the part of xinetd so there is no special package for this. When we are doing rsync between two systems, both the systems should be configured to allow rsync connecti...

Creating Virtual File System in Linux

Can we create a file system (i.e. formatting a drive/partition) with in a file system? Looks little bit strange is int it? So follow me I will show you how to create a virtual partition and file system within a partition. Step1 : Create a empty file with /dev/zero with size equal to 50Mb . #dd if=/dev/zero of=/temp/vf0 count=102400 Note : 1. By default "dd" command( d ataset d efinition) uses block of 512bytes so the size will be 102400*512=52 428 800=~50MB 2. /dev/zero is a device files which will be used create a file which conations "0" i.e. an empty file. Clipped output: [root@test6 ~]# dd if=/dev/zero of=/temp/vf0 count=102400 102400+0 records in 102400+0 records out [root@test ~]# ls -lh /temp/vf0 -rw-r--r-- 1 root root 50M Nov 7 12:08 /temp/vf0 Step2 : Create ext3 file system for this virtual partition. #mkfs -t ext3 /temp/vf0 Here it will ask "do you want to format the file or not"? , just say yes. Step3 : Now we have to ...

Info Related MBR and Taking its Backup

1.How to take the backup and restore MBR? Why do you require to take the backup of your MBR? Ans : MBR (Master Boot Recorder) is a vital part of your hard disk which contains booting information, without it its difficult to boot the system. Suppose you have windows and Linux duel boot on your machine and as you know windows is more prone to virus attacks. So it’s always better to backup your MBR to be in safe place. 2. How to take backup of your MBR? Ans : Using dd command ( d ataset d efinition). Here are the steps to take backup of you MBR and keep it in safe place to restore your system if it get corrupted. #dd if=/dev/hdx of=/safe/location bs=512 count=1 Let me explain the above command how it will work. “If” in the command is nothing but to specify Input File, here we are specifying our input file as hard disk(if the hard disk is /dev/hda it is primary master, so for general purpose I given 'x' ). “of” in the command is nothing but to specify Output File, ...

Heartbeat Clustering

basics of Clustering, advantages of Clustering and configuration of simple fail-over Cluster . Let’s start. What is a Cluster any way? Ans : A computer cluster is a group of linked computers , working together closely so that in many respects they form a single computer. The components of a cluster are commonly, but not always, connected to each other through fast local area networks. Clusters are usually deployed to improve performance and/or availability over that of a single computer, while typically being much more cost-effective than single computers of comparable speed or availability – www.wikipedia.org . Cluster terminology. Node : It’s one of the system/computer which participates with other systems to form a Cluster. Heartbeat : This a pulse kind of single which is send from all the nodes at regular intervals using a UDP packet so that each system will come to know the status of availability of other node. It’s a kind of door knocking activity like pinging...

SVN_APACHE Repository Configuration

1.)Setting Up A Subversion Repository Using Apache, With Auto Updatable Working Copy: What is Subversion? Subversion is a free/open-source version control system. That is, Subversion manages files and directories over time. A tree of files is placed into a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to your files and directories. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of “time machine”. SVN has few methods to serve its users. Below are some examples: 1, SVN+SSH 2, SVN+Apache 3, SVNServe In this case we are using the Apache method. Apache should be running as an normal user, not nobody. I won't guide people how to install apache in this how to. Install subversion using yum #yum install subversion Apache Configuration : Edit the default configuration file,...

PXE(Preboot eXecution Environment) Installation and Configuration

Image
Red Hat Enterprise Linux supports network installation using the NFS, FTP, or HTTP protocols. A network installation can be started from a boot CD-ROM or Red Hat Enterprise Linux CD #1, a bootable flash memory drive. Alternatively, Pre-Execution Environment (PXE) can also be used to install RHEL, if the system to be installed contains a network interface card (NIC) with Pre-Execution Environment (PXE) support. How PXE works: The client's NIC with PXE support sends out a broadcast request for DHCP information and the DHCP server provides the client with an IP address, name server information, the hostname or IP address of the tftp server and the location of the installation files on the tftp server. Basic steps required for preparation of PXE server Configure the network (either NFS or FTP or  HTTP) server to export the installation tree. Configure the files on the tftp server necessary for PXE booting. ...