Linux Interview Questions & Answers
Linux Interview Questions & Answers
1} what is inode?
All UNIX files have its description stored in a structure called inode.
The inode contains info about the file-size, its location, time of last
access, time of last modification, permission and so on. Directories are
also represented as files and have an associated inode.
2} what are the process states in UNIX?
As a process executes it changes state according to its circumstances.
Unix processes have the following states:
Running: The process is either running or it is ready to run . Waiting:
The process is waiting for an event or for a resource. Stopped: The
process has been stopped, usually by receiving a signal. Zombie: The
processes are dead but have not been removed from the process table.
3} what command should you use to check the number of
files and disk space used and each users defined quotas?
repquota
4} what command is used to remove the password assigned
to a group?
gpasswd r
5} what can you type at a command line to determine which
shell you are using?
echo $SHELL
6} write a command to find all of the files which have been
accessed within the last 30 days.
The /dev directory contains all device files that are attached to system
or virtual device files that are provided by the kernel.
13} what is the role of udev daemon?
The udev demon used to create and remove all these device nodes or
files in /dev/ directory.
14} what kind of files or nodes /dev/ directory contains and
how do I access or see device files?
Block Device Files:Block device files talks to devices block by block [1 block at a time (1
block = 512 bytes to 32KB)]. Examples: USB disk, CDROM, Hard
Disk # ls /dev/sd*
brw-rw- 1 root root 8,0 Mar 15 2009 sda
brw-rw- 1 root root 8,1 Mar 15 2009 sda1
brw-rw- 1 root root 8,2 Mar 15 2009 sda2
brw-rw- 1 root root 8, 3 Mar 15 2009 sda3
brw-rw- 1 root root 8, 4 Mar 15 2009 sda4
brw-rw- 1 root root 8, 16 Mar 15 2009 sdb
Character Device Files:Character device files talk to devices character by character. Examples:
Virtual terminals, terminals, serial modems, random numbers #ls
/dev/tty*
crw-rw- 1 root root 4, 64 Mar 15 2009 ttyS0
crw-rw- 1 root root 4,65 Mar 15 2009 ttyS1
crw-rw- 1 root root 4,66 Mar 15 2009 ttyS2
crw-rw- 1 root root 4,67 Mar 15 2009 ttyS3
15} tell me the name of device file for PS/2 mouse
connection.
/dev/psaux
16} tell me the name of device file for parallel port
(Printers).
/dev/lp0
17} what does /etc/X11/ directory contains?
The /etc/X11/ directory is for X Window System configuration files,
such asxorg.conf.
18} what does /etc/skell directory contains?
The /etc/skel directory contains files and directories that are
automatically copied over to a new users home directory when such
user is created by the useradd or adduser command.
19} tell me name of Linux File systems?
Ext2 Ext3 Ext4
20} what is the difference between ext2 and ext3 file
systems?
The ext3 file system is an enhanced version of the ext2 file system.
The most important difference between Ext2 and Ext3 is that Ext3
supports journaling. After an unexpected power failure or system
crash (also called an unclean system shutdown), each mounted ext2
file system on the machine must be checked for consistency by the
e2fsck program. This is a time-consuming process and during this
time, any data on the volumes is unreachable. The journaling provided
by the ext3 file system means that this sort of file system check is no
longer necessary after an unclean system shutdown. The only time a
consistency check occurs using ext3 is in certain rare hardware failure
cases, such as hard drive failures. The time to recover an ext3 file
system after an unclean system shutdown does not depend on the size
of the file system or the number of files; rather, it depends on the size
disks, using techniques such as disk striping (RAID Level 0), disk
mirroring (RAID Level 1), and disk striping with parity (RAID Level 5)
to achieve redundancy, lower latency, increased bandwidth, and
maximized ability to recover from hard disk crashes.
6
30} Why should we use RAID?
System Administrators and others who manage large amounts of data
would benefit from using RAID technology.
Following are the reasons to use RAID Enhances speed Increases
storage capacity using a single virtual disk Minimizes disk failure
31} What is the difference between hardware RAID and
Software RAID?
The hardware-based RAID is independent from the host. A Hardware
RAID device connects to the SCSI controller and presents the RAID
arrays as a single SCSI drive. An external RAID system moves all
RAID handling intelligence into a controller located in the external
disk subsystem. The whole subsystem is connected to the host via a
normal SCSI controller and appears to the host as a single disk.
Software RAID is implemented under OS Kernel level. The Linux
kernel contains an MD driver that allows the RAID solution to be
completely hardware independent. The performance of a softwarebased array depends on the server CPU performance and load.
32} Explain RAID 0?
RAID level 0 works on striping technique. In RAID 0 the array is
broken down into strips and data is written into strips. RAID 0 allows
high I/O performance but provides no redundancy. RAID 0 Array Size
is equal to sum of disks in array. If one drive fails then all data in the
array is lost.
33} Explain RAID 1?
pieces of the stripe on each disk? The pieces a stripe is broken into are
called chunks.To get good performance you must have a reasonable
chunk size.
For big I/Os we required small chunks and for small I/Os we required
big chunks.
39} What is SWAP Space?
Swap space in Linux is used when the amount of physical memory
(RAM) is full. If the system needs more memory resources and the
RAM is full, inactive pages in memory are moved to the swap space.
While swap space can help machines with a small amount of RAM, it
should not be considered a replacement for more RAM. Swap space is
located on hard drives, which have a slower access time than physical
memory.
40} What are the steps to create SWAP files or Partition?
Create swap partition or file Write special signature using mkswap
Activate swap space by swapon a command Add swap entry
into /etc/fstab file
41} How you will create swap file of size 4 GB and explain
swap file entry in /etc/fstab file?
Use dd command to create swap file.
dd if=/dev/zero of=/SWAPFILE bs=1024 count=4
mkswap /SWAPFILE
8
swapon a
Entry into /etc/fstab file.
/SWAPFILE swap swap defaults 0 0
42} Tell me the steps to remove the swap file?
Firstly disable the swap file by swapoff command. Remove Swap file
entry from /etc/fstab file. Now remove the swap file by rm
command.
43} What can we do with parted command or utility?
View the existing partition table Add partitions from free space or
additional hard drives Change the size of existing partitions
44} How we will check free space on drive /dev/sda with parted
command? #parted /dev/sda
print
45} Can we resize the size of a partition?
Yes, we can resize the size of partition by parted command.
#parted /dev/sda
print
To resize the partition, use the resize command followed by the minor
number for the partition, the starting place in megabytes, and the end
place in megabytes. For example:
resize 3 1024 2048
After resizing the partition, use the print command to confirm that the
partition has been resized correctly, is the correct partition type, and is
the correct file system type.
46} What is LVM?
LVM stands for Logical Volume Manager. LVM, is a storage
management solution that allows administrators to divide hard drive
space into physical volumes (PV), which can then be combined into
logical volume groups (VG), which are then divided into logical
volumes (LV) on which the filesystem and mount point are created.
9
47} What are the steps to create LVM?
Create physical volumes by pvcreate command
#pvcreate /dev/sda2 Add physical volume to volume group by
vgcreate command
54} How you will check on Your server or system devicemapper is installed or not?
Check the following file. #cat /proc/misc
if this file contains device-mapper term it means device mapper is
installed on your system.
55} How are snapshots in LVM2 different from LVM1?
In LVM2 snapshots are read/write by default, whereas in LVM1,
snapshots were read only.
56} What is the maximum size of a single LV?
For 2.4 based kernels, the maximum LV size is 2TB. For 32-bit CPUs
on 2.6 kernels, the maximum LV size is 16TB. For 64-bit CPUs on 2.6
kernels, the maximum LV size is 8EB.
57} If a volume group named as VG0 already exists but i
need to extend this volume group up to 4GB.Explain all
steps?
Firstly create Physical volume (/dev/sda7) of size 4GB.
Now run following command. vgextend VG0 /dev/sda7
58} If a volume group VG0 have 3 PVs (/dev/sda6,
/dev/sda7, /dev/sda8) but i want to remove /dev/sda7 pv
from this VG0?
vgreduce VG0 /dev/sda7
59} Which command is used to extend a logical
volume? lvextend size +<addsize> /dev/<vgname>/<lvname>
resize2fs /dev/<vgname>/<lvname>
60} Tell me all steps to remove a LVM?
To remove a logical volume from a volume group, first unmount it
with the umount command:
umount /dev/<vgname>/<lvname>
and then use the lvremove command:
lvremove /dev/<vgname>/<lvname>
61} Which command is used to create LVM Snapshot? vcreate
size <size> -s -n <snapshotname> <lvname>
The lvcreate command is used to create a new logical volume, meaning
there must be free physical extents in the logical volume group to
create a snapshot. The -s option means that the LV is a snapshot,
<snapshotname> is the name of the new LV created, and <lvname> is
the name of the LV from which to create the snapshot.
62} Is there any relation between modprobe.conf file and
network devices?
Yes, This file assigns a kernel module to each network device.
For Example :- [root@localhost ~]# cat /etc/modprobe.conf alias eth0
b44
Here b44 is the kernel module for network device eth0.
We can Confirm by following command (This module b44 is present
or not).
[root@localhost ~]# lsmod |grep b44
b44 29005 0
63} What neat command will do?
neat command provides Graphical interface to change network
settings for network devices.
64} Which protocol is required to allow local printing and
print sharing?
Internet Printing Protocol (IPP) is required to allow local printing and
print sharing.
65} What is CUPS?
Intel EM64T
ia64 Intel Itanium
ppc 32-bit IBM POWER, IBM eServer pSeries, and IBM eServer
iSeries
s390x 64-bit IBM eServer System z
75} How to install Linux softwares by RPM?
rpm -ivh test-1.0-1.i386.rpm
test ######################### [100%]
76} If a file associated with test-1.0-1.i386.rpm deleted, than
How we will recover that file?
We can reinstall this rpm again.
77} If you are getting error package is already installed but
you have to install package any how. what option you will
use?
rpm -ivh test-1.0-1.i386.rpm
Preparing
########################################### [100%]
package test-1.0-1 is already installed
In this case you can use replacepkgs option.
rpm -ivh replacepkgs test-1.0-1.i386.rpm
78} Which options are required to upgrade a RPM? Upgrading
a package is similar to installing one. Type the following command at a
shell prompt:
rpm -Uvh test-2.0-1.i386.rpm
79} Explain the command rpm -qa?
It will queries all currently installed packages.
/var/lib/rpm
81} Explain the command rpm -qf ?
# passwd <username> -l
This might be useful in the situation where you dont want to
permanently remove the user, but you just want it disabled and no
longer able to use the system. The user will still receive emails for
example, but he will not be able to login and check them out.
To re-enable the account ,just use below command
16
# passwd <username> -u
92} How to detect CPU architecture/bitmode (32-bit or 64bit) for Linux ?
# cat /proc/cpuinfo | grep flags
you will find one of them with name tm(transparent mode) or
rm(real mode) or lm(long mode) 1. rm tells ,it is a 16 bit processor
2. tm tells, it is a 32 bit processor 3. lm tells, it is a 64 bit processor
93} What is the difference between SSH and Telnet ?
The Primary difference between SSH and Telnet is of security i.e in ssh
data transfer between the systems is in encrypted form so it is difficult
for the hackers to understand what is going on network.
In Telnet data transfer between the systems is in plain text.
SSH uses a public key for authentication while Telnet does not use any
authentication.
Due to the security measures that were necessary for SSH to be used in
public networks, each packet contains less data to make room for the
data of the security mechanisms. In order to transmit the same
amount of data, you would need to take-up a lot more bandwidth. This
is called overhead..
SSH adds a bit more overhead to the bandwidth compared to Telnet.
94} What is difference between AT and CRON?
Cron command is used to schedule the task daily at the same time
repeatedly ,
at command is used to schedule the task only once i.e to run only one
time.
95} What is network bonding in Linux and steps to configure
network bonding ?
Network interface card (NIC) bonding (also referred to as NIC
teaming) is the bonding together of two or more physical NICs so that
they appear as one logical device. This allows for improvement in
network performance by increasing the link speed beyond the limits of
one single NIC and increasing the redundancy for higher availability.
For example, you can use two 1-gigabit NICs bonded together to
establish a 2-gigabit connection to a central file server.
When bonded together, two or more physical NICs can be assigned
one IP address. And they will represent the same MAC address. If one
of the NICs fails, the IP address remains accessible
because it is bound to the local NIC rather than to a single physical
NIC. Steps to configure :
Step #1: Create a bond0 configuration file
Red Hat Linux stores network configuration in
/etc/sysconfig/network-scripts/ directory. First, you need to create
bond0 config file:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
Append following lines to it:
DEVICE=bond0 IPADDR=192.168.1.20 NETWORK=192.168.1.0
NETMASK=255.255.255.0 USERCTL=no BOOTPROTO=none
ONBOOT=yes
Replace above IP address with your actual IP address. Save file and
exit to shell prompt.
Step #2: Modify eth0 and eth1 config files:
Open both configuration using vi text editor and make sure file read as
follows for eth0 interface # vi /etc/sysconfig/network-scripts/ifcfgeth0 Modify/append directive as follows: DEVICE=eth0
USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes
BOOTPROTO=none
Open eth1 configuration file using vi text editor:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1Make sure file read as
follows for eth1 interface:
DEVICE=eth1 USERCTL=no ONBOOT=yes MASTER=bond0
SLAVE=yes BOOTPROTO=none
Save file and exit to shell prompt.
Step # 3: Load bond driver/module
Make sure bonding module is loaded when the channel-bonding
interface (bond0) is brought up. You need to modify kernel modules
configuration file:
# vi /etc/modprobe.conf Append following two lines:
alias bond0 bonding options bond0 mode=balance-alb miimon=100
Step # 4: Test configuration
First, load the bonding module: # modprobe bonding Restart
networking service in order to bring up bond0 interface: # service
network restart
Verify everything is working: # less /proc/net/bonding/bond0Output:
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
99} What is the meaning of Hard & soft mount option in NFS
server ?
Hard mount If the NFS file system is hard mounted, the NFS
daemons will try repeatedly to contact the server. The NFS daemon
retries will not time out, will affect system performance, and you
cannot interrupt them
Soft mount If the NFS file system is soft mounted, NFS will try
repeatedly to contact the server until either:
A connection is established
The NFS retry threshold is met
The nfstimeout value is reached
100} What is an inode ?
An inode is a data structure on a traditional Unix-style file system such
as UFS. An inode stores basic information about a regular file,
directory, or other file system object.
When a file system is created, data structures that contain
information about files are created. Each file has an inode and is
identified by an inode number (often i-number or even shorter,
ino) in the file system where it resides. Inodes store information on
files such as user and group ownership, access mode (read, write,
execute permissions)
and type of file. There is a fixed number of inodes, which indicates
the maximum number of files each filesystem can hold.
101} What is the role of udev daemon in Unix ?
udev is the device manager for the Linux 2.6 kernel series. Primarily, it
manages device nodes in /dev. It is the successor of devfs and hotplug,
which means that it handles the /dev directory and all user space
actions when adding/removing devices, including firmware load.
20
102} What is the difference between ext2 and ext3 file
systems?
The ext3 file system is an enhanced version of the ext2
file system.The most important difference between Ext2 and Ext3 is
that Ext3 supports journaling. After an unexpected power failure or
system crash (also called an unclean system shutdown), each mounted
ext2 file system on the machine must be checked for consistency by
the e2fsck program. This is a time-consuming process and during this
time, any data on the volumes is unreachable. The journaling provided
by the ext3 file system means that this sort of file system check is no
longer necessary after an unclean system shutdown. The only time a
consistency check occurs using ext3 is in certain rare hardware failure
cases, such as hard drive failures. The time to recover an ext3 file
system after an unclean system shutdown does not depend on the size
of the file system or the number of files; rather, it depends on the size
of the journal used to maintain consistency. The default journal size
takes about a second to recover, depending on the speed of the
hardware.
103} How are devices represented in UNIX?
All devices are represented by files called special files that are located
in /dev directory.
104} What is Super Block in Linux/Unix ?
Each file system is different and they have type like ext2, ext3
etc.Further eachfile system has size like 5 GB, 10 GB and status such
as mount status. In short each file system has a superblock, which
contains informationabout file system such as:
File system type
Size
Status
Information about other metadata structures
If this information lost, you are in trouble (data loss) so Linux
maintains multiple redundant copies of thesuperblock in every file
system. This is very important in many emergency situation, for
example you can usebackup copies to restore damaged primary super
block.
Following command displays primary and backup superblock location
on /dev/sda3:
# dumpe2fs /dev/hda3 | grep -i superblock
Q: What is the load average of the server and What is an
acceptable Server Load Average ?
The load average is the sum of the run queue length and the number of
jobs currently running on the CPUs. The three load-average values in
the first line of top output are the 1-minute, 5-minute and 15-minute
average. (These values also are displayed by other commands, such as
uptime, not only top.)
There are a few factors involved to determine the server average load.
If your server (s) use dual processors, the acceptable Server Load
Average is 2.00. This load is considered optimal.
105} What is Greylisting ?
Greylisting (or graylisting) is a method of defending e-mail users
against spam. A mail transfer agent (MTA) using greylisting will
temporarily reject any email from a sender it does not recognize. If
the mail is legitimate the originating server will, after a delay, try again
and, if sufficient time has elapsed, the email will be accepted. If the
mail is from a spam sender, sending to many thousands of email
addresses, it will probably not be retried.
NFS SERVER
1} Explain this entry /shared
192.168.1.0/255.255.255.0(sync,rw)
allows all systems with 192.168.1.* IP addresses read-write access to
the /shared/ directory:
2} What will happened if a space is given inbetween
allowed_hosts and (options)?
If a space is included, the options are applied to any and all IP
addresses, which can be quite dangerous if write permission is
granted.
3} What is the role of sync option for NFS server?
If sync is specified, the server waits until the request is written to disk
before responding to the client. The sync option is recommended
because it follows the NFS protocol.
4} How to retrieve a list of clients connected to the NFS
server ?
To retrieve a list of clients connected to the NFS server, use the
showmount command from a shell prompt. To also show the
directories the clients are connected to, use the showmount -a
command.
5} What is meaning of no_root_squash option ?
Treat remote root user as local root. Do not map requests from root to
the anony- mous user and group ID.
6} What is NFS ?
NFS stands for Network File System. NFS was originally developed by
Sun Microsystems in the 1980s. NFS allows remote hosts to mount
file systems over a network and interact with those file systems as
though they are mounted locally. This enables system administrators
to consolidate resources onto centralized servers on the network.
7} Which NFS versions are available ?
NFS Version 2 NFS Version 3 NFS Version 4
8} What is different between NFS Version 2 & 3 ?
nfs 2 default 8kb transfer rate,it did not check the authentication at
the time connection.client wants to access unauthorized file it shows
error messages like write error,read error nfs 3 32kb transfer rate.
It check at the time connection- ACL Support
9} Can we grant access by Username and password for nfs
share?
No, access is granted only for IP address.
10} What is the role of all_squash option?
Treat all client users as anonymous users. Map all user and group IDs
to the anonymous user and group ID.
11} What is the role of root_squash option?
All requests from the user root are translated or mapped as if they
came from the user anonymous (default).
12} Explain option all_squash?
The UID and GID of exported files are mapped to the user anonymous.
It is good for public directories.
13} Explain exportfs command?
home page it will be sent to the first IP address. The second user who
accesses the home page will be sent to the next IP address, and the
third user will be sent to the third IP address. In each case, once the IP
address is given out, it goes to the end of the list. The fourth user,
therefore, will be sent to the first IP address, and so forth.
7} What is Name Server?
A name server keeps information for the translation of domain names
to IP addresses and IP addresses to domain names. The name server is
a program that performs the translation at the request of a resolver or
another name server.
8} What is Primary name server or primary master server?
Primary name server/primary master is the main data source for the
zone. It is the authoritative server for the zone. This server acquires
data about its zone from databases saved on a local disk. The primary
server must be published as an authoritative name server for the
domain in the SOA resource record, while the primary master server
does not need to be published.
9}What is Secondary name server/slave name server?
Secondary name server/slave name server acquires data about the
zone by copying the data from the primary name server (respectively
from the master server) at regular time intervals. It makes no sense to
edit these databases on the secondary name servers, although they are
saved on the local server disk because they will be rewritten during
further copying.
10} what is Root name server?
Root name server is an authoritative name server for the root domain
(for the dot). Each root name server is a primary server, which
differentiates it from other name servers.
11} what is Stealth name server?
Stealth name server is a secret server. This type of name server is not
published anywhere. It is only known to the servers that have its IP
address statically listed in their configuration. It is an authoritative
server. It acquires the data for the zone with the help of a zone
transfer. It can be the main server for the zone. Stealth servers can be
used as a local backup if the local servers are unavailable.
I12} What do you mean by Resource Records?
Information on domain names and their IP addresses, as well as all
the other information distributed via DNS is stored in the memory of
name servers as Resource Records (RR).
13} Explain TTL?
Time to live. A 32-bit number indicating the time the particular RR
can be kept valid in a server cache. When this time expires, the record
has to be considered invalid. The value 0 keeps nonauthoritative
servers from saving the RR to their cache memory.
14} Tell me 5 Types of DNS records?
A, NS, CNAME, SOA, PTR, MX.
15} explain SOA Record?
The Start of Authority (SOA) record determines the name server that
is an authoritative source of information for the particular domain.
There is always only one SOA record in the file, and it is placed at the
beginning of the file of authoritative resource records.
16} what is A Record?
A (Address) records assign IP addresses to domain names of
computers. The IP address cannot have a dot at the end.
17} Explain CNAME Record?
Synonyms to domain names can be created using CNAME records.
This is often referred to as creating aliases for computer names.
18} What are HINFO and TXT Records?
HINFO and TXT records are for information only. An HINFO record
has two items in its data part. The first item is information about
hardware, and the second one is information about software. A TXT
record contains a general data string in its data part.
Example : test.com IN SOA mail IN A 192.1.1.2 IN HINFO
My_Server UNIX IN TXT my server
19} what are MX Records?
MX records specify the mailing server of the domain. An MX record
shows to which computer a mail of a particular domain should be sent.
The MX record also includes a priority number, which can be used to
determine several computers where the mail for the domain can be
sent. The first attempt is to deliver the mail to the computer with the
highest priority (lowest value). If this attempt fails, the mail goes to
the next computer (with a higher priority value), and so
on. test.com IN SOA mail IN A 192.1.1.2 IN HINFO AlphaServer
UNIX IN TXT my server IN MX 30 mail2.nextstep4it.com IN MX 20
mail3.nextstep4it.com IN MX 10 mail2.nextstep4it.com
share, the client is issued a tree connection ID (TID). The TID is used
in all requests to access files contained in the resource to which the
TID refers. In this way SMB protocol works.
14} How man sections samba configuration file (smb.conf)
contains?
smb.conf file contains three sections.
1. [global] Contains settings that determine Samba overall behavior. 2.
[homes] A default share for providing a home directory for all users. 3.
[printers] A default share for exporting all printers on the host via
CIFS.
15} If a netbios name is not defined in smb.conf, than what
will be netbios name?
If a netbios name is not defined, Samba will use the IP hostname of
the server by default.
16} I want to use User level security for my samba server
than what i have to add in smb.conf file?
security = user
17} How you will verify that your smb.conf file doesnt have
any mistakes and misspellings?
testparm tool that verifies the syntax of a configuration
file(smb.conf).
testparm -s smb.conf
18} What is the use of smbclient command?
smbclient is used to display the list of shares on your server. This
verifies that smbd is running and functioning correctly. The -L option
instructs smbclient to enumerate the shares on the server rather than
actually connecting to one. The -N switch instructs smbclient to use an
anonymous login rather than the login name of the current user.
smbclient -L localhost -N
Antother use of smbclient command to connect the samba share.
smbclient //<server>/<share> -U <username>
19} Explain smbstatus command?
The smbstatus utility displays information about connected users and
currently locked files.
20} Is it possible for Samba to share file systems that have
been mounted using NFS?
Yes. However, this can be problematic if the NFS server that provides
the file system fails, causing the Samba server to hang. It is always
safer to use Samba to share a local file system.
21} How many simultaneous connections can a Samba
server support?
In theory, there is no limit. In practice, the limit is determined by the
servers hardware, specifically the total amount of available RAM and
the CPU power. It might also depend on the amount of activity from
the smbd processes.
22} Can Samba be a member of more than one workgroup at
the same time?
No, Samba can be a member of only one workgroup.
23} What is SWAT?
SWAT is GUI Based administration tool for samba server.
24} I am trying to use SWAT, but I keep getting the message
There was no response. The server could be down or not
responding. What is the problem?
It will define the group id to be used for all file access in the place of
the users primary group.
Submitted By:-Varun Email-ID: [email protected]
: Explain force user parameter used in smb.conf?
It will define the user id to be used for all file access.
29} Explain write list parameter used in smb.conf?
A list of users and/or groups that should be given write access even if
the read only parameter has been enabled.
30} My clients are getting the error message that the Disk is
Full when trying to print to my Samba server, but there is
plenty of space. What is the problem?
If smbd is unable to write the spooled file to the directory defined by
the path parameter for a printer if the write permission were denied,
for example it would respond to the client with the message, Disk is
Full. Samba will also return this error message if the amount of free
disk space in the spool directory has fallen below the value specified by
the min print space parameter.
31} When I click on my Samba server in the network
neighborhood, I am continually prompted for a password to
the IPC$ share no matter what I enter.
The Windows client is attempting to use encrypted passwords.
However, the Samba server is configured to support only clear-text
passwords. You should either enable encrypted passwords on the
server or enable clear-text passwords on the Windows client.
32} Why is security = domain better than security = server?
There are three reasons why security = domain is better. The first is
because this method enables the Samba server to participate in
The sendmail.cf file includes options for the mail transmission agent
and accepts SMTP connections for sending email. The submit.cf file
configures the mail submission program.
10} How to configure sendmail to accept mail for local
delivery that is addressed to other hosts?
Create a /etc/mail/local-host-names file. Put into that file the
hostnames and domain names for which sendmail should accept mail
for local delivery. Enter the names with one hostname or domain
name per line. And also make sure that Sendmail configuration file
should contain use_cw_file option.
dnl Load class $=w with other names for the local host
FEATURE(`use_cw_file)
11} When an organization stores aliases on an LDAP server,
how you will configure sendmail to read aliases from the
LDAP server?
Use sendmail -bt -d0 command to check the sendmail compiler
options. If sendmail was not compiled with LDAP support, recompile
and reinstall sendmail.
Add an ALIAS_FILE define, containing the string ldap to the sendmail
configuration.
# Set the LDAP cluster value define(`confLDAP_CLUSTER,
`wrotethebook.com) # Tell sendmail that aliases are available via
LDAP define(`ALIAS_FILE, `ldap:)
12} How to forward emails of a local user to external
address?
Add an alias to the aliases file for each user whose mail must be
forwarded to another system. The recipient field of the alias entry
must be a full email address that includes the host part. After adding
the desired aliases, rebuild the aliases database file with the
newaliases command.
13} You have been asked to create a sendmail configuration
that sends all local mail to a mail hub, while directly
delivering mail addressed to external systems.
Create a sendmail configuration containing the MAIL_HUB define to
identify the mail relay host for local mail. Use the LOCAL_USER
command to exempt the root users mail from relaying.
dnl Define a relay server for local mail define(`MAIL_HUB,
`smtp.test.com) dnl Users whose mail is not passed to the mail hub
LOCAL_USER(root)
Rebuild and reinstall sendmail.cf, and then restart sendmail.
14} How to configure multiple mail queues?
mkdir /var/spool/mqueue/queue.1 mkdir
/var/spool/mqueue/queue.2 mkdir /var/spool/mqueue/queue.3
chmod 700 /var/spool/mqueue/queue.1 chmod 700
/var/spool/mqueue/queue.2 chmod 700 /var/spool/mqueue/queue.3
Add the QUEUE_DIR define to the sendmail configuration to use the
new queue directories.
dnl Declare the queue directory path define(`QUEUE_DIR,
`/var/spool/mqueue/queue.*)
15} How to disable certain SMTP commands?
Add the confPRIVACY_FLAGS define to the sendmail configuration to
set Privacy Options that disable unwanted, optional SMTP commands.
Here we will disables the EXPN, VRFY, VERB, and ETRN commands.
dnl Disable EXPN, VRFY, VERB and ETRN
define(`confPRIVACY_FLAGS, `noexpn,novrfy,noverb,noetrn)
Rebuild and reinstall sendmail.cf, and then restart sendmail.
QMAIL SERVER
directory and then install a fresh copy of Vpopmail. That should clear
it up.t qmail-scanner, I get an error that states: cant do suid. Whats
wrong?
Your server is not set up to allow for setuid execution of scripts. The
easiest way to fix this is to install the perl-suidperl package. If youre
running Redhat, you can download the latest RPM of perl-suidperl.
POSTFIX SERVER
the qmgr program can forward messages to the local, smtp, and pipe
programs.
7}Tell me about latest Version of Postfix on which u have
worked ?
postfix 2.6
8} What are the important files for postfix server ?
/etc/postfix/main.cf /etc/postfix/access /etc/postfix/aliases
9} Where postfix mail server logs created ?
/var/log/maillog
10} Explain the working of local mail submission for postfix?
When a local email message enters the postfix system. Local messages
are deposited into the maildrop directory of the Postfix queue by the
postdrop command, usually through the sendmail compatibility
program. The pickup daemon reads the message from the queue and
feeds it to the cleanup daemon. The cleanup daemon processes all
inbound mail and notifies the queue manager after it has placed the
cleaned-up message into the incoming queue. The queue manager
then invokes the appropriate delivery agent to send the message to its
next hop or ultimate destination.
11} What are the benefits of using SMTP AUTH?
Using SMTP AUTH we can make it possible for clients, colleagues, and
ourselves to relay messages from everywhere in the world using only
one (our) SMTP server.
Being a mobile user, we dont have to deal with the hassle to find a
SMTP server that permits us to relay.
We can make use of scripts and daemons that run on our server and
provide services that we need e.g. server-side virus scanning.
12} by using postconf command, how you will set fully
qualified hostname(mail4.test.com)?
# postconf -e myhostname=mail.example.com
The -e option tells postconf to edit the configuration with the
parameters and values specified.
13} Which command checks for configuration problems?
# postfix check
14} Which command checks for configuration problems?
# postfix check
15} How can I clear postfix mail server queue?
# postsuper -d ALL
16} How you will reload the postfix queue?
# postsuper -r ALL
17} Can postfix server configured with MySQL database?
Yes
18} which command is used to find out that postfix is
complied with mysql or not?
# postconf -m
nis regexp environ mysql btree unix hash
19} What steps required to get Postfix to connect to the
MySQL database?
APACHE SERVER
httpd-2.2.3
10} What do you mean by a valid ServerName directive?
The DNS system is used to associate IP addresses with domain names.
The value of ServerName is returned when the server generates a
URL. If you are using a certain domain name, you must make sure that
it is included in your DNS system and will be available to clients
visiting your site.
11} What is the main difference between <Location> and
<Directory> sections?
Directory sections refer to file system objects; Location sections refer
to elements in the address bar of the Web page
12} What is the difference between a restart and a graceful
restart of a web server?
During a normal restart, the server is stopped and then started,
causing some requests to be lost. A graceful restart allows Apache
children to continue to serve their current requests until they can be
replaced with children running the new configuration.
13} What is the use of mod_perl module?
mod_perl scripting module to allow better Perl script performance
and easy integration with the Web server.
14}If you have added loglevel Debug in httpd.conf file,
than what will happen?
It will give you more information in the error log in order to debug a
problem.
20} If you have to more than one URL map to the same
directory but you dont have multiple Alias directives. What
you will do?
In this case I will use AliasMatch directives. The AliasMatch
directive allows you to use regular expressions to match arbitrary
patterns in URLs and map anything matching the pattern to the
desired URL.
21} How you will put a limit on uploads on your web server?
This can be achieved by LimitRequestBody directive.
<Directory /var/www/html/data_uploads> LimitRequestBody
100000 </Directory>
Here I have put limit of 100000 Bytes
22} I want to stop people using my site by Proxy server. Is it
possible? <Directory proxy:http://www.test.com/myfiles> Order
Allow,Deny
Deny from all Satisfy All </Directory>
23} What is mod_evasive module?
mod_evasive is a third-party module that performs one simple task,
and performs it very well. It detects when your site is receiving a
Denial of Service (DoS) attack, and it prevents that attack from doing
as much damage. mod_evasive detects when a single client is making
multiple requests in a short period of time, and denies further requests
from that client. The period for which the ban is in place can be very
short, because it just gets renewed the next time a request is detected
from that same host.
24}How t to enable PHP scripts on your server?
JNDI has classes provided by SUN that will help ur appln interact with
and LDAP server. JNDI appln work similarly to JDBC applns once and
be free to use drivers from different vendors. SUN provides the
driver that will help interact with the LDAP server. Sun also provides
drivers for other naming services (like CORBA).
9} Why LDAP is called light weight?
LDAP (Lightweight Directory Access Protocol) is a protocol for
communications between LDAP servers and LDAP clients. LDAP
servers store directories which are access by LDAP clients. LDAP is
called lightweight because it is a smaller and easier protocol which was
derived from the X.500 DAP (Directory Access Protocol) defined in
the OSI network protocol stack.
10} what is SLAPD?
SLAPD stands for Stand-Alone LDAP.Clients connect to the server
over the LDAP protocol, usually using a network-based connection
(though SLAPD provides a UNIX socket listener).
11} Which daemons are required for LDAP server?
slapd and slurpd
12}Tell me the name of three LDAP Client utilities or
Applications
ldapsearch ldapadd ldapmodify
13} Define Schemas?
Schemas provide definitions of the different object classes and
attribute types that OpenLDAP should support. Using these,
SQUID SERVER
1} On Which port Proxy server work ? Can we change proxy
server port ?
By default proxy server runs on 3128 port. yes we can change proxy
server port.
vi /etc/squid/squid.conf http_port 3128
2} How to block Some domains by Squid server ?
Make a file
vi /etc/squid/bad_domains
.xxx.com .abcd.com .sexy.com
Now make following changes in Squid.conf file
acl BAD_DOMAINS dstdom_regex -i /etc/squid/bad_domains
http_access deny BAD_DOMAINS
3} How to clear Cache in Squid proxy? Firstly stop squid server.
service squid stop
rm -rf /var/lib/squid/cache/*
squid -z
4} How to restart squid server ?
service squid restart
5} What is the name of main configuration file for Squid
server ?/etc/squid/squid.conf
6} How to restrict web access by Time ?
acl MY_TIME time M T W H F 9:00-17:00
http_access allow MY_TIME
7} What is Squid ?
SQUID is a webcache and proxy server for Linux and UNIX. Users
configure their web browsers to use the Squid proxy server instead of
going to the web directly. The Squid server then checks its web cache
for the web information requested by the user. It will return any
matching information that finds in its cache, and if not, it will go to the
web to find it on behalf of the user. Once it finds the information, it
will populate its cache with it and also forward it to the users web
browser.
recompile your functions into the application so that you will always
have them, no matter how many times you install.
3} Do all unique keys have to be primary keys?
No. MySQL permits only one primary key per table, but there may be a
number of unique keys. Both unique keys and primary keys can speed
up the selecting of data with a WHERE clause, but a column should be
chosen as the primary key if this is the column by which you want to
join the table with other tables.
4} How many databases can one MySQL RDBMS contain?
Because MySQL uses the file system of the operating system, there
really is no limit to the number of databases contained within a single
MySQL RDBMS. The size of the database is limited by the operating
system. The database tables can only be as big as the OSs file system
will allow.
5} I want to sort the values of my ENUM and SET columns.
How do I do this? The sort order depends on the order in which the
values were inserted. ENUM and SET types are not case sensitive. The
value that is inserted reverts to the value that you used when you
created the ENUM or SET.
6} What can I do with the contents of a mysqldump file?
This file is a complete replica of your database in SQL format. You can
do a lot of things with this data. You could re-create your database in
Microsoft SQL Server or Sybase by simply cutting and pasting the
contents of the file. You could also restore your database by using the
dump file and the batching ability of the mysql program.
7} What are features of MYSQL?
database. There are three file types: .ISM, .FRM, and .ISD. The .FRM
file contain the table schema. The .ISD is the file that actually holds
the data. The .ISM file is the file that provides quick access between
the two of them.
10} Explain the terms mysqlimport, mysqldump,
mysqladmin and mysqlcheck?
mysqlimport for importing data files, mysqldump for making backups,
mysqladmin for server administration, and mysqlcheck for checking
the integrity of the database files.
11} How you will determine the options which are used by
mysql?
#mysql help
12} How you will determine the version of MySQL?
mysql version
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using
readline 5.1
13} How you will connect to the server at a specific IP
address with username and password?
mysql host=10.168.1.33 user=NAME password=PASSWORD
14} What do you think about this command mysql>
STATUS;
It will display information about the current connection to the server,
as well as status information about the server itself.
15} Have you used this command mysql> HELP contents;?
Yes, You can get server-side help from this command.
mysql> HELP contents;
structure and contents. It works for MyISAM and InnoDB tables. For
MyISAM tables, it also updates the index statistics. If the table is a
view, CHECK TABLE verifies the view definition.
20} Explain REPAIR TABLE statement?
The REPAIR TABLE statement corrects problems in a table that has
become corrupted. It works only for MyISAM tables.
21} Explain ANALYZE TABLE statement?
The ANALYZE TABLE statement updates a table with information
about the distribution of key values in the table. This information is
used by the optimizer to make better choices about query execution
plans. This statement works for MyISAM and InnoDB tables.
22} Explain OPTIMIZE TABLE statement?
The OPTIMIZE TABLE statement cleans up a MyISAM table by
defragmenting it. This involves reclaiming unused space resulting
from deletes and updates, and coalescing records that have become
split and stored non-contiguously. OPTIMIZE TABLE also sorts the
index pages if they are out of order and updates the index statistics.
23}What is mysqlcheck Client Program?
mysqlcheck checks, repairs, analyzes, and optimizes tables. It can
perform all these operations on MyISAM tables, and can perform
some of them on InnoDB tables. It provides a command-line interface
to the various SQL statements that instruct the server to perform table
maintenance, such as CHECK TABLE and REPAIR TABLE.
24} What is myisamchk Utility?
The myisamchk utility performs table maintenance on MyISAM
tables.
8} What is Jasper?
Jasper is a program to read the .class files in binary format. This
program can generate ASCII files , which can be used along with
Jasmin Assembler. Jasper is intended for generating input into a class
file browser which can produce the hierarchy of inheritance and
composition maps from the .class files.
9}Can I set Java system properties differently for each
webapp?
No. If you can edit Tomcats startup scripts, you can add -D options
to Java. But there is no way to add such properties in web.xml or the
webapps context.
74
75