0% found this document useful (0 votes)
2K views18 pages

Redhat-Interview Questions

This document contains interview questions for a Red Hat interview including questions about: - Creating a swap space in Linux - The sticky bit and how it is used on directories - SUID and GUID permissions - Different RAID levels like RAID 0, 1, 5 - Logical Volume Manager (LVM) and how to set it up - Different Linux installation methods like Kickstart, NFS, CDROM - Requirements and process for Kickstart and NFS-based installations - Setting up SSL on Apache
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views18 pages

Redhat-Interview Questions

This document contains interview questions for a Red Hat interview including questions about: - Creating a swap space in Linux - The sticky bit and how it is used on directories - SUID and GUID permissions - Different RAID levels like RAID 0, 1, 5 - Logical Volume Manager (LVM) and how to set it up - Different Linux installation methods like Kickstart, NFS, CDROM - Requirements and process for Kickstart and NFS-based installations - Setting up SSL on Apache
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 18

REDHAT INTERVIEW QUESTIONS- ROUND I - (45 minutes)

 How to make a Swap Space?


Type following command to create 512MB swap file (1024 * 512MB = 524288 block
size):
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
Set up a Linux swap area.
# mkswap /swapfile1
Activate /swapfile1 swap space immediately.
# swapon /swapfile1
To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file
using text editor such as vi:
# vi /etc/fstab
Append following line.
/swapfile1 swap swap defaults 0 0
How do I verify swap is activated or not
# free –m

 What is sticky bit?


The most common use of the sticky bit today is on directories. When the sticky bit is set,
only the item's owner, the directory's owner, or the superuser can rename or delete files.
Without the sticky bit set, any user with write and execute permissions for the directory can
rename or delete contained files, regardless of owner. Typically this is set on the /tmp directory
to prevent ordinary users from deleting or moving other users' files. This feature was
introduced in 4.3BSD in 1986 and today it is found in most modern Unix systems

The sticky bit can be set using the chmod command and can be set using its octal mode 1000
or by its symbol t (s is already used by the setuid bit).

For example, to add the bit on the directory /usr/local/tmp, one would type
chmod +t /usr/local/tmp or chmod 1777 /usr/local/tmp
$ ls -ld /tmp
drwxrwxrwt 4 root sys 485 Nov 10 06:01 /tmp

 What is SUID (Set user ID) and GUID?

The SUID permission causes a script to run as the user who is the owner of the script,
rather than the user who started it.

 Which file has SUID bit set for e.g?


 What are different RAID Levels e.g RAID 0, RAID 1, RAID 5.

RAID 0 – for stripping, RAID 1 – for mirroring, RAID 5- stripping + parity.
 Scenario Given: In a RAID-5 server setup there are 3 hard disks which about 250 GB
each what will the size of hard-disk that will be usable?
 What is Logical Volume Manager?
LVM is a tool for logical volume management which includes allocating disks,
striping, mirroring and resizing logical volumes.
With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes.
LVM physical volumes can be placed on other block devices which might span two or more
disks.
The physical volumes are combined into logical volumes, with the exception of the /boot/
partition. The /boot/ partition cannot be on a logical volume group because the boot loader
cannot read it. If the root (/) partition is on a logical volume, create a separate /boot/
partition which is not a part of a volume group.
Since a physical volume cannot span over multiple drives, to span over more than one drive,
create one or more physical volumes per drive.
 How do you setup LVM?

How to setup Linux LVM in 3 minutes at command line?

1. Login with root user ID and try to avoid using sudo command for simplicity reason.

2. Using the whole secondary hard disk for LVM partition:


fdisk /dev/hdb

At the Linux fdisk command prompt,


1. press n to create a new disk partition,
2. press p to create a primary disk partition,
3. press 1 to denote it as 1st disk partition,
4. press ENTER twice to accept the default of 1st and last cylinder – to convert the
whole secondary hard disk to a single disk partition,
5. press t (will automatically select the only partition – partition 1) to change the
default Linux partition type (0×83) to LVM partition type (0x8e),
6. press L to list all the currently supported partition type,
7. press 8e (as per the L listing) to change partition 1 to 8e, i.e. Linux LVM partition
type,
8. press p to display the secondary hard disk partition setup. Please take note that the
first partition is denoted as /dev/hdb1 in Linux,
9. press w to write the partition table and exit fdisk upon completion.

3. Next, this LVM command will create a LVM physical volume (PV) on a regular hard disk
or partition:
pvcreate /dev/hdb1

4. Now, another LVM command to create a LVM volume group (VG) called vg0 with a
physical extent size (PE size) of 16MB:
vgcreate -s 16M vg0 /dev/hdb1
Be properly planning ahead of PE size before creating a volume group with vgcreate -s
option!

5. Create a 400MB logical volume (LV) called lvol0 on volume group vg0:
lvcreate -L 400M -n lvol0 vg0

This lvcreate command will create a softlink /dev/vg0/lvol0 point to a correspondence


block device file called /dev/mapper/vg0-lvol0.

6. The Linux LVM setup is almost done. Now is the time to format logical volume lvol0 to
create a Red Hat Linux supported file system, i.e. EXT3 file system, with 1% reserved
block count:
mkfs -t ext3 -m 1 -v /dev/vg0/lvol0

7. Create a mount point before mounting the new EXT3 file system:
mkdir /mnt/vfs

8. The last step of this LVM tutorial – mount the new EXT3 file system created on logical
volume lvol0 of LVM to /mnt/vfs mount point:
mount -t ext3 /dev/vg0/lvol0 /mnt/vfs

To confirm the LVM setup has been completed successfully, the df -h command should display
these similar message:

/dev/mapper/vg0-lvol0 388M 11M 374M 3% /mnt/vfs

Some of the useful LVM commands reference:


vgdisplay vg0

To check or display volume group setting, such as physical size (PE Size), volume group
name (VG name), maximum logical volumes (Max LV), maximum physical volume (Max
PV), etc.

pvscan

To check or list all physical volumes (PV) created for volume group (VG) in the current
system.

vgextend

 What are the different types of installation?


Kickstart,NFS,CDROM

 What is Kick-Start installation?


Many system administrators would prefer to use an automated installation method to install Red
Hat Linux on their machines. To answer this need, Red Hat created the kickstart installation
method. Using kickstart, a system administrator can create a single file containing the answers to
all the questions that would normally be asked during a typical Red Hat Linux installation.
Kickstart files can be kept on single server system, and read by individual computers during the
installation. This installation method can support the use of a single kickstart file to install Red Hat
Linux on multiple machines, making it ideal for network and system administrators.

 What are the requirements of kickstart installation?


To use Kickstart to install a Red Hat Linux 7.3 or Fedora Core 1 operating system, you need:
 One 3.5-inch blank, DOS diskette (two for Fedora Core 1)
 Host name of the server

 Domain name of the server

 IP address of the server

 Netmask of the server

 Gateway address of the server

 IP address of the DNS servers

 Admin password of the server

 Root password of the server

 Time zone of the server

 NICs and/or disk controller card drivers for your server if those drivers are not in the
standard Red Hat Linux 7.3 or Fedora Core 1 distribution

 How would you perform NFS based installation?


Basic Preparation
Create The Installation Directories
We'll first create the directories /data/network-install/RPM and /data/network-
install/ISO in which we will copy the necessary files.
[root@bigboy tmp]# mkdir -p /data/network-install/RPM
[root@bigboy tmp]# mkdir -p /data/network-install/ISO

Copying The Files


The HTTP, NFS and FTP kickstart methods all require the base set of Fedora files to be installed
on the kickstart server. Here's how to do it:
1) Create a mount point for your CD ROM drive.
[root@bigboy tmp]# mkdir /mnt/cdrom

2) Mount your first Fedora CD ROM.


[root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom
3) Copy the files from the CD ROM base directory to the hard disk
[root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM

4) Unmount your CD ROM and use the eject command to retrieve it from the drive bay.
[root@bigboy tmp]# umount /dev/cdrom
[root@bigboy tmp]# eject cdrom

 How do you setup SSL + Apache?


the SSL protocol has been widely used for the purpose of securing web transactions over
the Internet.
Introduction to SSL
Secure Sockets Layer (SSL) is the most widely known protocol that offers privacy and good
reliability for client-server communication over the Internet. SSL itself is conceptually quite
simple: it negotiates the cryptography algorithms and keys between two sides of a communication,
and establishes an encrypted tunnel through which other protocols (like HTTP) can be transported.
Optionally, SSL can also authenticate both sides of communication through the use of certificates.
SSL is a layered protocol and consists of four sub-protocols:
 SSL Handshake Protocol
 SSL Change Cipher Spec Protocol
 SSL Alert Protocol
 SSL Record Layer.

Installing Apache with SSL/TLS support


The first step in order to install Apache with SSL/TLS support is to configure and install the
Apache 2 web server, and create a user and group named "apache". A secure way of installing
Apache's 2.0 has already been published on SecurityFocus in the article Securing Apache 2.0:
Step-by-Step. The only difference to that process is to enable mod_ssl and mod_setenvif, which is
required to provide compatibility with some versions of MS Internet Explorer, as follows (changes
shown in bold):
./configure \ --prefix=/usr/local/apache2 \ --with-mpm=prefork \ --enable-ssl \ --disable-
charset-lite \ --disable-include \ --disable-env \ --enable-setenvif \ --disable-status \ --
disable-autoindex \ --disable-asis \ --disable-cgi \ --disable-negotiation \ --disable-imap \
--disable-actions \ --disable-userdir \ --disable-alias \ --disable-so
After configuring, we can install Apache into the destination directory:
make su umask 022 make install chown -R root:sys /usr/local/apache2

Configuring SSL/TLS
Before running Apache for a first time, we need also to provide an initial configuration and prepare
some sample web content. As a minimum, we need to go through the following steps (as root):
1. Create some sample web content, which will be served up via TLS/SSL:
umask 022 mkdir /www echo "<html><head><title>Test</title></head><body> \ Test
works.</body></html>" > /www/index.html chown -R root:sys /www
3) Prepare the directory structure for web server's private keys, certificates and certification
revocation lists (CRLs):

umask 022 mkdir /usr/local/apache2/conf/ssl.key mkdir


/usr/local/apache2/conf/ssl.crt mkdir /usr/local/apache2/conf/ssl.crl

4)Create a self-signed server certificate (it should be used only for test
purposes -- your real certificate should come from a valid CA such as
Verisign):

openssl req \ -new \ -x509 \ -days 30 \ -keyout


/usr/local/apache2/conf/ssl.key/server.key \ -out
/usr/local/apache2/conf/ssl.crt/server.crt \ -subj '/CN=Test-Only Certificate'

 What ports do imap and pop3 run?

IMAP port is 143 & POP3 is 110.

 What is SAR used for (System Activity Reporting)?


The reason for sar creation was that gathering system activity data from vmstat and iostat is
pretty time-consuming. If you need to automate collection of system activity data, and creation of
periodic repots you need a more specialized tool like sar.
System Activity Recorder can monitor half-dozen metrics
related to overall system performance, for example:
1. cpu utilization (it's pretty effective tool for spotting CPU bottlenecks)
2. hard disk utilization
3. terminal IO
4. number of files open
5. processes running
It provides queuing, paging, CPU and many other metrics. Modern Unixes maintains a series of
system activity counters that record various activities and provide the data that sar reports.
What are the various commands that you can use to check CPU, memory status?
sar -u 2 5

 What is SYSSTAT?
SYSSTAT is a software application comprised of several tools that
offers advanced system performance monitoring. It provides the
ability to create a measurable baseline of server performance, as
well as the capability to formulate, accurately assess and
conclude what led up to an issue or unexpected occurrence. In
short, it lets you peel back layers of the system to see how it’s
doing... in a way it is the blinking light telling you what is
going on, except it blinks to a file. SYSSTAT has broad coverage
of performance statistics and will watch the following server
elements:
 Input/Output and transfer rate statistics (global, per device, per partition, per network
filesystem and per Linux task / PID)
 CPU statistics (global, per CPU and per Linux task / PID), including support for
virtualization architectures
 Memory and swap space utilization statistics
 Virtual memory, paging and fault statistics
 Per-task (per-PID) memory and page fault statistics
 Global CPU and page fault statistics for tasks and all their children
 Process creation activity
 Interrupt statistics (global, per CPU and per interrupt, including potential APIC interrupt
sources)
 Extensive network statistics: network interface activity (number of packets and kB received
and transmitted per second, etc.) including failures from network devices; network traffic
statistics for IP, TCP, ICMP and UDP protocols based on SNMPv2 standards.
 NFS server and client activity
 Socket statistics
 Run queue and system load statistics
 Kernel internal tables utilization statistics
 System and per Linux task switching activity
 Swapping statistics
 TTY device activity

The SYSSTAT software application is composed of several


utilities. Each utility has a specific function:
 iostat reports CPU statistics and input/output statistics for devices, partitions and network
filesystems.
 mpstat reports individual or combined processor related statistics.
 pidstat reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc.
 sar collects, reports and saves system activity information (CPU, memory, disks, interrupts,
network interfaces, TTY, kernel tables, NFS, sockets etc.)
 sadc is the system activity data collector, used as a backend for sar.
 sa1 collects and stores binary data in the system activity daily data file. It is a front end to
sadc designed to be run from cron.
 sa2 writes a summarized daily activity report. It is a front end to sar designed to be run
from cron.
 sadf displays data collected by sar in multiple formats (CSV, XML, etc.) This is useful to
load performance data into a database, or import them in a spreadsheet to make graphs.

Sa1 is the internal mechanism that performs the actual statistical


collection and writes the data to a binary file at specified
times. Information is culled from the /proc directory where the
Linux kernel writes and maintains pertinent data while the
operating system is running. Similar to sar, the binary file is
written into /var/log/sa and named sa##. Again, the ## represents
the day of the month (i.e. sar03 would be the third day of the
month). Once more, the numerical value changes accordingly without
system administrator intervention.
Sa2 is responsible for converting the sa1 binary file into a human readable format. Upon
successful creation of the binary file sa## it becomes necessary to set up a cron task that will call
the sa2 libraries to convert the sa1 binary file into the human-readable sar file. SYSSTAT utilizes
the scheduled cron command execution to draw and record specified performance data based upon
pre-defined parameters. It is not necessary to run the sa2 cron at the same time or as often as the
sa1 cron. The sa2 function will create and write the sar file to the /var/log/sa directory.

Display CPU Statistics using Sar Command?


# sar –u
Display Disk IO Statistics using sar command?
# sar –d
Display networking Statistics using sar command?
# sar -n DEV | more
 Commands used to check process running on a linux based server?
PS= , pstree

 What is Zombie Process? How will you kill the zombie process?
Zombie process is an inactive computer process, according to wikipedia article, "...On Unix
operating systems, a zombie process or defunct process is a process that has completed execution
but still has an entry in the process table, allowing the process that started it to read its exit status.
In the term's colorful metaphor, the child process has died but has not yet been reaped..."
Use top or ps command
# top
OR
# ps aux | awk '{ print $8 " " $2 }' | grep -w Z
You cannot kill zombies, as they are already dead. But if you have too many
zombies then kill parent process or restart service .
# kill -9 4104
Please note that kill -9 does not guarantee to kill a zombie process (see below for
more info).

 Describe Apache rewrite module?


 How to integrate apache proxy module?
 How do you check the shares mounted on an NFS server?
Showmount -e
 How would you mount a windows share on a linux system?
Procedure to mount remote windows partition (NAS share)
1) Make sure you have following information:
==> Windows username and password to access share name
==> Sharename (such as //server/share) or IP address
==> root level access on Linux
2) Login to Linux as a root user (or use su command)
3) Create the required mount point:
# mkdir -p /mnt/ntserver
4) Use the mount command as follows:
# mount -t cifs //ntserver/download -o
username=vivek,password=myPassword /mnt/ntserver
Use following command if you are using Old version such as RHEL <=4 or Debian <= 3:
# mount -t smbfs -o username=vivek,password=D1W4x9sw
//ntserver/download /mnt/ntserver
5) Access Windows 2003/2000/NT share using cd and ls command:
# cd /mnt/ntserver; ls -l
Where,
 -t smbfs : File system type to be mount (outdated, use cifs)
 -t cifs : File system type to be mount
 -o : are options passed to mount command, in this example I had passed two options. First
argument is password (vivek) and second argument is password to connect remote
windows box
 //ntserver/download : Windows 2000/NT share name
 /mnt/ntserver Linux mount point (to access share after mounting)

 What is the difference between hard and soft mount in NFS?

soft mount is to mount for limited time or temporary,


whereas hard mount is mount permanently.

To make nfs permanent mount go to /etc/fstab & put the entry


& run a cmd to make it mount permanent #mount -a.

 How do you configure Samba server with shares?

[sharename]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no
create mask = 0765

 What role can a samba server play other than a file server?

 What are the parameters to configure samba server as a member server to Win-AD?
 How would you list samba shares on linux client?
 Scenario Given: Block cracker.org from accessing port 25 using IPTables? Orally
spell the command line?
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 202.54.1.20 --dport 25 -j REJECT

 Scenario Given: Suppose there are 2 machines A and B they are able to ping each
other with IP-Address, but not using hostnames. How would you make them ping
using hostnames?
Need to edit your /etc/hosts file (192.168.2.169 sunil.example.com sunil)
 Scenario Given: Suppose there are 2 machines A and B. Machine A is able to machine
B but machine B is unable to ping machine A. How would you begin troubleshooting
as an admin?
 Where is the information for DNS Server set in the linux client?
/etc/resolv.conf
 Which port does squid run on by default?
3128
 Give me an example of setting up an ACL in squid.conf?
 What are delay pools in squid.conf used for?

Delay pools are generally used in places where bandwidth are expensive.they let us slow down access to
specific sites so that other downloads can happen at reasonable rate..

Installing Squid with the delay pools feature


[edit]

Introduction
Squid has a feature called delay pools, which allows us to control download bandwidth.
Unfortunately, in most distributions, Squid is shipped without that feature.
So if you have Squid already installed, I must disappoint you -- you need to uninstall it and do it
once again with delay pools enabled in the way I explain below.
1. To get maximum performance from our Squid proxy, it's best to create a separate partition for
its cache, called /cache/. Its size should be about 300 megabytes, depending on our needs.
If you don't know how to make a separate partition, you can create the /cache/ directory on a main
partition, but Squid performance can suffer a bit.
2. We add a safe 'squid' user:
# useradd -d /cache/ -r -s /dev/null squid >/dev/null 2>&1

No one can log in as squid, including root.


3.We download latest Squid sources from http://www.squid-cache.org http://www.squid-
cache.org/Versions/v2/2.4/squid-2.4.STABLE1-src.tar.gz
4.We unpack everything to /var/tmp:
# tar xzpf squid-2.4.STABLE1-src.tar.gz

5.We compile and install Squid (everything is in one line):


# ./configure --prefix=/opt/squid --exec-prefix=/opt/squid -- enable-
delay-pools --enable-cache-digests --enable-poll -- disable-ident-lookups
--enable-truncate –enable-removal- policies
# make all
# make install

[edit]

Configuring Squid to use the delay pools feature


1. Configure our squid.conf file (located under /opt/squid/etc/squid.conf):
#squid.conf
#Every option in this file is very well documented in the original squid.conf
file
#and on http://www.visolve.com/squidman/Configuration%20Guide.html

#
#The ports our Squid will listen on.
http_port 8080
icp_port 3130
#cgi-bins will not be cached.
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
#Memory the Squid will use. Well, Squid will use far more than that.
cache_mem 16 MB
#250 means that Squid will use 250 megabytes of disk space.
cache_dir ufs /cache 250 16 256

#Places where Squid's logs will go to.


cache_log /var/log/squid/cache.log
cache_access_log /var/log/squid/access.log
cache_store_log /var/log/squid/store.log
cache_swap_log /var/log/squid/swap.log
#How many times to rotate the logs before deleting them.
#See the FAQ for more info.
logfile_rotate 10

redirect_rewrites_host_header off
cache_replacement_policy GDSF
acl localnet src 192.168.1.0/255.255.255.0
acl localhost src 127.0.0.1/255.255.255.255
acl Safe_ports port 80 443 210 119 70 20 21 1025-65535
acl CONNECT method CONNECT
acl all src 0.0.0.0/0.0.0.0
http_access allow localnet
http_access allow localhost
http_access deny !Safe_ports
http_access deny CONNECT
http_access deny all
maximum_object_size 3000 KB
store_avg_object_size 50 KB

#Set these if you want your proxy to work in a transparent way.


#Transparent proxy means you generally don't have to configure all
#your client's browsers, but hase some drawbacks too.
#Leaving these uncommented won't do any harm.
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

#all our LAN users will be seen by external web servers


#as if they all used Mozilla on Linux. :)
anonymize_headers deny User-Agent
fake_user_agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6+)
Gecko/20011122

#To make our connection even faster, we put two lines similar
#to the ones below. They will point a parent proxy server our own Squid
#will use. Don't forget to change the server to the one that will
#be fastest for you!
#Measure pings, traceroutes and so on.
#Make sure that http and icp ports are correct.

#Uncomment lines beginning with "cache_peer" if necessary.


#This is the proxy you are going to use for all connections...
#cache_peer w3cache.icm.edu.pl parent 8080 3130 no-digest default

#...except for the connections to addresses and IPs beginning with "!".
#It's a good idea not to use a higher
#cache_peer_domain w3cache.icm.edu.pl !.pl !7thguard.net !192.168.1.1

#This is useful when we want to use the Cache Manager.


#Copy cachemgr.cgi to cgi-bin of your www server.
#You can reach it then via a web browser typing
#the address http://your-web-server/cgi-bin/cachemgr.cgi
cache_mgr your@email
cachemgr_passwd secret_password all

#This is a name of a user our Squid will work as.


cache_effective_user squid
cache_effective_group squid

log_icp_queries off
buffered_logs on

[edit]

Delay Pools
#This is the most important part for shaping incoming traffic with Squid
#For detailed description see squid.conf file or docs at http://www.squid-
cache.org

#We don't want to limit downloads on our local network.


acl magic_words1 url_regex -i 192.168

#We want to limit downloads of these type of files


#Put this all in one line
acl magic_words2 url_regex -i
ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt
.ram .rm .iso .raw .wav .mov
#We don't block .html, .gif, .jpg and similar files, because they
#generally don't consume much bandwidth

#We want to limit bandwidth during the day, and allow


#full bandwidth during the night
#Caution! with the acl below your downloads are likely to break
#at 23:59. Read the FAQ in this bandwidth if you want to avoid it.
acl day time 09:00-23:59

#We have two different delay_pools


#View Squid documentation to get familiar
#with delay_pools and delay_class.
delay_pools 2

#First delay pool


#We don't want to delay our local traffic.
#There are three pool classes; here we will deal only with the second.
#First delay class (1) of second type (2).
delay_class 1 2

#-1/-1 mean that there are no limits.


delay_parameters 1 -1/-1 -1/-1

#magic_words1: 192.168 we have set before


delay_access 1 allow magic_words1

#Second delay pool.


#we want to delay downloading files mentioned in magic_words2.
#Second delay class (2) of second type (2).
delay_class 2 2

#The numbers here are values in bytes;


#we must remember that Squid doesn't consider start/stop bits
#5000/150000 are values for the whole network
#5000/120000 are values for the single IP
#after downloaded files exceed about 150000 bytes,
#(or even twice or three times as much)
#they will continue to download at about 5000 bytes/s

delay_parameters 2 5000/150000 5000/120000


#We have set day to 09:00-23:59 before.
delay_access 2 allow day
delay_access 2 deny !day
delay_access 2 allow magic_words2

#EOF

Hear in delay_parameters 2 5000/150000 5000/120000 we can change the numbers according to


our requirement. For example if we want to restrict our lan users to give download speed of 20
KB/Sec with a bucket size 12 MB and to whole network a download speed of 25 KB/Sec with a
bucket size 25 MB, change this line to delay_parameters 2 25000/250000 20000/120000
OK, when we have configured everything, we must make sure everything under /opt/squid and
/cache directories belongs to user 'squid'.
# mkdir /var/log/squid/
# chown squid:squid /var/log/squid/
# chmod 770 /var/log/squid/
# chown -R squid:squid /opt/squid/
# chown -R squid:squid /cache/

Now everything is ready to run Squid. When we do it for the first time, we have to create its cache
directories:
# /opt/squid/bin/squid -z
We run Squid and check if everything is working. A good tool to do that is IPTraf; you can find it
on http://freshmeat.net. Make sure you have set the appropriate proxy in your web browsers
(192.168.1.1, port 8080 in our example):

# /opt/squid/bin/squid

If everything is working, we add /opt/squid/bin/squid line to the end of our initializing scripts.
Usually, it can be /etc/rc.d/rc.local.
Other helpful options in Squid may be:
# /opt/squid/bin/squid -k reconfigure
(it reconfigures Squid if we made any changes in its squid.conf file)
# /opt/squid/bin/squid -help :) self-explanatory

You can also copy cachemgr.cgi to the cgi-bin directory of your WWW server, to make use of a
useful Cache Manager.

 How would you enable squid cache directory using command line?
http://www.visolve.com/squid/Squid_tutorial.php

 Which is the squid cache directory?


Squid Cache directory is /usr/local/squid/cache 100 16 256
Where 100 is size of dir in Mbs 16 & 256 are the number of subdirectories..
http://www.visolve.com/squid/Squid_tutorial.php

 Command used to insert Linux Kernel Loadable Module?


Insertion Of KLM Insmod /Path/To/Snarf.O

 Command used to remove Linux Kernel Loadable Module?


Removal of KLM: rmmod snarf
Please Note :
 depmod - handle dependency descriptions for loadable kernel modules.
 insmod - install loadable kernel module.
 lsmod - list loaded modules.
 modinfo - display information about a kernel module.
 modprobe - high level handling of loadable modules.
 rmmod - unload loadable modules.

 What other command can be used to load Linux KLM? Modprobe.


Can it be used to remove that module as well?
 What is Virtual Hosting and types of them?
Virtual hosting is a method for hosting multiple domain names on a computer ...
such as memory and processor cycles, to use its resources more efficiently. ... the
address that the user typed into their browser's address bar (the URL). ...
Different types:1)free hosting 2)shared virtual hosting 3)dedicated hosting
4)collocated hosting

 Have you worked on monitoring applications? I said yes? Nagios Big brother
monitoring tool
 How do you configure Nagios? Don’t know
 How would do you enable Quotas for user? Command used to set quota for user?
Make entry in fstab in /home after defaults,usrquota in 4th field put usrquota save the file
mount –a and mount –o remount /home than give quotacheck –vcu /home

 What is DNS? How would you configure bind?


DNS is Domain name Server listen on port 53
 How would you extend LVM Partition?
 Eve after extending LVM partition, the size remains same? Why? What needs to be
done?
 What is tune2fs? What can be it used for?
 What is the difference between ext2 and ext3 file system?
 What is the specific topic you feel you have specialized in Linux? I said Apache.
 What is tcpdump and what is it used for?
 Scenario Given: User A is unable to login? What can be the possible reasons you can
check for?
 What is initrd?
 What is PXE-ROM? How would you perform PXE boot installation?
RedHat Interview (Round-2) 45 minutes

Please note: Some of the Questions are also shaped in the way I answered them. Questions
were basically based on what my resume mentioned.

 What is soft mount and hard mount in NFS?


 Parameters to allow interrupt when NFS server is hung?
 What is the default version of NFS protocol?
 What are NFS mount options? Anonuid, anongid, ro, sync, async, rw
 How does NFS work basically? RPC based service and explain all that.
 Who provides the port number’s for nfs services?
 Are they static and dynamic? Can they change to static ports?
 What is Active and Passive FTP?
 Different Types of Process?
 What is sudo and explain with example?
 What is FTP Server by default? Active or Passive or it’s the client that decides?
 Suppose there are 3 users a, b, c? How would you configure user a, b in Pam such that they
can perform all operations and c can only perform operation on apache server?
 How would you deny the user who has failed 5 login attempts in PAM?
 What is superblock? What information does it contain?
 What is inode?
 What’s the use of lost+found directory?
 What is HardLink/SoftLink?
 What is the reason the inode numbers are different for Soft and Hard Link?
 df –H shows 100Gb free space but still you are not able to create file reason?
 On booting the server you get dropped in to shell? The server has partitions but doesn’t
display them? How will you go about fixing them in the linux rescue mode?
 You have forgotten root password of MySQL? How would you recover from that?
 How is MySQL replication done? Explain?
 If the slave server lags in replication how would you go about troubleshooting that? Or
what parameters would you check in as an admin?
 Do you now what is KVM?
 What is paravirtualised and fully virtualized VM’s?
 If you are logging in to one of such VM’s how would you now the one that you have
logged in is a PV/FV VM?
 What is the difference between LVM1 and LVM2?
 What is LVM snapshot?
 What is the use of pvmove command in LVM?
 What is difference between ext2 and ext3 FS? What is the use of journaling?
 How do you change the port on which postfix is running?
 What is SMTP-AUTH? Parameters in Postfix?
 How can you do SMTP-AUTH auth other ways?
 I want postfix to only send mail not receive? How would you configure that mail server?
 What is my destination parameter?
 How would you do perform checking on linux ext3 based file system?
 How would you filter mails received from a domain?
 Have you worked on NFSv4? Can u list its features?
 Have you worked on Ext4 file system? Features
 Have you worked on any other FileSystems?
 What are various journaling modes in ext3?
 What are the two-ways you take back-up of MySQL Database? Mysqldump and
mysqlhotcopy

Redhat-3 Round (30 Minutes)

Note: Can see more questions on networking since I mentioned CCNA.

What is the challenging thing you have done as System Admin in your previous jobs?
As a system admin what would you suggest the file system to be on a linux system ext2/ext3?
Explain in depth the working.
What is OSI Layer? Explain them?
IP works on which layer?
What is TCP/UDP? Differentiate them functionally?
Which technologies work on DataLink Layer?
How would you check process state?
Explain process states displayed in ps –ef command in depth?
What is Symlink and HardLink? If I create a hardlink of 1 GB does that mean it adds up to 2 GB
of space on the harddisk?
What is Gigabit Ethernet? Speed of Gigabit Ethernet?
Suppose you are copying files using scp over Gigabit Ethernet what would be maximum speed in
MB during the operation from Server A to Server B.
Have you strace? What is strace?
How do you convert ext3 to ext2?
What is ICMP and IP?
Which command uses ICMP protocol?

Redhat-4 Round (Scheduled) Given an assignment to prepare the below and get interviewed on
any thing asked about it.
 In depth of ps command and various process states.
 Indepth of Ext2 and Ext3 woking as an admin.
 Learning to use strace.

You might also like