linux interview questions & answers

Upload: sri-shailam

Post on 01-Mar-2018

258 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Linux Interview Questions & Answers

    1/87

    LINUX INTERVIEW QUESTIONS

    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. irectories are

    also represented as files and have an associated inode.

    2} what are the process states in UNIX?

    As a process e!ecutes it chan"es state accordin" to its circumstances.

    Uni! processes have the follo#in" states$%unnin"$ The process is either runnin" or it is read& to run . 'aitin"$

    The process is #aitin" for an event or for a resource. (topped$ The

    process has been stopped, usuall& b& receivin" a si"nal. )ombie$ The

    processes are dead but have not been removed from the process table.

    3} what command should you use to check the number o

    iles and disk space used and each users deined !uotas?

    rep*uota

    "} what command is used to remo#e the password assi$ned

    to a $roup?

    "pass#d +r

    %} what can you type at a command line to determine which

    shell you are usin$?

    echo (//

    &} write a command to ind all o the iles which ha#e been

    accessed within the last 3' days(

  • 7/25/2019 Linux Interview Questions & Answers

    2/87

    find 0 -t&pe f -atime -12 3 filename.t!t

    )} what is a *ombie?

    )ombie is a process state #hen the child dies before the parent

    process. In this case the structural information of the process is still in

    the process table.

    )} what daemon is responsible or trackin$ e#ents on your

    system?

    s&slo"d

    +} what do you mean a ,ile -ystem?

    4ile (&stem is a method to store and or"anize files and directories on

    dis5. A file s&stem can have 6 different formats called file s&stem t&pes.

    These formats determine ho# the information is stored as files and

    directories.

    78 tell me the name of director& structure hierarch& for /inu!

    0root 0boot 0bin 0sbin 0proc 0mnt 0usr 0var 0lib 0etc 0dev 0opt 0srv

    0tmp 0media

    1'} what does .boot directory contains?

    The 0boot0 director& contains static files re*uired to boot the s&stem,

    such as the /inu! 5ernel, boot loader confi"uration files. These files

    are essential for the s&stem to boot properl&.

    11} i someone deletes .boot directory rom your ser#er/

    than what will happen?

    In that case &our server #ill be in unbootable state. 9our (erver cant

    boot #ithout 0boot director& because this director& contains all

    bootable files

    12} what does .de# directory contain?

  • 7/25/2019 Linux Interview Questions & Answers

    3/87

    The 0dev director& contains all device files that are attached to s&stem

    or virtual device files that are provided b& the 5ernel.

    13} what is the role o ude# daemon?

    The udev demon used to create and remove all these device nodes or

    files in 0dev0 director&.

    1"} what kind o iles or nodes .de#. directory contains and

    how do I access or see de#ice iles?

    :loc5 evice 4iles$-

    :loc5 device files tal5s to devices bloc5 b& bloc5 ;< bloc5 at a time = ?

  • 7/25/2019 Linux Interview Questions & Answers

    4/87

    0dev0psau!

    1&} tell me the name o de#ice ile or parallel port

    0rinters(

    0dev0lp2

    1)} what does .etc.X11. directory contains?

    The 0etc0X

  • 7/25/2019 Linux Interview Questions & Answers

    5/87

    of the Oournal used to maintain consistenc&. The default Oournal size

    ta5es about a second to recover, dependin" on the speed of the

    hard#are.

    21} 4ny idea about et" ile system?

    The e!tJ or fourth e!tended files&stem is a Oournalin" file s&stem

    developed as the successor to e!t1. !tJ files&stem released as a

    functionall& complete and stable files&stem in /inu! #ith 5ernel

    version 6.K.6.

    4eatures of e!tJ file s&stem$-

  • 7/25/2019 Linux Interview Questions & Answers

    6/87

    m5e6fs -t e!tJ 0dev0L

    2%} 7plain .proc ilesystem?

    0proc is a virtual files&stem that provides detailed information about

    /inu! 5ernel, hard#ares and runnin" processes. 4iles under 0proc

    director& named as Lirtual files. :ecause 0proc contains virtual files

    thats #h& it is called virtual file s&stem. These virtual files have uni*ue

    *ualities. Eost of them are listed as zero b&tes in size. Lirtual files

    such as 0proc0interrupts, 0proc0meminfo, 0proc0mounts, and

    0proc0partitions provide an up-to-the-moment "limpse of the s&stems

    hard#are. Dthers, li5e the 0proc0files&stems file and the 0proc0s&s0

    director& provide s&stem confi"uration information and interfaces.2&} 6an we chan$e iles parameters placed under .proc

    directory?

    9es To chan"e the value of a virtual file, use the echo command and a

    "reater than s&mbol =3 to redirect the ne# value to the file. 4or

    e!ample, to chan"e the hostname on the fl&, t&pe$

    echo http$00###.ne!tstepJit.com3 0proc0s&s05ernel0hostname

    2)} 8hat is the use o sysctl command?

    The 0sbin0s&sctl command is used to vie#, set, and automate 5ernel

    settin"s in the 0proc0s&s0 director&.

    2+} .proc. directory contains a number o directories with

    numerical names( 8hat is that?

    These directories are called process directories, as the& are named

    after a pro"rams process I and contain information specific to that

    process.

    29} 8hat is :4I;?

    %AI, stands for %edundant Arra& of Ine!pensive is5s. %AI is a

    method b& #hich same data or information is spread across several

    http://www.nextstep4it.com/http://www.nextstep4it.com/
  • 7/25/2019 Linux Interview Questions & Answers

    7/87

    dis5s, usin" techni*ues such as dis5 stripin" =%AI /evel 2, dis5

    mirrorin" =%AI /evel

  • 7/25/2019 Linux Interview Questions & Answers

    8/87

    %AI /evel < is based on Eirrorin" techni*ue. /evel < provides

    redundanc& b& #ritin" identical data to each member dis5 of the arra&.

    The stora"e capacit& of the level < arra& is e*ual to the capacit& of one

    of the mirrored hard dis5s in a ard#are %AI or one of the mirroredpartitions in a (oft#are %AI. %AI < provides redundanc& means

    "ood protection a"ainst dis5 failure. In %AI < #rite speed is slo# but

    read speed is "ood.

    3"} 7plain :4I; %?

    %AI /evel ? is based on rotatin" parit& #ith stripin" techni*ue.

    %AI-? stores parit& information but not redundant data =but parit&

    information can be used to reconstruct data. The stora"e capacit& of(oft#are %AI level ? is e*ual to the capacit& of the member

    partitions, minus the size of one of the partitions if the& are of e*ual

    size. The performance of %AI ? is based on parit& calculation process

    but #ith modern CUs that usuall& is not a ver& bi" problem. In %AI

    ? read and #rite speeds are "ood.

    M

    3%} 8hich kernel module is re!uired or -otware:4I;?RmdS module

    3&} which utility or command is used or creatin$ sotware

    :4I;sor :57

  • 7/25/2019 Linux Interview Questions & Answers

    9/87

    pieces of the stripe on each dis5 The pieces a stripe is bro5en into are

    called chun5s.To "et "ood performance &ou must have a reasonable

    chun5 size.

    4or bi" I0Ds #e re*uired small chun5s and for small I0Ds #e re*uiredbi" chun5s.

    39} 8hat is -840 -pace?

    (#ap space in /inu! is used #hen the amount of ph&sical memor&

    =%AE is full. If the s&stem needs more memor& resources and the

    %AE is full, inactive pa"es in memor& are moved to the s#ap space.

    'hile s#ap space can help machines #ith a small amount of %AE, it

    should not be considered a replacement for more %AE. (#ap space islocated on hard drives, #hich have a slo#er access time than ph&sical

    memor&.

    "'} 8hat are the steps to create -840 iles or 0artition?+

    Create s#ap partition or file + 'rite special si"nature usin" Rm5s#apS

    + Activate s#ap space b& Rs#apon +aS command + Add s#ap entr&

    into 0etc0fstab file

    "1} 5ow you will create swap ile o si*e " => and eplainswap ileentry in .etc.stab ile?

    Use RddS command to create s#ap file.

    dd if>0dev0zero of>0('A4I/ bs>J

    m5s#ap 0('A4I/

    s#apon +a

    ntr& into 0etc0fstab file.0('A4I/ s#ap s#ap defaults 2 2

    "2} ell me the steps to remo#e the swap ile?

    4irstl& disable the s#ap file b& Rs#apoffS command. %emove (#ap file

    entr& from 0etc0fstab file. No# remove the s#ap file b& RrmS

  • 7/25/2019 Linux Interview Questions & Answers

    10/87

    command.

    "3} 8hat can we do with @partedA command or utility?+

    Lie# the e!istin" partition table + Add partitions from free space or

    additional hard drives + Chan"e the size of e!istin" partitionsJJ8 o# #e #ill chec5 free space on drive 0dev0sda #ith parted

    command Fparted 0dev0sda

    print

    "%} 6an we resi*e the si*e o a partition?

    9es, #e can resize the size of partition b& RpartedS command.

    Fparted 0dev0sda

    printTo resize the partition, use the resize command follo#ed b& the minor

    number for the partition, the startin" place in me"ab&tes, and the end

    place in me"ab&tes. 4or e!ample$

    resize 1

  • 7/25/2019 Linux Interview Questions & Answers

    11/87

    Fv"create L/2 0dev0sda6 + Create lo"ical volume from volume

    "roup b& RlvcreateS command.

    Flvcreate -/

  • 7/25/2019 Linux Interview Questions & Answers

    12/87

    %"} 5ow you will check on Dour ser#er or system de#iceE

    mapper is installed or not?

    Chec5 the follo#in" file. Fcat 0proc0misc

    if this file contains Rdevice-mapperS term it means device mapper is

    installed on &our s&stem.

    %%} 5ow are snapshots in

  • 7/25/2019 Linux Interview Questions & Answers

    13/87

    umount 0dev0Qv"name30Qlvname3

    and then use the lvremove command$

    lvremove 0dev0Qv"name30Qlvname3

    &1} 8hich command is used to create

  • 7/25/2019 Linux Interview Questions & Answers

    14/87

    CU( stands for RCommon UNIX rintin" (&stemS. CU( is a open

    source printin" s&stem developed b& Apple Inc. CU( uses the

    Internet rintin" rotocol =I to allo# local printin" and print

    sharin".&&} 8hat is the location o lo$ iles or 6U0-?

    The lo" files for the CU( printin" s&stem are located in the

    0var0lo"0cups0 director&.

    &)} 8hat is DUC?

    9UE stands for 9ello# do" Updater, Eodified because it is based on

    9U, the 9ello# do" Updater. 'here does the name 9ello# do" comefrom 9ello# o" is a version of /inu! for the o#er Architecture

    hard#are and is %E-based, Oust li5e %ed at nterprise /inu! and

    4edora. 9U, and later 9UE, #ere #ritten b& the /inu! communit& as

    a #a& to maintain an %E-based s&stem.

    K8 'hat are the advanta"es of 9UE

    + Automatic resolution of soft#are dependencies. + Eultiple soft#are

    locations at one time. + Abilit& to specif& particular soft#are versionsor architectures.

    &9} 5ow you will install sotware by DUC?

    &um install Qp5"name3

    )'} 8hich option is re!uired to assume the answer @yesA to

    any !uestions asked durin$ installation o packa$e

    dependencies or DUC?

    The R-&S option is used to assume the ans#er R&esS.

    4or !ample

    &um -& install s*uid

    )1} 5ow to remo#e a sotware by DUC?

  • 7/25/2019 Linux Interview Questions & Answers

    15/87

    &um remove Qp5"name3

    )2} 5ow Cany :un

  • 7/25/2019 Linux Interview Questions & Answers

    16/87

    Intel EKJT

    iaKJ IntelZ Itanium

    ppc 16-bit I:EZ D'%, I:E e(erver\ p(eriesZ, and I:E e(erver

    i(eriess172! KJ-bit I:E e(erver (&stem z

    )%} 5ow to install

  • 7/25/2019 Linux Interview Questions & Answers

    17/87

    it *ueries the %E database for #hich pac5a"e o#ns Qfilename3.

    'hen specif&in" a file, specif& the absolute path of the file.

    +2} 5ow to #eriy all installed packa$es?

    rpm +La

    +3} 5ow to #eriy the si$nature o an rpm?

    rpm -@ test-0home 0home e!t1 acl < 6

    No# remount 0home partition #ith acl option.

    mount -t e!t1 -o acl 0dev0sda1 0home

    ++} 5ow to Biew 46

  • 7/25/2019 Linux Interview Questions & Answers

    18/87

    setfacl +remove-all Qfile-name3

    9'} 8hat is the dierence between pop3 and imap

    protocols?

    D1 =ost Dffice rotocol is the most commonl& used internet

    mail protocol.It#or5s on

  • 7/25/2019 Linux Interview Questions & Answers

    19/87

    F pass#d Qusername3 -l

    This mi"ht be useful in the situation #here &ou dont #ant to

    permanentl& remove the user, but &ou Oust #ant it disabled and no

    lon"er able to use the s&stem. The user #ill still receive emails fore!ample, but he #ill not be able to lo"in and chec5 them out.

    To re-enable the account ,Oust use belo# command

  • 7/25/2019 Linux Interview Questions & Answers

    20/87

    repeatedl& ,

    at command is used to schedule the tas5 onl& once i.e to run onl& one

    time.

    9%} 8hat is network bondin$ in noneDN:DDT>&es

    %eplace above I address #ith &our actual I address. (ave file and

    e!it to shell prompt.

    (tep F6$ Eodif& eth2 and eth< confi" files$

  • 7/25/2019 Linux Interview Questions & Answers

    21/87

    Dpen both confi"uration usin" vi te!t editor and ma5e sure file read as

    follo#s for eth2 interface F vi 0etc0s&sconfi"0net#or5-scripts0ifcf"-

    eth2 Eodif&0append directive as follo#s$ LIC>eth2

    U(%CT/>no DN:DDT>&es EA(T%>bond2 (/AL>&es:DDT%DTD>none

    Dpen eth< confi"uration file usin" vi te!t editor$

    F vi 0etc0s&sconfi"0net#or5-scripts0ifcf"-etheth< U(%CT/>no DN:DDT>&es EA(T%>bond2

    (/AL>&es :DDT%DTD>none

    (ave file and e!it to shell prompt.

    (tep F 1$ /oad bond driver0module

    Ea5e sure bondin" module is loaded #hen the channel-bondin"

    interface =bond2 is brou"ht up. 9ou need to modif& 5ernel modules

    confi"uration file$

    F vi 0etc0modprobe.conf Append follo#in" t#o lines$

    alias bond2 bondin" options bond2 mode>balance-alb miimon>

  • 7/25/2019 Linux Interview Questions & Answers

    22/87

    ermanent ' addr$ 22$2c$67$cK$be$?7

    (lave Interface$ ethlock in

  • 7/25/2019 Linux Interview Questions & Answers

    25/87

    (tatus

    Information about other metadata structures

    If this information lost, &ou are in trouble =data loss so /inu!

    maintains multiple redundant copies of thesuperbloc5 in ever& files&stem. This is ver& important in man& emer"enc& situation, for

    e!ample &ou can usebac5up copies to restore dama"ed primar& super

    bloc5.

    4ollo#in" command displa&s primar& and bac5up superbloc5 location

    on 0dev0sda1$

    F dumpe6fs 0dev0hda1 Y "rep -i superbloc5

    J K 8hat is the load a#era$e o the ser#er and 8hat is an

    acceptable -er#er

  • 7/25/2019 Linux Interview Questions & Answers

    26/87

    1'&} 6an we ha#e two apache ser#ers ha#in$ di #ersions?

    9es, &ou can have t#o different apache servers on one server, but the&

    cant listen to the same port at the same time.Normall& apache listens

    to port 2 #hich is the default TT port. The second apache version

    should listen to another port #ith the /isten option in httpd.conf, for

    e!ample to port

  • 7/25/2019 Linux Interview Questions & Answers

    27/87

    N,- -7:B7:

    1} 7plain this entry .shared

    192(1&+(1('.2%%(2%%(2%%('sync/rw

    allo#s all s&stems #ith

  • 7/25/2019 Linux Interview Questions & Answers

    28/87

    N4( stands for Net#or5 4ile (&stem. N4( #as ori"inall& developed b&

    (un Eicros&stems in the

  • 7/25/2019 Linux Interview Questions & Answers

    29/87

    The e!portfs command is used to maintain the current table of

    e!ported file s&stems for N4(.

    1"} 7plain command @.usr.sbin.eports EA?

    It #ill flush ever&thin" out of the 5ernels e!port table. An& clients that

    are active #ill "et ne# entries added b& mountd #hen the& ma5e their

    ne!t re*uest.

    1%} 8hich option is used with eports command to display

    the current eport list/ also displays the list o eport

    options?

    e!portfs -v

  • 7/25/2019 Linux Interview Questions & Answers

    30/87

    2'} 8hat do you understand by @nsstat Eo all E23"A

    command?

    It #ill (ho# all information about all versions of N4(.

    21} 8hat do you understand by @nsstat Kns Kser#er E3A

    command?

    It #ill sho# statistics for N4( version 1 server.

    22} 6an N,- share mounted on 8indow X0 and Mustiy your

    answer?

    No, 'indo# X operatin" s&stem doesnt support nfs protocol.

    23} 192(1&+(1(%1J.data is eported by N,- -er#er and i want

    to add this N,- share to client .etc.stab ile( 5ow you will

    add this entry in .etc.stab ile?

    F device mount-point fs-t&pe options dump fsc5order

  • 7/25/2019 Linux Interview Questions & Answers

    31/87

    2&} 8hat is @portmapA?

    The portmapper 5eeps a list of #hat services are runnin" on #hat

    ports. This list is used b& a connectin" machine to see #hat ports it

    #ants to tal5 to access certain services.2)} 5ow you will check @portmapA ser#ice is runnin$ or not?

    rpcinfo -p

    2+} I am unable to mount a N,- share( 5ow will you trace

    out the reason?

    4irstl&, chec5 that &ou have permissions to mount nfs share or not.

    Chec5 0etc0e!ports file.

    (econdl& &ou can "et %C error$ ro"ram Not %e"istered =or anotherR%CS error

    4or this chec5 &our N4( server and portmap service runnin" or not b&

    Rrpcinfo -pS

    29} 6an I modiy eport permissions without needin$ to

    remount clients in order to ha#e them take eect?

    9es. The safest thin" to do is edit 0etc0e!ports and run Re!portfs -rS.

    ,0 -7:B7:

    1} 5ow to deny speciic users access to the ,0 ser#er?

    To den& specific users access to the 4T server, add their usernames to

    the 0etc0vsftpd0 ftpusers file. :& default, s&stem users such as root and

    nobod& are included in this list.

    2} 6an we create lo$s or tp authenticated sessions?

    9es, If the !ferlo"[enable directive in vsftpd.conf is set to 9(, file

    transfers usin" the 4T protocol are lo""ed to 0var0lo"0!ferlo".

    Information such as a time stamp, I address of the client, the file

  • 7/25/2019 Linux Interview Questions & Answers

    32/87

    bein" transferred, and the username of the person #ho authenticated

    the connection is included in the lo" entr&.

    3} 8hat is meanin$ o maLclients parameter?

    Ea!imum number of clients that can connect at one time. If set to 2,

    the number of clients is unlimited.

    "} Gn which port B-,0 ser#er works ?

    4T uses t#o ports, 62 and 6

  • 7/25/2019 Linux Interview Questions & Answers

    33/87

    %ed at nterprise /inu! ? or 4D%A includes the vsftpd 4T

    service.

    vsftpd-6.2.?-

  • 7/25/2019 Linux Interview Questions & Answers

    34/87

    'hen enabled, vsftpd attempts to maintain lo"in sessions for each

    user throu"h lu""able Authentication Eodules =AE.

    3} Is there any way to monitor clients connected to

    #stpd?9es. 'e actuall& have t#o sli"htl& different methods to

    monitor vsftpd clients. 4irst, ma5e sure &ou have enabled the confi"

    option, Rsetproctitle[enable>9(S li5e in our e!ample above and

    restart &our vsftpd server. Then run the command R#atch ps -Cvsftpd

    -o user, pid, stime, cmdS to #atch the processes includin" ip,

    username and actions li5e idle or data retrieval.

  • 7/25/2019 Linux Interview Questions & Answers

    35/87

    :IN uses 0etc0named.conf as its main confi"uration file, the

    0etc0rndc.conf file as the confi"uration file for name server control

    utilit& rndc, and the 0var0named0 director& for zone files and the li5e.

    2} 8hat is >IN;?

    :IN stands for :er5ele& Internet Name omain #hich is the most

    commonl& used omain Name (&stem =N( server on the Internet.

    3} Gn which #ersion o bind u ha#e worked?

    :IN 7

    "} 8hat is the role o ;N-?

    A N( server, or name server, is used to resolve an I address to a

    hostname or vice versa.

    %} Gn which port ;N- ser#er works?

    N( servers use port ?1 b& default. Incomin" and out"oin" pac5ets

    should be allo#ed on port ?1. Also allo# connections on port 76< if&ou confi"ure a li"ht#ei"ht resolver server. The N( control utilit&,

    rndc, connects to the N( server #ith TC port 7?1 b& default. If &ou

    are runnin" rndc on the name server, connections on this TC port

    from localhost should be allo#ed. If &ou are runnin" rndc on

    additional s&stems, allo# connections to port 7?1 =or #hatever port

    &ou have chosen to confi"ure from these additional s&stems.

    &} 8hat is round robin ;N-?

    %ound robin N( is usuall& used for balancin" the load of

    "eo"raphicall& distributed 'eb servers. 4or e!ample, a compan& has

    one domain name and three identical home pa"es residin" on three

    servers #ith three different I addresses. 'hen one user accesses the

  • 7/25/2019 Linux Interview Questions & Answers

    36/87

    home pa"e it #ill be sent to the first I address. The second user #ho

    accesses the home pa"e #ill be sent to the ne!t I address, and the

    third user #ill 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. The fourth user,therefore, #ill be sent to the first I address, and so forth.

    )} 8hat is Name -er#er?

    A name server 5eeps information for the translation of domain names

    to I addresses and I addresses to domain names. The name server is

    a pro"ram that performs the translation at the re*uest of a resolver or

    another name server.

    +} 8hat is 0rimary name ser#er or primary master ser#er?

    rimar& name server0primar& master is the main data source for the

    zone. It is the authoritative server for the zone. This server ac*uires

    data about its zone from databases saved on a local dis5. The primar&

    server must be published as an authoritative name server for the

    domain in the (DA resource record, #hile the primar& master server

    does not need to be published.

    9}8hat is -econdary name ser#er.sla#e name ser#er?

    (econdar& name server0slave name server ac*uires data about the

    zone b& cop&in" the data from the primar& name server =respectivel&

    from the master server at re"ular time intervals. It ma5es no sense to

    edit these databases on the secondar& name servers, althou"h the& are

    saved on the local server dis5 because the& #ill be re#ritten durin"

    further cop&in".

    1'} what is :oot name ser#er?

  • 7/25/2019 Linux Interview Questions & Answers

    37/87

    %oot name server is an authoritative name server for the root domain

    =for the dot. ach root name server is a primar& server, #hich

    differentiates it from other name servers.

    11} what is -tealth name ser#er?

    (tealth name server is a secret server. This t&pe of name server is not

    published anhere. It is onl& 5no#n to the servers that have its I

    address staticall& listed in their confi"uration. It is an authoritative

    server. It ac*uires the data for the zone #ith the help of a zone

    transfer. It can be the main server for the zone. (tealth servers can be

    used as a local bac5up if the local servers are unavailable.

    I12} 8hat do you mean by @:esource :ecordsA?

    Information on domain names and their I addresses, as #ell as all

    the other information distributed via N( is stored in the memor& of

    name servers as %esource %ecords =%%.

    13} 7plain @

  • 7/25/2019 Linux Interview Questions & Answers

    38/87

    There is al#a&s onl& one (DA record in the file, and it is placed at the

    be"innin" of the file of authoritative resource records.

    1&} what is @4 :ecordA?

    A =Address records assi"n I addresses to domain names of

    computers. The I address cannot have a dot at the end.

    1)} 7plain @6N4C7 :ecordA?

    (&non&ms to domain names can be created usin" CNAE records.

    This is often referred to as creatin" aliases for computer names.

    1+} 8hat are @5IN,G and X :ecordsA?

    IN4D and TXT records are for information onl&. An IN4D record

    has t#o items in its data part. The first item is information about

    hard#are, and the second one is information about soft#are. A TXT

    record contains a "eneral data strin" in its data part.

    !ample $ test.com IN (DA ^ ^ mail IN A

  • 7/25/2019 Linux Interview Questions & Answers

    39/87

    2'} 7plain @0: :ecordsA?

    A ointer %ecord =T% is used to translate an I address into a

    domain name.

    6

  • 7/25/2019 Linux Interview Questions & Answers

    40/87

    -U port 4 ser#er ypes ?

    + rimar& omain Controller =C + :ac5up omain Controller

    =:C + A( omain Controller

    K8 'hich protocol (AE:A server uses (E:, #hich stands for (erver

    Eessa"e :loc5, is a protocol for sharin" files, printers, serial ports,and communications abstractions such as named pipes and mail slots

    bet#een computers.

    )} 5ow ;oes a 8orkstation ind its ;omain 6ontroller?

    There are t#o different mechanisms to locate a domain controller$ one

    method is used #hen Net:ID( over TC0I is enabled and the other

    #hen it has been disabled in the TC0I net#or5 confi"uration.'here Net:ID( over TC0I is disabled, all name resolution involves

    the use of N(, broadcast messa"in" over U, as #ell as Active

    irector& communication technolo"ies.

  • 7/25/2019 Linux Interview Questions & Answers

    41/87

    +} 6an -amba >e a >ackup ;omain 6ontroller to an N"

    0;6?

    No. The native NTJ (AE replication protocols have not &et been full&

    implemented.

    9} 5ow ;o I :eplicate the smbpasswd ,ile?

    %eplication of the smbpass#d file is sensitive. It has to be done

    #henever chan"es to the (AE are made. ver& users pass#ord

    chan"e is done in the smbpass#d file and has to be replicated to the

    :C. (o replicatin" the smbpass#d file ver& often isnecessar&.As the

    smbpass#d file contains plainte!t pass#ord e*uivalents, it must not

    be sent unencr&pted over the #ire. The best #a& to set up smbpass#d

    replication from the C to the :C is to use the utilit& rs&nc. rs&nc

    can use ssh as a transport. ssh itself can be set up to accept onl& rs&nc

    transfer #ithout re*uirin" the user to t&pe a pass#ord.As said a fe#

    times before, use of this method is bro5en and a#ed. Eachine trust

    accounts #ill "o out of s&nc, resultin" in a bro5en domain. This

    method is not recommended. Tr& usin" /A instead.1'} 6an -amba ully replace my 8indows N ser#er that is

    not a 0rimary ;omain 6ontroller 0;6?

    (amba can completel& serve files and printers to 'indo#s, Oust as a

    'indo#s NT server #ould.

    11} 6an -amba replaces my 8indows N 0;6?

    Not completel&. (amba domain control capabilities for a 'indo#s 7!

    client are solid and complete, and so these clients #ould probabl&

    never 5no# the difference. The domain control support for 'indo#s

    NT06222 clients is still bein" developed. Currentl&, enou"h has been

    implemented to allo# a 'indo#s NT client to Ooin a (amba-controlled

    domain, but there is more to domain control than that. The most

  • 7/25/2019 Linux Interview Questions & Answers

    42/87

    conspicuous absence is the lac5 of support for 'indo#s NT trust

    relationships and the (AE replication protocol used bet#een NT Cs

    and :ac5up omain Controllers =:Cs.

    12} 8hat 60 and U;0 ports re!uired or Net>IG- o#er

    60.I0 use?

    The N:T name service uses port

  • 7/25/2019 Linux Interview Questions & Answers

    43/87

    share, the client is issued a tree connection I =TI. The TI is used

    in all re*uests to access files contained in the resource to #hich the

    TI refers. In this #a& (E: protocol #or5s.

    1"} 5ow man sections samba coni$uration ile smb(con

    contains?

    smb.conf file contains three sections.

    user1)} 5ow you will #eriy that your smb(con ile doesnt ha#e

    any mistakes and misspellin$s?

    Rtestparm S tool that verifies the s&nta! of a confi"uration

    file=smb.conf.

    testparm -s smb.conf

    1+} 8hat is the use o @smbclientA command?

    RsmbclientS is used to displa& the list of shares on &our server. This

    verifies that smbd is runnin" and functionin" correctl&. The -/ option

    instructs smbclient to enumerate the shares on the server rather than

    actuall& connectin" to one. The -N s#itch instructs smbclient to use an

  • 7/25/2019 Linux Interview Questions & Answers

    44/87

    anon&mous lo"in rather than the lo"in name of the current user.

    smbclient -/ localhost -N

    Antother use of RsmbclientS command to connect the samba share.

    smbclient 00Qserver30Qshare3 -U Qusername3

  • 7/25/2019 Linux Interview Questions & Answers

    45/87

    The most li5el& cause is that ('AT is not listenin" to connections, or

    &ou have used the #ron" U%/ in tr&in" to connect to ('AT. ('AT

    usuall& lives behind port 72

  • 7/25/2019 Linux Interview Questions & Answers

    46/87

    It #ill define the "roup id to be used for all file access in the place of

    the users primar& "roup.

    (ubmitted :&$-Larun mail-I$ -5umar.varun

  • 7/25/2019 Linux Interview Questions & Answers

    47/87

    domain trust relationships. This is impossible #ith server-level

    securit&. The second reason is that, under server-level securit&, each

    smbd process must 5eep an open connection #ith the authentication

    server. This can drain a 'indo#s NT C *uic5l&. Under domain-level securit&, this connection is maintained onl& lon" enou"h to

    perform the validation, thus conservin" valuable resources. The final

    reason is that, as a domain member, the (amba server has access to

    much more information about user accounts, #hich can be used to

    automate the creation and deletion of user accounts upon demand.

    33} what is nmbd daemon?

    This daemon handles all name re"istration and resolution re*uests. It

    is the primar& vehicle involved in net#or5 bro#sin". It handles all

    U-based protocols. The nmbd daemon should be the first command

    started as part of the (amba startup process.

    3"} 8hat is smdb daemon?

    This daemon handles all TC0I-based connection services for file-

    and print-based operations. It also mana"es local authentication. It

    should be started immediatel& follo#in" the startup of nmbd.

    3%} 8hat is winbindd daemon?

    This daemon should be started #hen (amba is a member of a

    'indo#s NTJ or A( domain. It is also needed #hen (amba has trust

    relationships #ith another domain. The #inbindd daemon #ill chec5

    the smb.conf file for the presence of the idmap uid and idmap "id

    parameters. If the& are found, #inbindd #ill use the values specified

    for UI and I allocation. If these parameters are not specified,

    #inbindd #ill start but it #ill not be able to allocate UIs or Is.

    3&} 7plain the parameter @wins support O DesA used

    in smb(con?

    If the (amba server #as confi"ured to provide 'IN( support =R#ins

  • 7/25/2019 Linux Interview Questions & Answers

    48/87

    support > 9esS, then the 'IN( server is able to provide name

    resolution for all of the hosts that are not listed in the 0etc0hosts file or

    #ithin the N(. Ea5in" this adOustment in the Name (ervice (#itch

    confi"uration file =0etc0nss#itch.conf allo#s the /inu! s&stem to*uer& the 'IN( server for local name resolution. This saves manual

    adOustments to host files.

    3)} 5ow to automate -C> share mountin$ durin$ system

    startup?

    Add smb share entr& in 0etc0fstab file.

    00I[A%(([D4[(%L%0(hared 0shared smbfs noauto,defaults

    2 2

    3+} how to start and stop samba ser#er?

    0etc0init.d0smb restart

    -7NC4I< -7:B7:

    1} 5ow to start sendmail ser#er ?

    service sendmail restart2} Gn which ports sendmail and senmail with --< works ?

    :& default, (endmail uses TC and U port 6? for non-encr&pted

    transfers. If the (endmail server is confi"ured to use ((/ for

    encr&ptin" email sent and received, it uses port JK?.

    3} 7plain use o @trustedEusersA ile ?

    /ist of users that can send email as other users #ithout a #arnin"

    includin" s&stem users such as apache for the Apache TT (erver.

    "} 7plain the use o @localEhostEnamesA ile ?

  • 7/25/2019 Linux Interview Questions & Answers

    49/87

    If the email server should be 5no#n b& different hostnames, list the

    host- names in this file, one line per hostname. An& email sent to

    addresses at these hostnames is treated as local mail. The

    4ATU%=_use[c#[file` option must be enabled inthesendmail.mc file for this file to be referenced.

    %} eplain the use o .etc.aliases ile ?

    0etc0aliases, can be used to redirect email from one user to another. :&

    default, it includes redirects for s&stem accounts to the root user. It

    can then be used to redirect all email for the root user to the user

    account for the s&stem administrator.

    &} 6an we use --< 7ncryption with -endmail ?

    9es, (endmail can be confi"ured to encr&pt email sent and received

    usin" ((/ =secure soc5ets la&er.

    )} 8hat is -endmail?

    (endmail is an ETA, meanin" it accepts email messa"es sent to it

    usin" the (ET proto- col and transports them to another ETA email

    server until the messa"es reach their destinations. It also acceptsemail for the local net#or5 and delivers them to local mail spools, one

    for each user.

    +} 8hat is the role o CU49} 8hich are the important

    coni$uration iles or -endmail ser#er??

    An EUA =Eail User A"ent #ith access to the mailbo! file, directl& or

    throu"h a net#or5 file

    s&stem, can read messa"es from the dis5 and displa& them for the

    user. This is "enerall& a console or #ebmail application runnin" on the

    server.

    The 0etc0mail0 director& contains all the (endmail confi"uration files,

    #ithsendmail.cf and submit.cf bein" the main confi"uration files.

  • 7/25/2019 Linux Interview Questions & Answers

    50/87

    The sendmail.cf file includes options for the mail transmission a"ent

    and accepts (ET connections for sendin" email. The submit.cf file

    confi"ures the mail submission pro"ram.

    1'} 5ow to coni$ure sendmail to accept mail or local

    deli#ery that is addressed to other hosts?

    Create a 0etc0mail0local-host-names file. ut into that file the

    hostnames and domain names for #hich sendmail should accept mail

    for local deliver&. nter the names #ith one hostname or domain

    name per line. And also ma5e sure that (endmail confi"uration file

    should contain Ruse[c#[fileS option.

    dnl /oad class ># #ith other names for the local host4ATU%=_use[c#[file

    11} 8hen an or$ani*ation stores aliases on an

  • 7/25/2019 Linux Interview Questions & Answers

    51/87

    the desired aliases, rebuild the aliases database file #ith the

    ne#aliases command.

    13} Dou ha#e been asked to create a sendmail coni$uration

    that sends all local mail to a mail hub/ while directly

    deli#erin$ mail addressed to eternal systems(

    Create a sendmail confi"uration containin" the EAI/[U: define to

    identif& the mail rela& host for local mail. Use the /DCA/[U(%

    command to e!empt the root users mail from rela&in".

    dnl efine a rela& server for local mail define=_EAI/[U:,

    _smtp.test.com dnl Users #hose mail is not passed to the mail hub/DCA/[U(%=root

    %ebuild and reinstall sendmail.cf, and then restart sendmail.

    1"} 5ow to coni$ure multiple mail !ueues?

    m5dir 0var0spool0m*ueue0*ueue.< m5dir

    0var0spool0m*ueue0*ueue.6 m5dir 0var0spool0m*ueue0*ueue.1

    chmod M22 0var0spool0m*ueue0*ueue.< chmod M22

    0var0spool0m*ueue0*ueue.6 chmod M22 0var0spool0m*ueue0*ueue.1

    Add the UU[I% define to the sendmail confi"uration to use the

    ne# *ueue directories.

    dnl eclare the *ueue director& path define=_UU[I%,

    _0var0spool0m*ueue0*ueue.G

    1%} 5ow to disable certain -C0 commands?

    Add the conf%ILAC9[4/A( define to the sendmail confi"uration toset rivac& Dptions that disable un#anted, optional (ET commands.

    ere #e #ill disables the XN, L%49, L%:, and T%N commands.

    dnl isable XN, L%49, L%: and T%N

    define=_conf%ILAC9[4/A(, _noe!pn,novrf&,noverb,noetrn

    %ebuild and reinstall sendmail.cf, and then restart sendmail.

  • 7/25/2019 Linux Interview Questions & Answers

    52/87

    1&} In which -endmail coni$uration ile we ha#e to make

    chan$es?

    #e #ill ma5e the chan"es onl& in the sendmail.mc file, and the

    chan"es #ill be moved into the sendmail.cf file for us.

    1)} 8hen -endmail dispatches your email/ it places the

    ser#ers hostname behind your username/ which becomes

    the @rom addressA in the email ie(

    userPmail(test(com(>ut we want to use the domain name

    and not the hostname?

    define=_confDEAIN[NAE,

    _test.comdnl 4ATU%=_rela&[entire[domaindnl

    1+} 8hat does .etc.mail.access ile contains?

    The access database =R0etc0mail0accessS is a list of I addresses and

    domainnames of allo#able connections.

    4ATU%=_access[db,_hash -TQTE43 -o 0etc0mail0access.dbdnl

    and cat 0etc0mail0access

    localhost.localdomain %/A9 localhost %/A9

  • 7/25/2019 Linux Interview Questions & Answers

    53/87

    21} 8hich anti#irus you ha#e inte$rated with sendmail ?

    ClaimAL

    22} 8hat is 6lama#ECilter?

    Clamav-Eilter is a tool to inte"rate sendmail and clamAL antivirus.

    23} 8hich coni$uration iles are re!uired to inte$rate

    sendmail and 6laim4B anti#irus?

    milter.conf and clamav-milter

    2"} 5ow to test sendmail inte$ration with 6laim4B?

    "rep Eilter 0var0lo"0maillo"9ou have to "et follo#in" t&pe of messa"es.

    sendmail$ Eilter add$ header$ X-Lirus-(canned$ ClamAL version

    2..6, clamav-milter version 2..6 on mail.test.com sendmail$

    Eilter add$ header$ X-Lirus-(tatus$ Clean

    2%} 8hich tool you ha#e used to block spammin$?

    (pamAssassin

    2&} 8hat does @.etc.mail.A directory contains?

    The 0etc0mail0 director& contain all the (endmail confi"uration files,

    #ithsendmail.cf and submit.cf bein" the main confi"uration files.

    2)} 7plain the use o .etc.mail.relayEdomains ile?

    The 0etc0mail0rela&-domains file is used to determine domains from

    #hich it #ill rela& mail. The contents of the rela&-domains file should

    be limited to those domains that can be trusted not to ori"inate spam.

    2+} 8hat is the name o spamassassin coni$uration ile?

    0etc0mail0spamassassin0local.cf

  • 7/25/2019 Linux Interview Questions & Answers

    54/87

    29} 5ow to check mail ueue o sendmail?

    0usr0lib0sendmail -bp

    or

    mail*3'} 5ow to use m" macro processor to $enerate a

    new sendmail(c?

    mJ 0etc0mail0sendmail.mc 3 0etc0mail0sendmail.cf

    C4I< -7:B7:

    1} 8hich !mail process use @concurrecylocalA control ile?

    *mail-send

    2} 8hat is maildir?

    Eaildir is a mailbo! format created b& an :ernstein to address the

    shortcomin"s of the mbo! format. A maildir mailbo! is a director&containin" three subdirectories, ne#, cur, and tmp. ach messa"e in a

    maildir mailbo! is in a separate file in one of the subdirectories,

    dependin" upon its status$ ne# is for unread messa"es, cur is for

    messa"es that have been seen, and tmp is for messa"es in the process

    of bein" delivered.

    3} 8hat is procmail?

    procmail is a popular Eessa"e eliver& A"ent =EA. The function of

    an EA is to accept a messa"e from the ETA for a specific user or

    mailbo!, and deliver the messa"e accordin" to the users desires.

    procmail can be used to RfilterS messa"es b& the content of various

    header fields or the bod& of the messa"e.

  • 7/25/2019 Linux Interview Questions & Answers

    55/87

    "} 8hich =roups and Users are re!uired to start C4I rootP !it bin0m&s*ladmin

    reload

    The ne!t time &ou lo" in, &ou #ill use &our ne# pass#ord

    9} 8here is the data stored in a Cy-< database?

    E&(/ uses files to store data. These files are under the

    data0databasename director&, #here databasename is the name of the

  • 7/25/2019 Linux Interview Questions & Answers

    81/87

    database. There are three file t&pes$ .I(E, .4%E, and .I(. The .4%E

    file contain the table schema. The .I( is the file that actuall& holds

    the data. The .I(E file is the file that provides *uic5 access bet#een

    the t#o of them.

    1'} 7plain the terms @mys!limportA/ @mys!ldumpA/

    @mys!ladminA and @mys!lcheckA?

    m&s*limport for importin" data files, m&s*ldump for ma5in" bac5ups,

    m&s*ladmin for server administration, and m&s*lchec5 for chec5in"

    the inte"rit& of the database files.

    11} 5ow you will determine the options which are used bymys!l?

    Fm&s*l +help

    12} 5ow you will determine the #ersion o Cy-

  • 7/25/2019 Linux Interview Questions & Answers

    82/87

    9ou as5ed for help about help cate"or&$ RContentsS

    4or more information, t&pe help Qitem3, #here Qitem3 is one of

    the follo#in" cate"ories$

    AdministrationColumn T&pes

    ata efinition

    ata Eanipulation

    4unctions

    eo"raphic features

    Transactions

    1&} 8hat is Cy-< uery >rowser?

    The E&(/ uer& :ro#ser is a "raphical tool desi"ned to provide a

    user friendl& environment in #hich to construct and e!ecute (/

    statements.

    1)} 7plain @4UGLIN6:7C7NA attribute?

    AUTD[INC%ENT attribute ma& be added to an inte"er column

    definition to create a column for #hich E&(/ automaticall&"enerates a ne# se*uence number each time &ou create a ne# ro#.

    There ma& be onl& one AUTD[INC%ENT column per table, the

    column must be inde!ed, and the column must be defined as NDT

    NU//.

    1+} 8hat this command @mys!ladmin status #ariablesA will

    do?

    This command #ill displa& a brief status messa"e, follo#ed b& the list

    of server s&stem variables.

    19}7plain @6576F 4>

  • 7/25/2019 Linux Interview Questions & Answers

    83/87

    structure and contents. It #or5s for E&I(AE and Inno: tables. 4or

    E&I(AE tables, it also updates the inde! statistics. If the table is a

    vie#, CC@ TA:/ verifies the vie# definition.

    2'} 7plain @:704I: 4>

  • 7/25/2019 Linux Interview Questions & Answers

    84/87

    2%}8hat is the use o @IN,G:C4IGNL-657C4

    ;atabaseA?

    The IN4D%EATIDN[(CEA database provides access to database

    metadata.IN4D%EATIDN[(CEA is a Rvirtual databaseS in the

    sense that it is not stored anhere on dis5. :ut li5e an& other

    database, it contains tables, and its tables contain ro#s and columns

    that can be accessed b& means of (/CT statements.

    2&} 8hat is @binary backupA?

    A binar& bac5up is a cop& of the files in #hich database contents are

    stored. Cop&in" these files preserves the databases in e!actl& the sameformat in #hich E&(/ itself stores them on dis5. %estoration

    involves cop&in" the files bac5 to their ori"inal locations. Techni*ues

    for ma5in" binar& bac5ups include file cop& commands.

    2)} 8hat is @tet backupA?

    A te!t bac5up is a dump of database contents into te!t files.

    %estoration involves loadin" the file contents bac5 into databases b&

    processin" them throu"h the server. Techni*ues for ma5in" te!tbac5ups include the (/CT INTD DUT4I/ (/ statement,

    m&s*ldump, and E&(/ Administrator.

    2+} 5ow you will $rant the -7

  • 7/25/2019 Linux Interview Questions & Answers

    85/87

    3'} 7plain the command @-5G8 =:4N- ,G:

    rootPlocalhostVA

    It #ill sho# the account has "lobal, database-level, and table-level

    privile"es.

    GC64 400 -7:B7:

    1} I stored a cookie on the browserV why cant I see it?

    4irst, chec5 to ma5e sure &ou spelled the coo5ie name correctl&. Ne!t,

    ma5e sure the bro#ser has coo5ies enabled. Also, if &ou specified a

    root path for the coo5ie, ma5e sure that the ( or servlet readin" the

    coo5ie is in that path. %emember, too, that if &ou dont "ive the coo5ie

    a specific e!piration time, the coo5ie #ill vanish #hen the user shuts

    the bro#ser do#n.

    2}8hy is a new obQect created whene#er I call

    QspJuse>ean?9ou probabl& for"ot to specif& a scope for the bean.

    %emember, the default scope for a bean is pa"e, and all beans #ith

    pa"e scope disappear #hen the pa"e finishes e!ecutin".

    3} 8hen do I use ( and when do I use W?

    Althou"h &ou can use these operators interchan"eabl&, it is a "ood idea

    to use an operator that indicates the 5ind of data bein" accessed. 4or

    e!ample, if &ou are accessin" a bean propert&, use the . operator. If &ou

    are accessin" a map value or an arra& inde!, use the ;B operator. There

    are plent& of times #hen &ou brea5 this rule, especiall& in cases #here

    &ou #ant a map to loo5 li5e it is a bean, &ou #ant thin"s to ma5e sense

    to the ne!t person #ho reads &our code. 9ou ma& 5no# the t&pes of all

    the variables, but the ne!t person ma& not.

    "}5ow do I coni$ure omcat to work with II- and N

  • 7/25/2019 Linux Interview Questions & Answers

    86/87

    4ollo# the standard instructions for #hen the isapi[redirector.dll

    Confi"ure II( to use Rinte"rated #indo#s securit&S

    In server.!ml, ma5e sure &ou disable tomcat authentication$

    QConnector port>S227j enable/oo5ups>SfalseS redirectort>SJJ1jprotocol>SA0SfalseS 03

    %}7plain the concepts o omcat -er#let 6ontainer(

    + Tomcat (ervlet Container is a servlet container. The servlets runs in

    servlet container. + The implementation of ava (ervlet and the ava

    (erver a"es is performed b& this container. + rovides TT #eb

    server environment in order to run ava code. + %educes "arba"ecollection + Native 'indo#s and Uni! #rappers for platform

    inte"ration

    &} 8hy do I $et a 6lassNot,ound7ception when I try to use

    the -hoppin$6art class?

    The ( en"ine probabl& cant see the class in its classpath. Tomcat

    uses the s&stem classpath, so if (hoppin"Cart.class is visible

    some#here in the s&stem classpath, the& should see it.

    )}8hat is omcat?

    Tomcat is a ava (ervlet container and #eb server from a5artha

    proOect of Apache soft#are foundation. A #eb server sends #eb pa"es

    as response to the re*uests sent b& the bro#ser client. In addition to

    the static #eb pa"es, d&namic #eb pa"es are also sent to the #eb

    bro#sers b& the #eb server. Tomcat is sophisticated in this respect, as

    it provides both (ervlet and ( technolo"ies. Tomcat provides a "ood

    choice as a #eb server for man& #eb applications and also a free

    (ervlet and ( en"ine. Tomcat can be used standalone as #ell as

    behind other #eb servers such as Apache httpd.

  • 7/25/2019 Linux Interview Questions & Answers

    87/87

    +} 8hat is Masper?

    asper is a pro"ram to read the .class files in binar& format. This

    pro"ram can "enerate A(CII files , #hich can be used alon" #ith

    asmin Assembler. asper is intended for "eneratin" input into a class

    file bro#ser #hich can produce the hierarch& of inheritance and

    composition maps from the .class files.

    9}6an I set Ma#a system properties dierently or each

    webapp?

    No. If &ou can edit Tomcats startup scripts, &ou can add R-S options

    to ava. :ut there is no #a& to add such properties in #eb.!ml or the

    #ebapps conte!t.

    MJ

    M?