Redhat-Interview Questions
Redhat-Interview Questions
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
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.
1. Login with root user ID and try to avoid using sudo command for simplicity reason.
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
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:
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
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
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
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):
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):
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
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).
[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..
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
[edit]
#
#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
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
#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.
#...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
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
#EOF
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
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
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 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.