linux interview notes

Upload: manuatrey1

Post on 02-Jun-2018

269 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Linux Interview Notes

    1/51

    Linux Interview Questions

    Q: - How are devices represented in UNIX?

    All devices are represented by files called special files that are located in /dev directory.

    Q: - What is 'inode'?

    All UNIX files have its description stored in a structure called 'inode'. he inode contains info about the file!si"e# its location# ti$e of last access# ti$e of last $odification# per$issionand so on. %irectories are also represented as files and have an associated inode.

    Q: - What are the process states in Unix?

    As a process executes it chan&es state accordin& to its circu$stances. Unix processes have the followin& states(unnin& he process is either runnin& or it is ready to run .)aitin& he process is waitin& for an event or for a resource.*topped he process has been stopped# usually by receivin& a si&nal.Zombie : The process is dead b t have not been removed !rom the process tab"e#

    Q: - What command sho "d $o se to chec% the n mber o! !i"es and dis% space sed and each ser's de!ined & otas?

    rep+uota

    Q: - What command is sed to remove the password assi ned to a ro p?

    &passwd ,r

    Q: - What can $o t$pe at a command "ine to determine which she"" $o are sin ?

    echo -* LL

    Q: - Write a command to !ind a"" o! the !i"es which have been accessed within the "ast () da$s#

    find / !type f !ati$e !01 2 filena$e.txt

    Q: - What is a *ombie?

    3o$bie is a process state when the child dies before the parent process. In this case the structural infor$ation of the process is still in the process table.

    Q: - What daemon is responsib"e !or trac%in events on $o r s$stem?

    syslo&d

  • 8/11/2019 Linux Interview Notes

    2/51

    Linux Interview QuestionsQ: - What do $o mean a +i"e ,$stem?

    4ile *yste$ is a $ethod to store and or&ani"e files and directories on dis5. A file syste$ can have different for$ats called file syste$ types. hese for$ats deter$ine how theinfor$ation is stored as files and directories.

    Q: - Te"" me the name o! director$ str ct re hierarch$ !or in x

    /root

    /boot/bin/sbin/proc/$nt/usr /var /lib/etc/dev/opt/srv/t$p/$edia

    Q: - What does .boot director$ contains?

    he /boot/ directory contains static files re+uired to boot the syste$# such as the Linux 5ernel# boot loader confi&uration files. hese files are essential for the syste$ to boot properly.

    Q: - I! some one de"etes .boot director$ !rom $o r server/ than what wi"" happen?

    In that case your server will be in unbootable state. 6our *erver can7t boot without /boot directory because this directory contains all bootable files

    Q: - What does .dev director$ contain?

    he /dev directory contains all device files that are attached to syste$ or virtual device files that are provided by the 5ernel.

    Q: - What is the ro"e o! dev daemon?

    he udev de$on used to create and re$ove all these device nodes or files in /dev/ directory.

    Q: - What %ind o! !i"es or nodes .dev. director$ contains and how do I access or see device !i"es?

    0"oc% 1evice +i"es:-

  • 8/11/2019 Linux Interview Notes

    3/51

    Linux Interview Questions8loc5 device files tal5s to devices bloc5 by bloc5 9: bloc5 at a ti$e ;: bloc5 < =:> bytes to 0>?8@ .

    xa$ples ! U*8 dis5# B%(CD# ard %is5

    E ls /dev/sdF brw!rw!!!! : root root G# 1 Dar := >11H sda brw!rw!!!! : root root G# : Dar := >11H sda: brw!rw!!!! : root root G# > Dar := >11H sda> brw!rw!!!! : root root G# 0 Dar := >11H sda0

    brw!rw!!!! : root root G# Dar := >11H sda brw!rw!!!! : root root G# :J Dar := >11H sdbBharacter %evice 4iles !

    Bharacter device files tal5 to devices character by character.xa$ples ! Kirtual ter$inals# ter$inals# serial $ode$s# rando$ nu$bers

    2"s .dev.tt$3crw!rw!!!! : root root # J Dar := >11H tty*1crw!rw!!!! : root root # J= Dar := >11H tty*:crw!rw!!!! : root root # JJ Dar := >11H tty*>crw!rw!!!! : root root # J Dar := >11H tty*0

    Q: - Te"" me the name o! device !i"e !or 4,.5 mo se connection#

    /dev/psaux

    Q: - Te"" me the name o! device !i"e !or para""e" port 64rinters7#

    /dev/lp1

    Q: - What does .etc.X88. director$ contains?

    he /etc/X::/ directory is for X )indow *yste$ confi&uration files# such as xor&.conf.

    Q: - What does .etc.s%e"" director$ contains?

    he /etc/skel directory contains files and directories that are auto$atically copied over to a new user's home directory when such user is created by the useradd or adduser co$$and.

    Q: - Te"" me name o! in x +i"e s$stems?

    xt>xt0

  • 8/11/2019 Linux Interview Notes

    4/51

    Linux Interview QuestionsQ: - What is the di!!erence between ext5 and ext( !i"e s$stems?

    he ext0 file syste$ is an enhanced version of the ext> file syste$.he $ost i$portant difference between xt> and xt0 is that xt0 supports Mournalin&.

    After an unexpected power failure or syste$ crash ;also called an unclean system shutdown @# each $ounted ext> file syste$ on the $achine $ust be chec5ed for consistency by thee>fsc5 pro&ra$. his is a ti$e!consu$in& process and durin& this ti$e# any data on the volu$es is unreachable.

    he Mournalin& provided by the ext0 file syste$ $eans that this sort of file syste$ chec5 is no lon&er necessary after an unclean syste$ shutdown. he only ti$e a consistency chec5occurs usin& ext0 is in certain rare hardware failure cases# such as hard drive failures. he ti$e to recover an ext0 file syste$ after an unclean syste$ shutdown does not depend on the

    si"e of the file syste$ or the nu$ber of files rather# it depends on the si"e of the journal used to $aintain consistency. he default Mournal si"e ta5es about a second to recover#dependin& on the speed of the hardware.

    Q: - 9n$ idea abo t ext !i"e s$stem?

    he ext or fourth extended filesyste$ is a Mournalin& file syste$ developed as the successor to ext0. xt filesyste$ released as a functionally co$plete and stable filesyste$ inLinux with 5ernel version >.J.>G.4eatures of ext file syste$ !:. Burrently# xt0 supports :J 8 of $axi$u$ file syste$ si"e and > 8 of $axi$u$ file si"e. xt have : 8 of $axi$u$ file syste$ si"e and :J T0 of $axi$u$ file si"e.9An ;0 or exabyte is :1:G bytes or :#1 G#= J 8>. 4ast fsc5 chec5 than ext00 In xt the Mournalin& feature can be disabled# which provides a s$all perfor$ance i$prove$ent.

    . Cnline defra&$entation.=. %elayed allocation

    xt uses a filesyste$ perfor$ance techni+ue called allocate!on!flush# also 5nown as delayed allocation. It consists of delayin& bloc5 allocation until the data is &oin& to be written tothe dis5# unli5e so$e other file syste$s# which $ay allocate the necessary bloc5s before that step.Q: - How we create ext( !i"e s$stem on .dev.sda< dis%?

    E $5fs ,M /dev/sda

    Q: - =an we convert ext5 !i"es$stem to ext( !i"e s$stem?

    6es# we can convert ext> to ext0 file syste$ by tune>fs co$$and. tune>fs ,M /dev/O8loc5!%evice!Na$e2

    Q: - Is there an$ data "ose d rin conversion o! ext5 !i"es$stem to ext( !i"es$stem?

    No

    Q: - How we wi"" create ext !i"e s$stem?

    E $5e>fs !t ext /dev/% K

    Q: - ;xp"ain .proc !i"es$stem?

  • 8/11/2019 Linux Interview Notes

    5/51

    Linux Interview Questions/proc is a virtual filesyste$ that provides detailed infor$ation about Linux 5ernel# hardware7s and runnin& processes. 4iles under /proc directory na$ed as Kirtual files. 8ecause /proccontains virtual files that7s why it is called virtual file syste$.

    hese virtual files have uni+ue +ualities. Dost of the$ are listed as "ero bytes in si"e. Kirtual files such as /proc/interrupts# /proc/$e$info# /proc/$ounts# and /proc/partitions providean up!to!the!$o$ent &li$pse of the syste$'s hardware. Cthers# li5e the /proc/filesyste$s file and the /proc/sys/ directory provide syste$ confi&uration infor$ation and interfaces.

    Q: - =an we chan e !i"es parameters p"aced nder .proc director$?

    6es

    o chan&e the value of a virtual file# use the echo co$$and and a &reater than sy$bol ;2@ to redirect the new value to the file. 4or exa$ple# to chan&e the hostna$e on the fly# type

    echo www.nextstep it.co$ 2 /proc/sys/5ernel/hostna$e

    Q: - What is the se o! s$sct" command?

    he /sbin/sysctl co$$and is used to view# set# and auto$ate 5ernel settin&s in the /proc/sys/ directory

    Q: - .proc. director$ contains a n mber o! directories with n merica" names# What is that?

    hese directories are called process directories # as they are na$ed after a pro&ra$'s process I% and contain infor$ation specific to that process.

    Q: - What is >9I1?

    (AI%# stands for (edundant Array of Inexpensive %is5s. (AI% is a $ethod by which sa$e data or infor$ation is spread across several dis5s# usin& techni+ues such as dis5 stripin&;(AI% Level 1@# dis5 $irrorin& ;(AI% Level :@# and dis5 stripin& with parity ;(AI% Level =@ to achieve redundancy# lower latency# increased bandwidth# and $axi$i"ed ability torecover fro$ hard dis5 crashes.

    Q: - Wh$ sho "d we se >9I1?

    *yste$ Ad$inistrators and others who $ana&e lar&e a$ounts of data would benefit fro$ usin& (AI% technolo&y.4ollowin& are the reasons to use (AI%! nhances speed! Increases stora&e capacity usin& a sin&le virtual dis5! Dini$i"es dis5 failure

    Q: - What is the di!!erence between hardware >9I1 and ,o!tware >9I1?

    he hardware!based (AI% is independent fro$ the host. A ardware (AI% device connects to the *B*I controller and presents the (AI% arrays as a sin&le *B*I drive. An external(AI% syste$ $oves all (AI% handlin& Pintelli&enceP into a controller located in the external dis5 subsyste$. he whole subsyste$ is connected to the host via a nor$al *B*Icontroller and appears to the host as a sin&le dis5.*oftware (AI% is i$ple$ented under C* ?ernel level. he Linux 5ernel contains an D% driver that allows the (AI% solution to be co$pletely hardware independent. he

    perfor$ance of a software!based array depends on the server B U perfor$ance and load.

  • 8/11/2019 Linux Interview Notes

    6/51

    Linux Interview QuestionsQ: - What are the common"$ sed >9I1 t$pes?

    (AI% 1(AI% :(AI% =

    Q: - ;xp"ain >9I1 )?

    (AI% level 1 wor5s on Rstripin&S techni+ue. In (AI% 1 the array is bro5en down into strips and data is written into strips. (AI% 1 allows hi&h I/C perfor$ance but provides noredundancy. (AI% 1 Array *i"e is e+ual to su$ of dis5s in array. If one drive fails then all data in the array is lost.

    Q: - ;xp"ain >9I1 8?

    (AI% Level : is based on Dirrorin& techni+ue. Level : provides redundancy by writin& identical data to each $e$ber dis5 of the array. he stora&e capacity of the level : array ise+ual to the capacity of one of the $irrored hard dis5s in a ardware (AI% or one of the $irrored partitions in a *oftware (AI%. (AI% : provides redundancy $eans &ood protectiona&ainst dis5 failure. In (AI% : write speed is slow but read speed is &ood.

    Q: - ;xp"ain >9I1 ?

    (AI% Level = is based on rotatin& parity with stripin& techni+ue. (AI%!= stores parity infor$ation but not redundant data ;but parity infor$ation can be used to reconstruct data@. hestora&e capacity of *oftware (AI% level = is e+ual to the capacity of the $e$ber partitions# $inus the si"e of one of the partitions if they are of e+ual si"e. he perfor$ance of (AI%= is based on parity calculation process but with $odern B Us that usually is not a very bi& proble$. In (AI% = read and write speeds are &ood.

    Q: - Which %erne" mod "e is re& ired !or ,o!tware >9I1?

    R$dS $odule

    Q: - which ti"it$ or command is sed !or creatin so!tware >9I1@s !or >H; ?

    $dad$

    Q: - =an we create so!tware >9I1 d rin in x insta""ation?

    6es# we can create *oftware (AI% durin& Linux Installation by R 1is% 1r idA

    Q: - What is the ro"e o! ch n% si*e !or so!tware >9I1?

    Bhun5 si"e is very i$portant para$eter on which (AI% perfor$ance based.)e 5now stripes &o across dis5 drives. 8ut how bi& are the pieces of the stripe on each dis5T he pieces a stripe is bro5en into are called chun5s. o &et &ood perfor$ance you $usthave a reasonable chun5 si"e.4or bi& I/Cs we re+uired s$all chun5s and for s$all I/Cs we re+uired bi& chun5s.

  • 8/11/2019 Linux Interview Notes

    7/51

    Linux Interview QuestionsQ: - What is ,W94 ,pace?

    Swap space in Linux is used when the a$ount of physical $e$ory ;(AD@ is full. If the syste$ needs $ore $e$ory resources and the (AD is full# inactive pa&es in $e$ory are$oved to the swap space. )hile swap space can help $achines with a s$all a$ount of (AD# it should not be considered a replace$ent for $ore (AD. *wap space is located on harddrives# which have a slower access ti$e than physical $e$ory.

    Q: - What are the steps to create ,W94 !i"es or 4artition?

    ! Breate swap partition or file! )rite special si&nature usin& R m%swap S! Activate swap space by R swapon Ba S co$$and! Add swap entry into /etc/fstab file

    Q: - How $o wi"" create swap !i"e o! si*e C0 and exp"ain swap !i"e entr$ in .etc.!stab !i"e?

    Use RddS co$$and to create swap file.dd if

  • 8/11/2019 Linux Interview Notes

    8/51

    Linux Interview Questionsprint

    o resi"e the partition# use the resi"e co$$and followed by the $inor nu$ber for the partition# the startin& place in $e&abytes# and the end place in $e&abytes. 4or exa$pleresi"e 0 :1> >1 GAfter resi"in& the partition# use the print co$$and to confir$ that the partition has been resi"ed correctly# is the correct partition type# and is the correct file syste$ type.

    Q: - What is EF?

    LKD stands for Lo&ical Kolu$e Dana&er. LKD# is a stora&e $ana&e$ent solution that allows ad$inistrators to divide hard drive space into physical volu$es ; K@# which can then be

    co$bined into lo&ical volu$e &roups ;K @# which are then divided into lo&ical volu$es ;LK@ on which the filesyste$ and $ount point are created.

    Q: - What are the steps to create EF?

    ! Breate physical volu$es by RpvcreateS co$$andEpvcreate /dev/sda>! Add physical volu$e to volu$e &roup by Rv&createS co$$andEv&create KL 1 /dev/sda>! Breate lo&ical volu$e fro$ volu$e &roup by RlvcreateS co$$and.Elvcreate !L : !n LKD: KL 1

    Now create file syste$ on /dev/sda> partition by R$5e>fsS co$$and.E$5e>fs !M /dev/KL 1/LKD:

    Q: - What is the di!!erence between EF and >9I1?

    (AI% provides redundancy but LKD doesn7t provide (edundancy.

    Q: - What are EF8 and EF5?

    LKD: and LKD> are the versions of LKD.LKD> uses device $apper driver contained in >.J 5ernel version.LKD : was included in the >. series 5ernels.

    Q: - What is Eo" me ro p 6EC7?

    he Kolu$e roup is the hi&hest level abstraction used within the LKD. It &athers to&ether a collection of Lo&ical Kolu$es and hysical Kolu$es into one ad$inistrative unit.

    Q: - What is ph$sica" extent 64;7?

    ach physical volu$e is divided chun5s of data# 5nown as physical extents these extents have the sa$e si"e as the lo&ical extents for the volu$e &roup.

    Q: - What is "o ica" extent 6 ;7?

    ach lo&ical volu$e is split into chun5s of data# 5nown as lo&ical extents. he extent si"e is the sa$e for all lo&ical volu$es in the volu$e &roup.

  • 8/11/2019 Linux Interview Notes

    9/51

    Linux Interview QuestionsQ: - ;xp"ain EF snapshot?

    LKD snapshots allow the ad$inistrator to create a new bloc5 device which presents an exact copy of a lo&ical volu$e# fro"en at so$e point in ti$e.

    Q: - How $o wi"" chec% on Go r server or s$stem device-mapper is insta""ed or not?

    Bhec5 the followin& file.Ecat /proc/$isc

    if this file contains Pdevice!$apperP ter$ it $eans device $apper is installed on your syste$.

    Q: - How are snapshots in EF5 di!!erent !rom EF8?

    In LKD> snapshots are read/write by default# whereas in LKD:# snapshots were read only.

    Q: - What is the maxim m si*e o! a sin "e E?

    4or >. based 5ernels# the $axi$u$ LK si"e is > 8.4or 0>!bit B Us on >.J 5ernels# the $axi$u$ LK si"e is :J 8.4or J !bit B Us on >.J 5ernels# the $axi$u$ LK si"e is G 8.

    Q: - I! a vo" me ro p named as EC) a"read$ exists b t i need to extend this vo" me ro p p to C0#;xp"ain a"" steps?

    4irstly create hysical volu$e ;/dev/sda @ of si"e 8. Now run followin& co$$and.

    v&extend K 1 /dev/sda

    Q: - I! a vo" me ro p EC) have ( 4E's 6.dev.sda / .dev.sdafs /dev/Ov&na$e2/Olvna$e2

    Q: - Te"" me a"" steps to remove a EF?

    o re$ove a lo&ical volu$e fro$ a volu$e &roup# first un$ount it with the u$ount co$$andu$ount /dev/Ov&na$e2/Olvna$e2and then use the lvre$ove co$$andlvre$ove /dev/Ov&na$e2/Olvna$e2

  • 8/11/2019 Linux Interview Notes

    10/51

    Linux Interview QuestionsQ: - Which command is sed to create EF ,napshot?

    vcreate !!si"e Osi"e2 !s !n Osnapshotna$e2 Olvna$e2he lvcreate co$$and is used to create a new lo&ical volu$e# $eanin& there $ust be

    free physical extents in the lo&ical volu$e &roup to create a snapshot. he !s option$eans that the LK is a snapshot# Osnapshotna$e2 is the na$e of the new LK created# andOlvna$e2 is the na$e of the LK fro$ which to create the snapshot.

    Q: - Is there an$ re"ation between modprobe#con! !i"e and networ% devices?

    6es# his file assi&ns a 5ernel $odule to each networ5 device.4or xa$ple !9rootWlocalhost E cat /etc/$odprobe.conf alias eth1 b

    ere b is the 5ernel $odule for networ5 device eth1.)e can Bonfir$ by followin& co$$and ; his $odule Rb S is present or [email protected] E ls$od Y&rep b

    b >H11= 1

    Q: - What is the "ocation o! Jnetwor%J !i"e and what does this contains?

    location ! /etc/sysconfi&/networ5 his file contains followin& fields

    N )C(?IN

  • 8/11/2019 Linux Interview Notes

    11/51

    Linux Interview QuestionsQ: - Which protoco" is re& ired to a""ow "oca" printin and print sharin ?

    Internet rintin& rotocol ;I @ is re+uired to allow local printin& and print sharin&.

    Q: - What is =U4,?

    BU * stands for PBo$$on UNIX rintin& *yste$P. BU * is a open source printin& syste$ developed by Apple Inc. BU * uses the Internet rintin& rotocol ;I @ to allow local printin& and print sharin&.

    Q: -What is the "ocation o! "o !i"es !or =U4,?

    he lo& files for the BU * printin& syste$ are located in the /var/lo&/cups/ directory.

    Q: - What is GUF?

    6UD stands for 6ellow do& Updater# Dodified because it is based on 6U # the 6ellow do& Updater. )here does the na$e 6ellow do& co$e fro$T 6ellow %o& is a version of Linuxfor the ower Architecture hardware and is ( D!based# Must li5e (ed at nterprise Linux and 4edora. 6U # and later 6UD# were written by the Linux co$$unity as a way to$aintain an ( D!based syste$.

    Q: - What are the advanta es o! GUF?

    ! Auto$atic resolution of software dependencies.! Dultiple software locations at one ti$e.! Ability to specify particular software versions or architectures.

    Q: - How $o wi"" insta"" so!tware b$ GUF?

    yu$ install Op5&na$e2

    Q: - Which option is re& ired to ass me the answer J$esJ to an$ & estions as%ed d rin insta""ation o! pac%a e dependencies !or GUF?

    he P!yP option is used to assu$e the answer PyesP.4or xa$pleyu$ !y install s+uid

    Q: - How to remove a so!tware b$ GUF?

    yu$ re$ove Op5&na$e2

    Q: - How Fan$ > n eve"s present in in x?

    here are run levels# with each havin& its own properties.

  • 8/11/2019 Linux Interview Notes

    12/51

    Linux Interview Questions! 1 alt the syste$! : *in&le!user $ode! > Not used! 0 Dulti!user $ode with text lo&in! Not used! = Dulti!user $ode with &raphical lo&in! J (eboot

    Q: - Which con!i ration !i"e is re& ired to chan e the > n eve" o! ,erver or s$stem?

    /etc/inittabo chan&e the default run level# $odify this line.

    id = initdefault

    Q: - ;xp"ain architect res re& ired !or >4Fs?

    noarch Architecture!independent# can run on any architecturei0GJ eneric build for a 0>!bit xGJ syste$i=GJ *o$eti$es used when buildin& 5ernels for older xGJ processorsIntel[ entiu$ [ II# Intel entiu$ III# Intel entiu$ # AD% Athlon# andiJGJ AD% %uron syste$s ;Dost ( Ds for these architectures are built usin& the i0GJ architecture# with the 5ernel for these architectures bein& built with the

    iJGJ for opti$al perfor$ance.@xGJZJ J !bit processors such as AD% AthlonJ # AD% Cpteron# and Intel DJiaJ Intel[ Itaniu$

    ppc 0>!bit I8D[ C) (# I8D e*erver\ p*eries[# and I8D e*erver i*eriess0H1x J !bit I8D e*erver *yste$ "

    Q: - How to insta"" in x so!tware@s b$ >4F?

    rp$ !ivh test!:.1!:.i0GJ.rp$test EEEEEEEEEEEEEEEEEEEEEEEEE 9:11]

    Q: - I! a !i"e associated with test-8#)-8#i( #rpm de"eted/ than How we wi"" recover that !i"e?

    )e can reinstall this rp$ a&ain.

    Q: - I! $o are ettin error Jpac%a e is a"read$ insta""edJ b t $o have to insta"" pac%a e an$ how# what option $o wi"" se?

    rp$ !ivh test!:.1!:.i0GJ.rp$reparin&... EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 9:11] pac5a&e test!:.1!: is already installed

    In this case you can use P!!replacep5&sP option.rp$ !ivh ,replacep5&s test!:.1!:.i0GJ.rp$

  • 8/11/2019 Linux Interview Notes

    13/51

    Linux Interview QuestionsQ: - Which options are re& ired to p rade a >4F?

    Up&radin& a pac5a&e is si$ilar to installin& one. ype the followin& co$$and at a shell pro$ptrp$ !Uvh test!>.1!:.i0GJ.rp$

    Q: - In which director$ >4F database stored?

    /var/lib/rp$

    Q: - ;xp"ain the command Jrpm -&aJ?

    It will +ueries all currently installed pac5a&es.

    Q: - ;xp"ain the command Jrpm -&! J?

    it +ueries the ( D database for which pac5a&e owns Ofilena$e2. )hen specifyin& a file# specify the absolute path of the file.

    Q: - How to veri!$ a"" insta""ed pac%a es?

    rp$ ,Ka

    Q: - How to veri!$ the si nat re o! an rpm?

    rp$ !? test!:.1!:.i0GJ.rp$

    Q: - How to "ist 4=I 1evices on $o r server or ,$stem?

    use PlspciP co$$and.

    Q: - What is the ro"e o! JK d* J?

    ?ud"u is used to %etect new ardware

    Q: - What happens when $o add a new device a!ter insta""ation?

    he ?ud"u pro&ra$ runs each ti$e the syste$ boots and perfor$s a hardware probe. If new hardware is found# ?ud"u atte$pts to $ap it to a 5ernel $odule. If successful# theinfor$ation is saved# and the device is confi&ured.

    Q: - How to ;nab"e 9= s !or .home partition?

    Add followin& entry in /etc/fstabLA8 L

    Now re$ount /ho$e partition with acl option.

  • 8/11/2019 Linux Interview Notes

    14/51

    Linux Interview Questions$ount !t ext0 !o acl /dev/sda0 /ho$e

    Q: - How to Eiew 9= s !or a !i"e6testL!i"e7?

    &etfacl testZfile

    Q: - How to remove an 9= ?

    setfacl !!re$ove!all Ofile!na$e2

    Q: - What is the di!!erence between pop( and imap protoco"s ?

    4M4( ; ost Cffice rotocol@ is the $ost co$$only used internet $ail protocol.It wor5s on ::1 port. It is easy to confi&ure and use. )ith a C account you download the $ail toyour local co$puter and 5eep it there. Dost of the ti$e it &ets deleted off of the $ail server after bein& downloaded. Cne disadvanta&e of C is that once you download it to yourco$puter you won't be able to chec5 your $ail fro$ a different co$puter since it will already be downloaded onto your own co$puter. It tends to be slower than IDA as well.IF94 ;Internet Dessa&e Access rotocol@ uses a $ethod where all the $ailboxes and $essa&es are $aintained on the server. herefore you can access your e!$ail fro$ any locationwith an internet connection. IDA is faster than C because the $ail client reads all of the $essa&e headers without havin& to download the entire $essa&e. IDA is also supportedin a variety of clients Must li5e C . Cne thin& to 5eep in $ind is the a$ount of dis5 space allocated to your $ail on the server $ay not be enou&h to hold all of your $ail.IDAsupports the folder synchroni"ation option e.& if you create any folder on the client $/c in outloo5;$ail client@ then that folder will auto$atically created on the $ailserver for theaccount

    C wor5s best when you are usin& only a sin&le co$puter# since you don7t have to worry about chec5in& your e!$ail fro$ $ultiple locations. lus it is faster as well.

    IDA would suit you better if you need to chec5 your e!$ail fro$ $ultiple locations if you travel a lot. o use IDA your I* /$ail provider $ust offer that type of account.

    Q: - How to 1isab"e a User 9cco nt in in x ?

    E passwd Ouserna$e2 !l his $i&ht be useful in the situation where you don7t want to per$anently re$ove the user# but you Must want it disabled and no lon&er able to use the syste$. he user will stillreceive e$ails for exa$ple# but he will not be able to lo&in and chec5 the$ out.

    o re!enable the account #Must use below co$$andE passwd Ouserna$e2 !u

    Q: - How to detect =4U architect re.bitmode 6(5-bit or -bit7 !or in x ?

    2 cat /proc/cpuinfo Y &rep fla&syou will find one of the$ with na$e Pt$;transparent $ode@P orPr$;real $ode@P or Pl$;lon& $ode@P

    :. r$ tells #it is a :J bit processor >. t$ tells# it is a 0> bit processor 0. l$ tells# it is a J bit processor

    Q: - What is the di!!erence between ,,H and Te"net ?

  • 8/11/2019 Linux Interview Notes

    15/51

    Linux Interview Questionshe ri$ary difference between ** and elnet is of security i.e in ssh data transfer between the syste$s is in encrypted for$ so it is difficult for the hac5ers to understand what is

    &oin& on networ5.In elnet data transfer between the syste$s is in plain text.

    ** uses a public 5ey for authentication while elnet does not use any authentication.%ue to the security $easures that were necessary for ** to be used in public networ5s# each pac5et contains less data to $a5e roo$ for the data of the security $echanis$s. In orderto trans$it the sa$e a$ount of data# you would need to ta5e!up a lot $ore bandwidth. his is called overhead..** adds a bit $ore overhead to the bandwidth co$pared to elnet.

    Q: - What is di!!erence between 9T and =>MN?Bron co$$and is used to schedule the tas5 daily at the sa$e ti$e repeatedly #at co$$and is used to schedule the tas5 only once i.e to run only one ti$e.

    Q: - What is networ% bondin in in x and steps to con!i re networ% bondin ?

    Networ5 interface card ;NIB@ bondin& ;also referred to as NIB tea$in&@ is the bondin& to&ether of two or $ore physical NIBs so that they appear as one lo&ical device. his allowsfor i$prove$ent in networ5 perfor$ance by increasin& the lin5 speed beyond the li$its of one sin&le NIB and increasin& the redundancy for hi&her availability. 4or exa$ple# you canuse two :!&i&abit NIBs bonded to&ether to establish a >!&i&abit connection to a central file server.)hen bonded to&ether# two or $ore physical NIBs can be assi&ned one I address. And they will represent the sa$e DAB address. If one of the NIBs fails# the I address re$ainsaccessible because it is bound to the local NIB rather than to a sin&le physical NIB.*teps to confi&ure ,tep 28: =reate a bond) con!i ration !i"e

    >ed Hat in x stores networ% con!i ration in .etc.s$scon!i .networ%-scripts. director$# +irst/ $o need to create bond) con!i !i"e:E vi /etc/sysconfi&/networ5!scripts/ifcf&!bond1Append followin& lines to it% KIB 1

    N )C(?.:JG.:.1 N DA*?==.>==.>==.1U* (B L

  • 8/11/2019 Linux Interview Notes

    16/51

    Linux Interview QuestionsE vi /etc/sysconfi&/networ5!scripts/ifcf&!eth:Da5e sure file read as follows for eth: interface% KIB .:JG.:.F I addresses read!write access to the /shared/ directory

  • 8/11/2019 Linux Interview Notes

    17/51

    Linux Interview QuestionsQ: - What wi"" happened i! a space is iven inbetween a""owedLhosts and 6options7

    If a space is included# the options are applied to any and all I addresses# which can be +uite dan&erous if write per$ission is &ranted.

    Q: - What is the ro"e o! Js$ncJ option !or N+, server

    If sync is specified# the server waits until the re+uest is written to dis5 before respondin& to the client. he sync option is reco$$ended because it follows the N4* protocol.

    Q: - How to retrieve a "ist o! c"ients connected to the N+, server ?

    o retrieve a list of clients connected to the N4* server# use the show$ount co$$andfro$ a shell pro$pt. o also show the directories the clients are connected to# use theshow$ount !a co$$and.

    Q: - Name o! =on!i ration !i"e !or N+, ,erver ?

    /etc/exports

    Q: - What is meanin o! JnoLrootLs& ashJ option ?

    reat re$ote root user as local root. %o not $ap re+uests fro$ root to the anony!

    $ous user and &roup I%.

    Q: - What is N+, ?

    N4* stands for Networ5 4ile *yste$. N4* was ori&inally developed by *un Dicrosyste$s in the :HG1's. N4* allows re$ote hosts to $ount file syste$s over a networ5 and interactwith those file syste$s as thou&h they are $ounted locally. his enables syste$ ad$inistrators to consolidate resources onto centrali"ed servers on the networ5.

    Q: - Which N+, versions are avai"ab"e ?

    N4* Kersion > N4* Kersion 0 N4* Kersion

    Q: - What is di!!erent between N+, Eersion 5 ( ?

    nfs > default G5b transfer rate#it did not chec5 the authentication at the ti$e connection.client wants to access unauthori"ed file it shows error $essa&es li5e Pwrite errorP#Pread errorPnfs 0 0>5b transfer rate. It chec5 at the ti$e connection! ABL *upport

    Q: - =an we rant access b$ Username and password !or n!s share? No# access is &ranted only for I address.

    Q: - What is the ro"e o! Ja""Ls& ashJ option?

  • 8/11/2019 Linux Interview Notes

    18/51

    Linux Interview Questionsreat all client users as anony$ous users. Dap all user and &roup I%s to the anony$ous user and &roup I%.

    Q: - What is the ro"e o! JrootLs& ashJ option?All re+uests fro$ the user root are translated or $apped as if they ca$e fro$ the user anony$ous ;default@.

    Q: - ;xp"ain option Ja""Ls& ashJ?he UI% and I% of exported files are $apped to the user anony$ous. It is &ood for public directories.

    Q: - ;xp"ain Jexport!sJ command?he exportfs co$$and is used to $aintain the current table of exported file syste$s for N4*.

    Q: - ;xp"ain command J. sr.sbin.export!s -!J?It will flush everythin& out of the 5ernels export table. Any clients that are active will &et new entries added by $ountd when they $a5e their next re+uest.

    Q: - Which option is sed with export!s command to disp"a$ the c rrent export "ist/ a"so disp"a$s the "ist o! export options?exportfs !v

    Q: - Which option is sed with export!s command to re-export a"" directories?exportfs !r

    Q: - How $o wi"" export director$ 6.data7 to host 8O5#8 #8# 8/ a""owin as$nchrono s writes witho t addin the entr$ in .etc.exports !i"e?

    E exportfs !o async :H>.:JG.:.=: /data

    Q: - Is rpc#mo ntd daemon s pports T=4LW>944;>,?6es# he rpc.$ountd dae$on is protected by the tcpZwrappers. 6ou have to &ive the clients access to rpc.$ountd if they should be allowed to use N4* *erver.

    Q: - ;xp"ain Jn!sstatJ command?he nfsstat co$$and displays the statistics about N4* client and N4* server activity.

    Q: - What do $o nderstand b$ Jn!sstat -o a"" -5( J command?It will *how all infor$ation about all versions of N4*.

    Q: - What do $o nderstand b$ Jn!sstat --n!s --server -(J command?It will show statistics for N4* version 0 server.

    Q: - =an N+, share mo nted on Window X4 and P sti!$ $o r answer? No# )indow X operatin& syste$ doesn7t support nfs protocol.

    Q: - 8O5#8 #8# 8:.data is exported b$ N+, ,erver and i want to add this N+, share to c"ient .etc.!stab !i"e# How $o wi"" add this entr$ in .etc.!stab !i"e?E device $ount!point fs!type options du$p fsc5order :H>.:JG.:.=: /data /$nt nfs rw 1 1

  • 8/11/2019 Linux Interview Notes

    19/51

    Linux Interview QuestionsQ: - ;xp"ain J,o!t Fo ntin J option at N+, ="ient?

    if a file re+uest fails# the N4* client will report an error to the process on the client $achine re+uestin& the file access. if it cannot be satisfied ;for exa$ple# the server is down@# then it+uits. his is called soft $ountin&.

    Q: - ;xp"ain JHard Fo ntin J option at N+, ="ient?If a file re+uest fails# the N4* client will report an error to the process on the client $achine re+uestin& the file access. if it cannot be satisfied# then it will not +uit until the re+uest issatisfied. his is called ard $ountin&.

    Q: - What is JportmapJ?he port$apper 5eeps a list of what services are runnin& on what ports. his list is used by a connectin& $achine to see what ports it wants to tal5 to access certain services.

    Q: - How $o wi"" chec% JportmapJ service is r nnin or not?rpcinfo !p

    Q: - I am nab"e to mo nt a N+, share# How wi"" $o trace o t the reason?4irstly# chec5 that you have per$issions to $ount nfs share or not. Bhec5 /etc/exports file.*econdly you can &et ( B error ro&ra$ Not (e&istered ;or another P( BP error@4or this chec5 your N4* server and port$ap service runnin& or not by Prpcinfo !pP

    Q: - =an I modi!$ export permissions witho t needin to remo nt c"ients in order to have them ta%e e!!ect?

    6es. he safest thin& to do is edit /etc/exports and run Pexportfs !rP.

    +T4 ,;>E;> Q 9

    Q: - How to den$ speci!ic sers access to the +T4 server ?

    o deny specific users access to the 4 server# add their userna$es to the /etc/vsftpd/ftpusers file. 8y default# syste$ users such as root and nobody are included in this list.

    Q: - =an we create "o s !or !tp a thenticated sessions ?

    6es# If the xferlo&Zenable directive in vsftpd.conf is set to 6 *# file transfers usin& the 4 protocol are lo&&ed to /var/lo&/xferlo&. Infor$ation such as a ti$e sta$p# I address of theclient# the file bein& transferred# and the userna$e of the person who authenticated the connection is included in the lo& entry.

    Q: - What is meanin o! maxLc"ients parameter ?

    Daxi$u$ nu$ber of clients that can connect at one ti$e.If set to 1# the nu$ber of clients is unli$ited.

    Q: - Mn which port E,+T4 server wor%s ?

    4 uses two ports# >1 and >:. 8y default# the 4 server listens for re+uests on port >:.

  • 8/11/2019 Linux Interview Notes

    20/51

    Linux Interview QuestionsAfter a connection is established# the client sends co$$ands to the server on port >:.

    owever# port >1 is used when the server sends data bac5 to the client.

    Q: - How to restart E,+T4 server ?

    service vsftpd restart

    Q: - How to a""ow 9non$mo s +T4 ?

    Anony$ous 4 is enabled by default by settin& the anony$ousZenable directive in/etc/vsftpd/vsftpd.conf to 6 *.Q: - What is +T4 ?

    4 stands for 4ile ransfer rotocol. An 4 server allows clients to connect to it either anony$ously or with a userna$e and password co$bination. After successful authentication# files can be transferred bac5 and forth between the server and client. he files are neither encrypted nor co$pressed.

    Q: - +or >edhat in x or +edora which pac%a e is re& ired !or +T4 service ?

    (ed at nterprise Linux = or 4 %C(A includes the vsftpd 4 service.vsftpd!>.1.=!:>.el= ;4or (edhat@

    Q: - Important =on!i ration !i"e !or vs!tp server ?

    he 4 server uses the /etc/vsftpd/vsftpd.conf confi&uration file. Usin& this file# youcan set options for displayin& a custo$ banner $essa&e after users lo& in# settin& thedefault file per$issions for uploaded files# and settin& the port on which to listen for inco$in& connections.

    Q: - What is +T4 ?

    4 client connects to the 4 server by establishin& an 4 control connection to port >: of the server. 6our co$$ands such as 'ls' and '&et' are sent over this connection. )heneverthe client re+uests data over the control connection# the server initiates data transfer connections bac5 to the client. he source port of these data transfer connections is always port >1on the server# and the destination port is a hi&h port ;&reater than :1> @ on the client..

    Q: - What is 4assive mode?

    assive $ode# li5e active $ode# is initiated by the 4 client application. )hen re+uestin& data fro$ the server# the 4 client indicates it wants to access the data in passive $odeand the server provides the I address and a rando$# unprivile&ed port ;&reater than :1> @ on the server. he client then connects to that port on the server to download the re+uestedinfor$ation.

  • 8/11/2019 Linux Interview Notes

    21/51

    Linux Interview QuestionsQ: - ;xp"ain directive JsessionLs pportA?

    )hen enabled# vsftpd atte$pts to $aintain lo&in sessions for each user throu&h lu&&able Authentication Dodules ; AD@.

    Q: - Is there an$ wa$ to monitor c"ients connected to vs!tpd?

    6es. )e actually have two sli&htly different $ethods to $onitor vsftpd clients. 4irst# $a5e sure you have enabled the confi& option# PsetproctitleZenable

  • 8/11/2019 Linux Interview Notes

    22/51

    Linux Interview QuestionsQ: - What is the ro"e o! 1N, ?

    A %N* server# or na$e server# is used to resolve an I address to a hostna$e or vice versa.

    Q: - Mn which port 1N, server wor%s ?

    %N* servers use port =0 by default. Inco$in& and out&oin& pac5ets should be allowed on port =0. Also allow connections on port H>: if you confi&ure a li&htwei&ht resolver server.

    he %N* control utility# rndc# connects to the %N* server with B port H=0 by default. If you are runnin& rndc on the na$e server# connections on this B port fro$ localhostshould be allowed. If you are runnin& rndc on additional syste$s# allow connections to

    port H=0 ;or whatever port you have chosen to confi&ure@ fro$ these additional syste$s.

    Q: - What is ro nd robin 1N,?

    (ound robin %N* is usually used for balancin& the load of &eo&raphically distributed )eb servers. 4or exa$ple# a co$pany has one do$ain na$e and three identical ho$e pa&esresidin& on three servers with three different I addresses. )hen one user accesses the ho$e pa&e it will be sent to the first I address. he second user who accesses the ho$e pa&ewill be sent to the next I address# and the third user will be sent to the third I address. In each case# once the I address is &iven out# it &oes to the end of the list. he fourth user#therefore# will be sent to the first I address# and so forth.

    Q: - What is Name ,erver?

    A na$e server 5eeps infor$ation for the translation of do$ain na$es to I addresses and I addresses to do$ain na$es. he na$e server is a pro&ra$ that perfor$s the translation atthe re+uest of a resolver or another na$e server.

    Q: - What is 4rimar$ name server or primar$ master server?

    ri$ary na$e server/pri$ary $aster is the $ain data source for the "one. It is the authoritative server for the "one. his server ac+uires data about its "one fro$ databases saved on alocal dis5. he pri$ary server $ust be published as an authoritative na$e server for the do$ain in the *CA resource record# while the pri$ary $aster server does not need to be

    published.

    Q: - What is ,econdar$ name server.s"ave name server?

    *econdary na$e server/slave na$e server ac+uires data about the "one by copyin& the data fro$ the pri$ary na$e server ;respectively fro$ the $aster server@ at re&ular ti$e

    intervals. It $a5es no sense to edit these databases on the secondary na$e servers# althou&h they are saved on the local server dis5 because they will be rewritten durin& furthercopyin&.

    Q: - what is >oot name server?

    (oot na$e server is an authoritative na$e server for the root do$ain ;for the dot@. ach root na$e server is a pri$ary server# which differentiates it fro$ other na$e servers.

    Q: - what is ,tea"th name server?

  • 8/11/2019 Linux Interview Notes

    23/51

    Linux Interview Questions*tealth na$e server is a secret server. his type of na$e server is not published anywhere. It is only 5nown to the servers that have its I address statically listed in their confi&uration.It is an authoritative server. It ac+uires the data for the "one with the help of a "one transfer. It can be the $ain server for the "one. *tealth servers can be used as a local bac5up if thelocal servers are unavailable.

    Q: - What do $o mean b$ J>eso rce >ecordsJ?

    Infor$ation on do$ain na$es and their I addresses# as well as all the other infor$ation distributed via %N* is stored in the $e$ory of na$e servers as (esource (ecords ;((@.

    Q: - ;xp"ain JTT J?

    i$e to live. A 0>!bit nu$ber indicatin& the ti$e the particular (( can be 5ept valid in a server cache. )hen this ti$e expires# the record has to be considered invalid. he value 15eeps nonauthoritative servers fro$ savin& the (( to their cache $e$ory.

    Q: - Te"" me T$pes o! 1N, records?

    A# N*# BNAD # *CA# (# DX.

    Q:- exp"ain J,M9 >ecordJ?

    he *tart of Authority ;*CA@ record deter$ines the na$e server that is an authoritative source of infor$ation for the particular do$ain. here is always only one *CA record in thefile# and it is placed at the be&innin& of the file of authoritative resource records.

    Q: - what is J9 >ecordJ

    A ;Address@ records assi&n I addresses to do$ain na$es of co$puters. he I address cannot have a dot at the end.

    Q: - ;xp"ain J=N9F; >ecordJ?

    *ynony$s to do$ain na$es can be created usin& BNAD records. his is often referred to as 'creatin& aliases for co$puter na$es'.

    Q: - What are JHIN+M and TXT >ecordsJ?

    IN4C and X records are for infor$ation only. An IN4C record has two ite$s in its data part. he first ite$ is infor$ation about hardware# and the second one is infor$ationabout software. A X record contains a &eneral data strin& in its data part.

    xa$ple test.co$ IN *CA ......$ail IN A :H>.:.:.>IN IN4C DyZ*erver UNIXIN X $y server

    Q: - what are JFX >ecordsJ?

  • 8/11/2019 Linux Interview Notes

    24/51

    Linux Interview QuestionsDX records specify the $ailin& server of the do$ain. An DX record shows to which co$puter a $ail of a particular do$ain should be sent. he DX record also includes a prioritynu$ber# which can be used to deter$ine several co$puters where the $ail for the do$ain can be sent. he first atte$pt is to deliver the $ail to the co$puter with the hi&hest priority;lowest value@. If this atte$pt fails# the $ail &oes to the next co$puter ;with a hi&her priority value@# and so on.

    test.co$ IN *CA ......$ail IN A :H>.:.:.> IN IN4C Alpha*erver UNIX

    IN X $y server IN DX 01 $ail>.nextstep it.co$ IN DX >1 $ail0.nextstep it.co$ IN DX :1 $ail>.nextstep it.co$

    Q: - ;xp"ain J4T> >ecordsJ?

    A ointer (ecord ; (@ is used to translate an I address into a do$ain na$e.

    Q: - What is 1$namic 1N,?

    %yna$ic %N* a $ethod of 5eepin& a do$ain na$e lin5ed to a chan&in& I address as not all co$puters use static I addresses. ypically# when a user connects to the Internet# theuser's I* assi&ns an unused I address fro$ a pool of I addresses# and this address is used only for the duration of that specific connection. his $ethod of dyna$ically assi&nin&

    addresses extends the usable pool of available I addresses. A dyna$ic %N* service provider uses a special pro&ra$ that runs on the user's co$puter# contactin& the %N* service eachti$e the I address provided by the I* chan&es and subse+uently updatin& the %N* database to reflect the chan&e in I address.

    Q: - What is the ro"e o! Jnamed-chec%con! Uti"it$J?

    he na$ed!chec5conf utility chec5s the syntax of the na$ed.conf confi&uration file.*yntax na$ed!chec5conf 9!t directory 9filena$e

    Q: - what is the ro"e o! Jnamed-chec%*one Uti"it$J?

    he na$ed!chec5"one utility chec5s the syntax and consistency of the "one file.*yntax na$ed!chec5"one 9!d&v 9!c class "one 9filena$e

    ,9F09 ,;>E;> Q 9Q: - Which ,; in x sec rit$ context sed !or ,9F09 ?sa$baZshareZt

  • 8/11/2019 Linux Interview Notes

    25/51

    Linux Interview QuestionsQ: - Mn which ports ,9F09 server wor%s ?

    ! U% port :0 for netbios!ns# the N 8IC* Na$e *ervice! U% port :0G for netbios!d&$# the N 8IC* %ata&ra$ *ervice! B port :0H for netbios!ssn# the N 8IC* session service! B port = for $icrosoft!ds# the Dicrosoft %o$ain *erviceQ: - What are the ,ecrit$ or 9 thentication Fode !or ,9F09 server?

    A%*%CDAIN* (K ( U* ( * A(Q: - How to Fan a""$ =reate Fachine Tr st 9cco nts ?

    /usr/sbin/useradd !& $achines !d /var/lib/nobody !c P$achine nic5na$eP ! s /bin/false $achineZna$e- passwd !l $achineZna$e-

    Q: - What are the ,9F09 server T$pes ?

    ! ri$ary %o$ain Bontroller ; %B@

    ! 8ac5up %o$ain Bontroller ;8%B@! A%* %o$ain Bontroller Q: - Which protoco" ,9F09 server ses ?

    *D8# which stands for *erver Dessa&e 8loc5# is a protocol for sharin& files# printers# serial ports# and co$$unications abstractions such as na$ed pipes and $ail slots betweenco$puters.Q: - How 1oes a Wor%station !ind its 1omain =ontro""er?

    here are two different $echanis$s to locate a do$ain controller one$ethod is used when Net8IC* over B /I is enabled and the other whenit has been disabled in the B /I networ5 confi&uration. )here Net8IC* over B /I is disabled# all na$e resolution involves the use of %N*# broadcast $essa&in& over U% # aswell as Active %irectory co$$unication technolo&ies.Q: - =an ,amba 0e a 0ac% p 1omain =ontro""er to an NT 41=?

    No. he native N *AD replication protocols have not yet been fully i$ple$ented.

    Q: - How 1o I >ep"icate the smbpasswd +i"e?

    (eplication of the s$bpasswd file is sensitive. It has to be done whenever chan&es to the *AD are $ade. very user's password chan&e is done inthe s$bpasswd file and has to be replicated to the 8%B. *o replicatin& thes$bpasswd file very often is necessary.As the s$bpasswd file contains plaintext password e+uivalents# it $ust not be sent unencrypted over the wire. he best way to set up

  • 8/11/2019 Linux Interview Notes

    26/51

    Linux Interview Questionss$bpasswd replication fro$ the %B to the 8%B is to use the utility rsync. rsync can use ssh as a transport. ssh itself can be set up to accept only rsync transfer without re+uirin& theuser to type a password.As said a few ti$es before# use of this $ethod is bro5en and awed. Dachine trust accounts will &o out of sync# resultin& in a bro5en do$ain. his $ethod isnot reco$$ended. ry usin& L%A instead.Q: - =an ,amba ! ""$ rep"ace m$ Windows NT server that is not a 4rimar$ 1omain =ontro""er 641=7?*a$ba can co$pletely serve files and printers to )indows# Must as a )indows N server would.

    Q5 =an ,amba rep"aces m$ Windows NT 41=? Not co$pletely. *a$ba do$ain control capabilities for a )indows Hx client are

    solid and co$plete# and so these clients would probably never 5now the difference. he do$ain control support for )indows N />111 clients is still bein& developed. Burrently#enou&h has been i$ple$ented to allow a )indows N client to Moin a *a$ba!controlled do$ain# but there is $ore to do$ain control than that. he $ost conspicuous absence is thelac5 of support for )indows N trust relationships and the *AD replication protocol used between N %Bs and 8ac5up %o$ain Bontrollers ;8%Bs@.

    Q( What T=4 and U14 ports re& ired !or Net0IM, over T=4.I4 se?he N8 na$e service uses port :0 /udp# the N8 session service uses port

    :0H/tcp# and the N8 data&ra$ service uses port :0G/udp.

    Q: - How ,F0 protoco" wor%s?here will be three sta&es in creatin& an *D8 connection between a client and a specific share on a server.he first sta&e in connectin& to an *D8 share is to ne&otiate the *D8 protocol dialect to use. In the re+uest pac5et# the client sends a text listin& of all the *D8 dialects that it

    understands. he server selects the $ost advanced protocol that it 5nows and responds to the client# specifyin& the protocol nu$ber fro$ the list. At this point# the client and serverhave a&reed that *D8 co$$ands can be used for the re$ainder of the conversation.

    he second sta&e is to create a session connection between the client and server. o do this# the client issues a session setup re+uest# which includes a serna$e and so$e proof ofvalidity# such as a password. he server atte$pts to validate re+uestin& user. If successful# the server then returns a session UI% to client. his UI% is uni+ue for each session and hasno relation to the server internal representation of users.

    he third sta&e before access to files on a re$ote share is allowed is for the client to $a5e a successful tree connection to the shared resource. he client sends to the server a treeconnect re+uest# which includes the UI% previously issued by the server. At this sta&e the server verifies that the authenticated user is authori"ed to access the re+uested resource. Ifthe user has sufficient privile&es to access the share# the client is issued a tree connection I% ; I%@. he I% is used in all re+uests to access files contained in the resource to whichthe I% refers.

    In this way *D8 protocol wor5s.

    Q: - How man sections samba con!i ration !i"e 6smb#con!7 contains?s$b.conf file contains three sections.:. 9&lobal Bontains settin&s that deter$ine *a$ba overall behavior.

    >. 9ho$es A default share for providin& a ho$e directory for all users.0. 9printers A default share for exportin& all printers on the host via BI4*.

    Q: - I! a netbios name is not de!ined in smb#con!/ than what wi"" be netbios name?If a netbios na$e is not defined# *a$ba will use the I hostna$e of the server by default.

    Q: - I want to se User "eve" sec rit$ !or m$ samba server than what i have to add in smb#con! !i"e?security < user Q: - How $o wi"" veri!$ that $o r smb#con! !i"e doesn@t have an$ mista%es and misspe""in s?

  • 8/11/2019 Linux Interview Notes

    27/51

    Linux Interview QuestionsPtestpar$ P tool that verifies the syntax of a confi&uration file;[email protected]$ !s s$b.conf

    Q: - What is the se o! Jsmbc"ientJ command?Ps$bclientP is used to display the list of shares on your server. his verifies that s$bd is runnin& and functionin& correctly. he !L option instructs s$bclient to enu$erate the shareson the server rather than actually connectin& to one. he !N switch instructs s$bclient to use an anony$ous lo&in rather than the lo&in na$e of the current user. s$bclient !L localhost !N

    Antother use of Ps$bclientP co$$and to connect the sa$ba share.s$bclient //Oserver2/Oshare2 !U Ouserna$e2

    Q: - ;xp"ain Jsmbstat sJ command?he s$bstatus utility displays infor$ation about connected users and currently loc5ed files.

    Q: - Is it possib"e !or ,amba to share !i"e s$stems that have been mo nted sin N+,?6es. owever# this can be proble$atic if the N4* server that provides the file syste$ fails# causin& the *a$ba server to han&. It is always safer to use *a$ba to share a local filesyste$.

    Q: - How man$ sim "taneo s connections can a ,amba server s pport?In theory# there is no li$it. In practice# the li$it is deter$ined by the server7s hardware# specifically the total a$ount of available (AD and the B U power. It $i&ht also depend onthe a$ount of activity fro$ the s$bd processes.

    Q: - =an ,amba be a member o! more than one wor% ro p at the same time? No# *a$ba can be a $e$ber of only one wor5&roup.

    Q: - What is ,W9T?*)A is UI 8ased ad$inistration tool for sa$ba server.

    Q: - I am tr$in to se ,W9T/ b t I %eep ettin the messa e There was no response# The server co "d be down or not respondin # What is the prob"em?he $ost li5ely cause is that *)A is not listenin& to connections# or you have used the wron& U(L in tryin& to connect to *)A . *)A usually lives behind port H1:# so the U(L

    you should use is http //I%ZA%%( **ZC4Z* (K ( H1:/

    Q: - =an i set empt$ password !or samba ser?yes# If you want to set the value to an e$pty password# you $ust chan&e

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXto

    NC A**)C(%XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    in your s$bpasswd file. Note ! if you have edited the s$bpasswd file by hand# $a5e sure that the LAN Dana&er and N password fields contain exactly 0> characters# no $ore and no fewer. If these fieldsdo not have exactly 0> characters# *a$ba will not be able to correctly read the entry.or 6ou can $odify by Ps$bpasswdP co$$and.s$bpasswd !n U* (ZNAD

  • 8/11/2019 Linux Interview Notes

    28/51

    Linux Interview QuestionsAlso you have to set the null passwords para$eter to yes in the 9&lobal section of s$b.confnull passwords < yes

    Q: - 1oes ,amba s pport 49F?6es

    Q: - What is ro"e o! JNT FJ?he challen&e/response authentication protocol available to )indows clients and servers for validatin& connection re+uests.

    Q: - ;xp"ain J!orce ro pJ parameter sed in smb#con!?It will define the &roup id to be used for all file access in the place of the user7s pri$ary &roup.

    Q: - ;xp"ain J!orce serJ parameter sed in smb#con!?It will define the user id to be used for all file access.

    Q: - ;xp"ain Jwrite "istJ parameter sed in smb#con!?A list of users and/or &roups that should be &iven write access even if the read only para$eter has been enabled.

    Q: - F$ c"ients are ettin the error messa e that the 1is% is + "" when tr$in to print to m$ ,amba server/ b t there is p"ent$ o! space# What is the prob"em?If s$bd is unable to write the spooled file to the directory defined by the path para$eter for a printer if the write per$ission were denied# for exa$ple it would respond to the clientwith the $essa&e# %is5 is 4ull. *a$ba will also return this error $essa&e if the a$ount of free dis5 space in the spool directory has fallen below the value specified by the $in print

    space para$eter.

    Q: - When I c"ic% on m$ ,amba server in the networ% nei hborhood/ I am contin a""$ prompted !or a password to the I4= share no matter what I enter#he )indows client is atte$ptin& to use encrypted passwords. owever# the *a$ba server is confi&ured to support only clear!text passwords. 6ou should either enable encrypted

    passwords on the server or enable clear!text passwords on the )indows client.

    Q: - Wh$ is sec rit$ R domain better than sec rit$ R server?here are three reasons why security < do$ain is better. he first is because this $ethod enables the *a$ba server to participate in do$ain trust relationships. his is i$possible with

    server!level security. he second reason is that# under server!level security# each s$bd process $ust 5eep an open connection with the authentication server. his can drain a )indows N %B +uic5ly. Under do$ain!level security# this connection is $aintained only lon& enou&h to perfor$ the validation# thus conservin& valuable resources. he final reason is that#as a do$ain $e$ber# the *a$ba server has access to $uch $ore infor$ation about user accounts# which can be used to auto$ate the creation and deletion of user accounts uponde$and.

    Q: - what is nmbd daemon?his dae$on handles all na$e re&istration and resolution re+uests. It is the pri$ary vehicle involved in networ5 browsin&. It handles all U% !based protocols. he n$bd dae$on

    should be the first co$$and started as part of the *a$ba startup process.

    Q: - What is smdb daemon?his dae$on handles all B /I !based connection services for file! and print!based operations. It also $ana&es local authentication. It should be started i$$ediately followin& the

    startup of n$bd.

    Q: - What is winbindd daemon?

  • 8/11/2019 Linux Interview Notes

    29/51

    Linux Interview Questionshis dae$on should be started when *a$ba is a $e$ber of a )indows N or A%* do$ain. It is also needed when *a$ba has trust relationships with another do$ain. he winbindd

    dae$on will chec5 the s$b.conf file for the presence of the id$ap uid and id$ap &id para$eters. If they are found# winbindd will use the values specified for UI% and I%allocation. If these para$eters are not specified# winbindd will start but it will not be able to allocate UI%s or I%s.

    Q: - ;xp"ain the parameter Jwins s pport R GesJ sed in smb#con!?If the *a$ba server was confi&ured to provide )IN* support ;Pwins support < 6esP@# then the )IN* server is able to provide na$e resolution for all of the hosts that are not listed inthe /etc/hosts file or within the %N*. Da5in& this adMust$ent in the Na$e *ervice *witch confi&uration file ;/etc/nsswitch.conf@ allows the Linux syste$ to +uery the )IN* server forlocal na$e resolution. his saves $anual adMust$ents to host files.

    Q: - How to a tomate ,F0 share mo ntin d rin s$stem start p?Add s$b share entry in /etc/fstab file.//I ZA%%( **ZC4Z* (K (/*hared /shared s$bfs noauto#defaults 1 1

    Q: - how to start and stop samba server?/etc/init.d/s$b restart

    ,;N1F9I ,;>E;> Q 9

    Q: - How to start sendmai" server ?service send$ail restart

    Q: - Mn which ports sendmai" and senmai" with ,, wor%s ?

    8y default# *end$ail uses B and U% port >= for non!encrypted transfers. If the*end$ail server is confi&ured to use **L for encryptin& e$ail sent and received# it uses

    port J=.Q: - ;xp"ain se o! Jtr sted- sersJ !i"e ?

    List of users that can send e$ail as other users without a warnin& includin&syste$ users such as apache for the Apache *erver.Q: - ;xp"ain the se o! J"oca"-host-namesJ !i"e ?

    If the e$ail server should be 5nown by different hostna$es# list the host!na$es in this file# one line per hostna$e. Any e$ail sent to addresses at these

    hostna$es is treated as local $ail. he 4 A U( ;^useZcwZfile_` @ option $ust be enabled in the send$ail.$c file for this file to be referenced.

    Q: - exp"ain the se o! .etc.a"iases !i"e ?

    /etc/aliases# can be used to redirect e$ail fro$ one user to another. 8y default# it includes redirects for syste$ accounts to the root user. It can then be used to redirect all e$ail for theroot user to the user account for the syste$ ad$inistrator.

  • 8/11/2019 Linux Interview Notes

    30/51

    Linux Interview QuestionsQ: - =an we se ,, ;ncr$ption with ,endmai" ?

    6es# *end$ail can be confi&ured to encrypt e$ail sent and received usin& **L ;secure soc5ets layer@.

    Q: - What is ,endmai" ?

    *end$ail is an D A# $eanin& it accepts e$ail $essa&es sent to it usin& the *D proto!col and transports the$ to another D A e$ail server until the $essa&es reach their destinations. It also accepts e$ail for the local networ5 and delivers the$ to local $ail spools# one

    for each user.Q: - What is the ro"e o! FU9 ?

    An DUA ;Dail User A&ent@ with access to the $ailbox file# directly or throu&h a networ5 file syste$# can read $essa&es fro$ the dis5 and display the$ for the user. his is &enerallya console or web$ail application runnin& on the server.

    Q: - Which are the important con!i ration !i"es !or ,endmai" server ?

    he /etc/$ail/ directory contains all the *end$ail confi&uration files# with send$ail.cf and sub$it.cf bein& the $ain confi&uration files. he send$ail.cf file includes optionsfor the $ail trans$ission a&ent and accepts *D connections for sendin& e$ail. hesub$it.cf file confi&ures the $ail sub$ission pro&ra$.

    Q: - How to con!i re sendmai" to accept mai" !or "oca" de"iver$ that is addressed to other hosts?Breate a /etc/$ail/local!host!na$es file. ut into that file the hostna$es and do$ain na$es for which send$ail should accept $ail for local delivery. nter the na$es with onehostna$e or do$ain na$e per line. And also $a5e sure that *end$ail confi&uration file should contain PuseZcwZfileP option.dnl Load class -

  • 8/11/2019 Linux Interview Notes

    31/51

    Linux Interview Questionsdnl %efine a relay server for local $aildefine;^DAILZ U8'# ^s$tp.test.co$'@dnl Users whose $ail is not passed to the $ail hubLCBALZU* (;root@(ebuild and reinstall send$ail.cf# and then restart send$ail.

    Q: - How to con!i re m "tip"e mai" & e es?$5dir /var/spool/$+ueue/+ueue.:

    $5dir /var/spool/$+ueue/+ueue.>$5dir /var/spool/$+ueue/+ueue.0ch$od 11 /var/spool/$+ueue/+ueue.:ch$od 11 /var/spool/$+ueue/+ueue.>ch$od 11 /var/spool/$+ueue/+ueue.0Add the QU U Z%I( define to the send$ail confi&uration to use the new +ueue directories.dnl %eclare the +ueue directory pathdefine;^QU U Z%I('# ^/var/spool/$+ueue/+ueue.F'@

    Q: - How to disab"e certain ,FT4 commands?Add the conf (IKAB6Z4LA * define to the send$ail confi&uration to set rivacy Cptions that disable unwanted# optional *D co$$ands. ere we will disables the X N#K(46# K (8# and (N co$$ands.dnl %isable X N# K(46# K (8 and (N

    define;^conf (IKAB6Z4LA *'# ^noexpn#novrfy#noverb#noetrn'@(ebuild and reinstall send$ail.cf# and then restart send$ail.

    Q: - In which ,endmai" con!i ration !i"e we have to ma%e chan es?we will $a5e the chan&es only in the send$ail.$c file# and the chan&es will be $oved into the send$ail.cf file for us.

    Q: - When ,endmai" dispatches $o r emai"/ it p"aces the servers hostname behind $o r sername/ which becomes the J!rom addressJ in the emai" 6ie#serSmai"#test#com7#0 t we want to se the domain name and not the hostname?

    define;^conf%CDAINZNAD '# test.co$'@dnl4 A U( ;^relayZentireZdo$ain'@dnl

    Q: - What does .etc.mai".access !i"e contains?he access database ;P/etc/$ail/accessP@ is a list of I addresses and do$ainna$es of allowable connections.

    4 A U( ;^accessZdb'#^hash ! O D 42 !o /etc/$ail/access.db'@dnland cat /etc/$ail/accesslocalhost.localdo$ain ( LA6localhost ( LA6:> .1.1.: ( LA6:H>.:JG.1 ( LA6test.co$ ( LA6

    Q: - How to restrict sendmai" to sendin a bi !i"e?

  • 8/11/2019 Linux Interview Notes

    32/51

    Linux Interview Questionsdefine;^confDAXZD **A Z*I3 '#^=> >GG11'@dnlor If you are usin& a based web$ail application li5e *+uirrelDail# you can adMust the $ax file si"e in php.ini file.vi php.ini

    postZ$axZsi"e < =1DuploadZ$axZfilesi"e < =1D$e$oryZli$it < J D

    Q: - How to set 5 recipients !or each emai"?define;^confDAXZ(B *Z (ZD **A '#^=1'@dnl

    Q: - Which antivir s $o have inte rated with sendmai" ?Blai$AK

    Q: - What is ="amav-Fi"ter?Bla$av!Dilter is a tool to inte&rate send$ail and cla$AK antivirus.

    Q: - Which con!i ration !i"es are re& ired to inte rate sendmai" and ="aim9E antivir s?$ilter.conf and cla$av!$ilter

    Q: - How to test sendmai" inte ration with ="aim9E?&rep Dilter /var/lo&/$aillo&

    6ou have to &et followin& type of $essa&es.send$ail Dilter add header X!Kirus!*canned Bla$AK version 1.GG.># cla$av!$ilter version 1.GG.> on $ail.test.co$send$ail Dilter add header X!Kirus!*tatus Blean

    Q: - Which too" $o have sed to b"oc% spammin ?*pa$Assassin

    Q: - What does J.etc.mai".J director$ contains?he /etc/$ail/ directory contain all the *end$ail confi&uration files# with send$ail.cf and sub$it.cf bein& the $ain confi&uration files.

    Q: - ;xp"ain the se o! .etc.mai".re"a$-domains !i"e?he /etc/$ail/relay!do$ains file is used to deter$ine do$ains fro$ which it will relay $ail. he contents of the relay!do$ains file should be li$ited to those do$ains that can be

    trusted not to ori&inate spa$.

    Q: - What is the name o! spamassassin con!i ration !i"e?/etc/$ail/spa$assassin/local.cf

    Q: - How to chec% mai" Q e e o! sendmai"?/usr/lib/send$ail !bpor $ail+

  • 8/11/2019 Linux Interview Notes

    33/51

    Linux Interview QuestionsQ: - How to se m macro processor to enerate a new sendmai"#c!?$ /etc/$ail/send$ail.$c 2 /etc/$ail/send$ail.cf

    QF9I ,;>E;> Q 9Q: - Which Cro ps and Users are re& ired to start QF9I ,erver ?

    roups ! nofiles+$ailUsers ! +$aildalias+$aill+$ailp+$ail++$ailr +$ails

    Q: - What is the ro"e o! J&mai"-sendJ process ?

    +$ail!send ! deliver $ail $essa&es fro$ the +ueue

    Q: - How to chec%/ &mai" server is p or down ?

    )e can use +$ailctl co$$and to chec5 the status of +$ail server.E +$ailctl stat/service/+$ail!send up ;pid 01010@ :G seconds/service/+$ail!send/lo& up ;pid 0101 @ :G seconds/service/+$ail!s$tpd up ;pid 0101=@ :G seconds/service/+$ail!s$tpd/lo& up ;pid 0101G@ :G seconds$essa&es in +ueue 1$essa&es in +ueue but not yet preprocessed 1

    Q: - Which &mai" process se Jconc rrec$"oca"J contro" !i"e ?+$ail!send

    Q: - What is mai"dir ?

    Daildir is a $ailbox for$at created by %an 8ernstein to address the shortco$in&s of the $box for$at. A $aildir $ailbox is a directory containin& three subdirectories# new# cur# andt$p. ach $essa&e in a $aildir $ailbox is in a separate file in one of the subdirectories# dependin& upon its status new is for unread $essa&es# cur is for $essa&es that have beenseen# and t$p is for $essa&es in the process of bein& delivered.

  • 8/11/2019 Linux Interview Notes

    34/51

    Linux Interview Questions

    Q: - What is procmai" ?

    proc$ail is a popular Dessa&e %elivery A&ent ;D%A@. he function of an D%A is to accept a $essa&e fro$ the D A for a specific user or $ailbox# and deliver the $essa&eaccordin& to the user's desires. proc$ail can be used to PfilterP $essa&es by the content of various header fields or the body of the $essa&e.

    Q: - What is QF9I ?

    +$ail is a $ail transfer a&ent that runs on Unix/Linux. It was written# startin& %ece$ber :HH=# by %aniel . 8ernstein as a $ore secure replace$ent for the popular *end$ail pro&ra$.+$ail's source code is released to the public do$ain# $a5in& +$ail free software.

    Q: - What is =o rier-imap ?

    A server that provides IDA access to Daildir $ailboxes. his IDA server does NC handle traditional $ailbox files ;/var/spool/$ail# and derivatives@# it was written for thespecific purpose of providin& IDA access to Daildirs.

    Q: - What is the "ocation o! &mai" contro" !i"es ?

    /var/+$ail/control

    Q: - Te"" me the name o! !ive Important Qmai" daemons?

    +$ail!+ueue+$ail!send+$ail!clean+$ail!lspawn+$ail!rspawn+$ail!local+$ail!re$ote

    Q: - ;xp"ain the wor%in o! &mai"?4or $ail arrivin& fro$ re$ote syste$s# tcpserver runs as a dae$on listenin& for inco$in& connections on the *D port. ach ti$e a connection arrives# it runs qmail-smtpd # whichreceives a $essa&e via *D and calls qmail-queue to +ueue the $essa&e. (e&ardless of where the $essa&e ori&inates# qmail-queue writes the $essa&e to a te$porary file in thequeue/todo directory# puttin& a new (eceived line at the top# and also saves the envelope sender and recipient addresses to files. hen it notifies qmail-send by writin& a byte to aPtri&&erP soc5et file.qmail-send ta5es the $essa&e out of +ueue/todo# and analy"es each recipient address to see if it's local# re$ote# or virtual. 4or local addresses# it notifies qmail-

    lspawn to run qmail-local to do the local deliveries. 4or each re$ote address# qmail-send notifies qmail-rspawn to run qmail-remote to do the re$ote deliveries. 4or virtual addresses#qmail-send rewrites each virtual address as a $odified local address# usin& the infor$ation fro$ the virtualdo$ains files.

    Q: - What is D ucspi-tcp?A pac5a&e for servers that respond to inco$in& B connections# as an alternative to the old inetd dae$on. It used to be optional# but its tcpserver is now the only supported way torun +$ail's *D dae$on.

    Q: - What is D checkpassword?

  • 8/11/2019 Linux Interview Notes

    35/51

    Linux Interview QuestionsIf you're usin& +$ail's built!in C 0 server# you want %an's checkpassword pro&ra$# which validates user lo&ins as well. ven if you're installin& an alternative chec5password# it'snice to have %an's chec5password installed for testin&.

    Q: - Which Fai"box +ormat is sed b$ Qmai"?Q$ail supports two $ailbox for$ats the traditional $box and %an's newer Daildir.

    Q: - ;xp"ain &mai" contro" !i"e DmeA?he na$e of this host# e.&.# $ail.test.co$. his provides the default to use for $any other confi&uration files.

    Q: - ;xp"ain abo t &mai" contro" !i"e D locals?%o$ain na$es to be delivered locally# one per line. Dail to any do$ain listed in locals is delivered by treatin& the $ailbox part as a local address. his usually contains the na$e ofthe host and the na$e of the do$ain used for user $ailboxes# such as test.co$ and $ail.test.co$.

    Q: - ;xp"ain abo t &mai" contro" !i"e D rcpthosts?%o$ains for which this host should accept $ail via *D . his &enerally contains all of the do$ains in locals # as well as any virtual do$ains and any do$ains for which this host is a

    bac5up $ail server. If rcpthosts does not exist# +$ail accepts and delivers $ail for any do$ain# a severe $isconfi&uration 5nown as an Popen relay#P which will be hiMac5ed byspa$$ers. 8e sure your rcpthosts file exists before startin& +$ail. If you haven't defined any virtual do$ains# Must copy locals to rcpthosts .

    Q: - ;xp"ain abo t &mai" contro" !i"e D badmailfrom?This qmail control file is used by qmail-smtpd. nvelope addresses not allowed to send $ail. If the envelope fro$ address on an inco$in& $essa&e $atches an entry in bad$ailfro$#the *D dae$on will reMect every recipient address. ntries $ay be either e$ail addresses# or @domain to reMect every address in a do$ain. his is a pri$itive for$ of spa$

    filterin&.Q: - What is the se o! D bouncefrom qmail control file?

    his +$ail control file is used by qmail-send daemon. This file contains the $ailbox of the return address to put in bounce $essa&es.

    Q: - What is se o! D concurrencylocal A &mai" contro" !i"e?his +$ail control file is used by +$ail!send dae$on. his file contains the $axi$u$ nu$ber of si$ultaneous local deliveries. he default value is :1.

    Q: - What is se o! D concurrencyremotel A &mai" contro" !i"e?his +$ail control file is used by +$ail!send dae$on. his file contains the $axi$u$ nu$ber of si$ultaneous re$ote deliveries. he default value is >1.

    Q: - What is the se o! D queuelifetime &mai" contro" !i"e?his +$ail control file is used by +$ail!send dae$on. In this file we define how lon& to 5eep tryin& to deliver a $essa&e. he default value is J1 G11 seconds ;a wee5@.

    Q: - What is the se o! D timeoutconnect &mai" contro" !i"e?his +$ail control file is used by +$ail!re$ote dae$on. In this file we define how lon& to wait for a re$ote server to accept the initial connection to send $ail. he default value is J1

    seconds.

    Q: - What is the se o! D virtualdomains qmail control file?he list of virtual users and do$ains for which this syste$ receives $ail. he default value in this file is none.

  • 8/11/2019 Linux Interview Notes

    36/51

    Linux Interview QuestionsQ: - How to reb i"d the ,FT4 access database?

    +$ailctl cdbortcprules /etc/tcp.s$tp.cdb /etc/tcp.s$tp.t$p O /etc/tcp.s$tpch$od J /etc/tcp.s$tpF

    Q: - Which mai"in "ist $o have con!i red with &mai"?3$l$

    Q: - Have $o insta""ed a toresponder what is the se o! a toresponder?

    6es# this is a si$ple pro&ra$ to auto$atically respond to e$ails.

    Q: - what is vpopmai"?vpop$ail is a free L software pac5a&e# to provide an easy way to $ana&e virtual e!$ail do$ains and non /etc/passwd e!$ail accounts on your +$ail server.

    Q: - Wh$ vpopmai"?vpop$ail provides a &ood set of $ana&e$ent tools and a reasonably well desi&ned structure which saves you i$ple$entin& your own. vpop$ail has also been around for a lon& ti$eand enMoys support fro$ a lot of other software pac5a&es related to $ail which $a5es inte&ration fairly si$ple.

    Q: - Te"" me the "ocation o! vpopmai" binaries?/ho$e/vpop$ail/bin

    Q: - What is the se o! vadddomain command?Kadddo$ain co$$and is used to adds a new do$ain to the +$ail server

    Q: - What is Dvch%pwA?vch5pw is the authentication $echanis$ used by +$ail to chec5 passwords re+uired for downloadin& $ail# and in the case of *D ZAU # sendin& $ail.

    Q: - can vpopmai" inte rated with F$,Q database?6es

    Q: - Which web based inter!ace $o have sed to mana e vpopmai"?K+ad$in

    Q: - What is mai"drop?Daildrop is a $ail filterin& a&ent which can be used to filter $essa&es as they arrive on the server.

    Q: - What is Qmai"admin?

  • 8/11/2019 Linux Interview Notes

    37/51

    Linux Interview QuestionsQ$ailad$in is &oin& to provide us with a nice web based interface for ad$inisterin& $ail accounts once they are setup throu&h Kpop$ail ;or K+ad$in@. 4ro$ Q$ailad$in we cancreate $ailboxes# aliases# forwards# $ail robots# $ailin& lists.

    Q: - Which antivir s $o have sed with Qmai"?Bla$AK antivirus

    Q: - Where ="am 9E & arantines the e-mai"s?Bla$ AK +uarantines the e!$ails in /var/spool/+$ailscan/+uarantine

    Q: - 0$ which ser we r n ="am9E?+scand user

    Q: - =an I have ,pamassassin ta s spected spam with a c stom s b ect "ine?6es. dit the /var/+$ail/bin/+$ail!scanner!+ueue.pl file and find the followin& line$y -spa$cZsubMectE;> Q 9

  • 8/11/2019 Linux Interview Notes

    38/51

    Linux Interview QuestionsQ ! )hat is the location of postfix $ailserver Queue T8y default# the ostfix $ail +ueues are located in the /var/spool/postfix directory. ach$essa&e +ueue is created as a separate subdirectory within this directory. ach $essa&e is stored as a separate file in the subdirectory# usin& a uni+ue identifier for the filena$e.

    Q ! )hat is LD T

    he Local Dail ransport rotocol ;LD @ is a different $ail transport protocoldescribed in (4B >100. LD utili"es a set protocol si$ilar to *D for deliverin&$essa&es to the local host. ostfix can be confi&ured to deliver $essa&es to local usersusin& LD if desired.

    Q ! )hat is canonical able T

    he cleanup pro&ra$ uses the canonical table to rewrite $essa&e addresses contained inthe $essa&e header. he $ail ad$inistrator can use one canonical loo5up table for bothreceived $essa&es and sent $essa&es or separate tables for each. he canonical table is often used in conMunction with the alias file to provide address header rewritin& of out&oin&$ail $essa&es.

    Q ! )ho is the creater of ostfix T

    )ietse Kene$a wrote ostfix as a co$plete D A pac5a&eQ ! )hat is the difference between postfix and send$ail T

    he $ain difference between ostfix and *end$ail is ostfix_` s $odularity. ust as the Unix syste$ bro5e up e!$ail functionality between $odules# ostfix extends that practice tothe D A pro&ra$. ostfix uses several different pro&ra$s to i$ple$ent the D A functionality. his allows each $odular pro&ra$ to be s$aller and +uic5er than one lar&e$onolithic pro&ra$ would be.

    ostfix is $ore secure than send$ail. ostfix re+uires a separate userid to be added to the $ail server. ach $odule runs under this userid. If an intruder co$pro!$ises a ostfix$odule# he $ost li5ely will still not be able to brea5 out of the $oduleand &ain control of the $ail server.Instead of one lar&e co$piled confi&uration file# ostfix uses $ultiple files that use plaintext para$eter and value na$es to define functionality. Dost of the para$eters used in ostfixdefault to co$$on!sense values that allow the $ail ad$inistrator to confi&ure a co$plete $ail server with a $ini$al a$ount of effort.

    Q ! what is +$&r T

    Cnce the valid $essa&e is rewritten and placed in the inco$in& $essa&e +ueue# the +$&r pro&ra$ ensures that the $essa&e is delivered to the proper destinations. he +$&r pro&ra$then exa$ines $essa&e headers and passes the$ to the appropriate delivery pro&ra$ dependin& on the destination addresses. Burrently# the +$&r pro&ra$ can forward $essa&es to thelocal# s$tp# and pipe pro&ra$s.

  • 8/11/2019 Linux Interview Notes

    39/51

    Linux Interview Questions

    Q ! ell $e about latest Kersion of ostfix on which u have wor5ed T

    postfix >.J

    Q ! )hat are the i$portant files for postfix server T

    /etc/postfix/$ain.cf /etc/postfix/access/etc/postfix/aliases

    Q ! )here postfix $ail server lo&s created T

    /var/lo&/$aillo&

    Q: - ;xp"ain the wor%in o! "oca" mai" s bmission !or post!ix?)hen a local e$ail $essa&e enters the postfix syste$. Local $essa&es are deposited into the $aildrop directory of the ostfix +ueue by the postdrop co$$and# usually throu&h thesend$ail co$patibility pro&ra$. he pic5up dae$on reads the $essa&e fro$ the +ueue and feeds it to the cleanup dae$on. he cleanup dae$on processes all inbound $ail andnotifies the +ueue $ana&er after it has placed the cleaned!up $essa&e into the inco$in& +ueue. he +ueue $ana&er then invo5es the appropriate delivery a&ent to send the $essa&e toits next hop or ulti$ate destination.

    Q: - What are the bene!its o! sin ,FT4 9UTH?! Usin& *D AU we can $a5e it possible for clients# collea&ues# and ourselves to relay $essa&es fro$ everywhere in the world usin& only one ;our@ *D server.- 8ein& a $obile user# we don't have to deal with the hassle to find a *D server that per$its us to relay.! )e can $a5e use of scripts and dae$ons that run on our server and provide services that we need e.&. server!side virus scannin&.

    Q: - b$ sin postcon! command/ how $o wi"" set ! ""$ & a"i!ied hostname 6mai" #test#com7?

    E postconf !e $yhostna$e

  • 8/11/2019 Linux Interview Notes

    40/51

    Linux Interview QuestionsE postsuper !r ALL

    Q: - =an post!ix server con!i red with F$,Q database?6es

    Q: - which command is sed to !ind o t that post!ix is comp"ied with m$s&" or not?

    E postconf !$nisre&expenviron$ys+l

    btreeunixhash

    Q: - What steps re& ired to et 4ost!ix to connect to the F$,Q database?! define the Dy*QL aliasZ$aps entry in the $ain.cf confi&uration filealiasZ$aps < hash /etc/postfix/aliases# $ys+l /etc/postfix/$ys+l!aliases.cf ! he confi&uration file $ys+l!aliases.cf defines the para$eters necessary for postfix to connect to the Dy*QL database.

    Q: - ;xp"ain smtpdLrecipientL"imit parameter? 9nd what is the de!a "t va" e !or this parameter?he s$tpdZrecipientZli$it para$eter can li$it the nu$ber of recipients allowed in a sin&le inco$in& $essa&e.he default value for this para$eter is :111.

    Q: - ;xp"ain smtpdLtimeo t 4arameter?

    he s$tpdZti$eout para$eter li$its the a$ount of ti$e ostfix waits for an *D client re+uest after sendin& a response. his allows the ostfix ad$inistrator to +uic5ly disconnect*D servers that Rca$p outS on the *D connection# utili"in& syste$ resources for the *D connection without actually sendin& a $essa&e.s$tpdZti$eout < value8y default# ostfix will assu$e the value is in seconds.

    Q: - ;xp"ain & e eLr nLde"a$ 4arameter?he +ueueZrunZdelay para$eter sets the ti$e interval ;in seconds@ that ostfix scans the deferred $essa&e +ueue for $essa&es to be delivered. he default value for this is :#111

    seconds.

    Q: - ;xp"ain maxima"L& e eL"i!etime 4arameter?he $axi$alZ+ueueZlifeti$e para$eter sets the a$ount of ti$e ;in days@ that a $essa&e re$ains in the deferred $essa&e +ueue before bein& returned as undeliverable. he default

    value is = days. Cnce this value is reached# ostfix returns the $essa&e to the sender.

    Q: - ;xp"ain minima"Lbac%o!!Ltime 4arameter?he $ini$alZbac5offZti$e para$eter sets one value that has two uses the $ini$u$ a$ount of ti$e used to hold a $essa&e in the deferred $essa&e +ueue and the $ini$u$ a$ount

    of ti$e for which a host can be $ar5ed unreachable. he default value for this para$eter is :#111 seconds.

  • 8/11/2019 Linux Interview Notes

    41/51

    Linux Interview Questions

    Q: - ;xp"ain maxima"Lbac%o!!Ltime 4arameter?he $axi$alZbac5offZti$e value sets an upper li$it to the a$ount of ti$e a $essa&e is left in the deferred $essa&e +ueue without a delivery atte$pt. he default value for this

    para$eter is #111 seconds.

    Q: - ;xp"ain de!a "tLdestinationLconc rrenc$L"imit 4arameter?he defaultZdestinationZconcurrencyZli$it para$eter defines the $axi$u$ nu$ber of concurrent *D sessions that can be established with any re$ote host. his para$eter is

    related to the *D $axprocess para$eter in the $aster.cf confi&uration file. he $axi$u$ nu$ber of concurrent *D sessions cannot exceed the $axprocess value set for the$axi$u$ nu$ber of *D client processes. hus# if the default $axprocess value of =1 is used# settin& the defaultZdestinationZconcurrencyZli$it &reater than =1 has no effect.

    Q: - ;xp"ain initia"LdestinationLconc rrenc$ 4arameter?he initial nu$ber of concurrent *D sessions ostfix will establish with a re$ote host is defined by the initialZdestinationZconcurrency para$eter. he default value for this

    para$eter is >.

    949=H; ,;>E;> Q 9

    Q ! )hat is location of lo& files for Apache server T/var/lo&/httpd

    Q ! )hat are the types of virtual hosts T

    na$e!based and I !based. Na$e!based virtual host $eans that $ultiple na$es are runnin& on each I address.I !based virtual host $eans that a different I address exists for each website served. Dost confi&urations are na$ed!based because it only re+uires one I address.

    Q ! ow to restart Apache web server T

    service httpd restart

    Q ! ow to chec5 the version of Apache server T

    rp$ !+a Y&rep httpd

    Q ! )hat is $eanin& of PListenP in httpd.conf file T

    ort nu$ber on which to listen for nonsecure ;http@ transfers.

    Q ! )hat is %ocu$ent(oot T

    it is a location of files which are accessible by clients. 8y default# the Apache server in (ed at nterprise Linux is confi&ured to serve files fro$ the /var/www/ht$l/ directory.

    Q ! Cn which port Apache server wor5s T

  • 8/11/2019 Linux Interview Notes

    42/51

    Linux Interview Questionshttp ! port G1https ! port 0

    Q ! ell $e na$e of $ain confi&uration file of Apache server T

    httpd.conf

    Q ! Cn which version of apache you have wor5ed T

    httpd!>.>.0

    Q: - What do $o mean b$ a va"id ,erverName directive?

    he %N* syste$ is used to associate I addresses with do$ain na$es. he value of *erverNa$e is returned when the server &enerates a U(L. If you are usin& a certain do$ain na$e#you $ust $a5e sure that it is included in your %N* syste$ and will be available to clients visitin& your site.Q: - What is the main di!!erence between ocationV and 1irector$V sections?

    %irectory sections refer to file syste$ obMects Location sections refer to ele$ents in the address bar of the )eb pa&e

    What is the di!!erence between a restart and a race! " restart o! a web server?

    %urin& a nor$al restart# the server is stopped and then started# causin& so$e re+uests to be lost. A &raceful restart allows Apache children to continue to serve their current re+uestsuntil they can be replaced with children runnin& the new confi&uration.

    Q: - What is the se o! modLper" mod "e?

    mod_perl scriptin& $odule to allow better erl script perfor$ance and easy inte&ration with the )eb server.

    Q: - I! $o have added D"o "eve" 1eb A in httpd#con! !i"e/ than what wi"" happen?

    It will &ive you $ore infor$ation in the error lo& in order to debu& a proble$.

    Q: - =an $o record the F9= 6hardware7 address o! c"ients that access $o r server#

    NoQ: - =an $o record a"" the coo%ies sent to $o r server b$ c"ients in Web ,erver "o s?

    6es# add followin& lines in httpd.conf file.

    Busto$Lo& lo&s/coo5iesZin.lo& P] UNIQU ZI% e ] Boo5ie iP Busto$Lo& lo&s/coo5ies>Zin.lo& P] UNIQU ZI% e ] Boo5ie> iP

  • 8/11/2019 Linux Interview Notes

    43/51

    Linux Interview QuestionsQ: - =an we do a tomatica""$ ro"" over the 9pache "o s at speci!ic times witho t havin to sh t down and restart the server?

    6esUse ustom!o" and the rotatelo"s pro&ra$s

    Add followin& line in httpd.conf file. Busto$Lo& PY /path/to /rotatelo&s /path/to/lo"s /accessZlo&.]6!]$!]d GJ 11P co$bined

    Q: - What we can do to !ind o t how peop"e are reachin $o r site?

    Add the followin& effector to your activity lo& for$at. ] (eferer

    Q: - I! $o have on"$ one I4 address/ b t $o want to host two web sites on $o r server# What wi"" $o do?In this case I will use Na$e 8ased Kirtual hostin&.*erverNa$e :1.:::.>10.>=

    Na$eKirtual ost F G1OKirtual ost F G12*erverNa$e web:.test.co$%ocu$ent(oot /var/www/ht$l/web:O/Kirtual ost2

    OKirtual ost F G12*erverNa$e web>.test>.co$%ocu$ent(oot /var/www/ht$l/web>O/Kirtual ost2

    Q: - =an I serve content o t o! a director$ other than the DocumentRoot director$?

    6es# by usin& RAliasS we can do this.

    Q: - I! $o have to more than one U> map to the same director$ b t $o don't have m "tip"e lias directives# What $o wi"" do?

    In this case I will use RAliasDatchS directives.

    he AliasDatch directive allows you to use re&ular expressions to $atch arbitrary patterns in U(Ls and $ap anythin& $atchin& the pattern to the desired U(L.

    Q: - How $o wi"" p t a "imit on p"oads on $o r web server?

    his can be achieved by Li$it(e+uest8ody directive.O%irectory P/var/www/ht$l/dataZuploadsP2Li$it(e+uest8ody :11111O/%irectory2

    ere I have put li$it of :11111 8ytes

  • 8/11/2019 Linux Interview Notes

    44/51

    Linux Interview QuestionsQ: - I want to stop peop"e sin m$ site b$ 4rox$ server# Is it possib"e?

    O%irectory proxy http //www.test.co$/$yfiles2Crder Allow#%eny%eny fro$ all*atisfy AllO/%irectory2

    Q: - What is modLevasive mod "e?

    $odZevasive is a third!party $odule that perfor$s one si$ple tas5# and perfor$s it very well. It detects when your site is receivin& a %enial of *ervice ;%o*@ attac5# and it preventsthat attac5 fro$ doin& as $uch da$a&e. $odZevasive detects when a sin&le client is $a5in& $ultiple re+uests in a short period of ti$e# and denies further re+uests fro$ that client.

    he period for which the ban is in place can be very short# because it Must &ets renewed the next ti$e a re+uest is detected fro$ that sa$e host.

    Q: - How t to enab"e 4H4 scripts on $o r server?

    If you have mod_php installed# use #dd$andler to $ap .php and .phtml files to the handler. Add andler ap