You are on page 1of 85

Apache Question & Answer for Interview L2/L3

QUESTION NO: 1

J an wants her Apache server to be able to handle multiple requests over a single TCP connection. Which
of the following would allow her to do this?

A. Expirations
B. BrowserMatch
C. KeepAlive
D. PersistentConnect
E. ChunkEncode

Answer: C

QUESTION NO: 2

Which of the following HTTP headers will direct a browser to www.site.com after waiting five seconds?

A. Rerwrite 5; URL =http://www.site.com/
B. Location 5; URL =http://www.site.com/
C. Refresh 5; URL =http://www.site.com/
D. Reload http://www.site.com/ -t 5
E. Direct -t 5 http://www.site.com/

Answer: C

QUESTION NO: 3

Cookies can be used by Apache to create a click stream log of user activity. However, for the cookies to
work, Apache must be compiled with the _______ module, then the ______ directive must be

added to the httpd.conf file.

A. mod_usertrack; Cookie Tracking on
B. mod_cookies; Cookies on}
C. mod_cookietracking; cookie Tracking on
D. mod_cookielog; Cookielogging on
E. mod_userlog, cookielogging on

Answer: A

QUESTION NO: 4

Which of the following are TRUE regarding contains in httpd.com? (Choose two.)

A. Containers consist of a Paired set of delimiters.
B. If two containers contradict, the first is applied.
C. Containers may only be applied globally.
D. Containers allow individual virtual hosts to have their own settings.

Answer: A,D

QUESTION NO: 5

Which of the following best explains why Apache Web servers are able to handles multiple requests?

A. In addition to port 80, Apache opens ports 8080, 8000, and others to handle the additional requests.
B. Apache is able to spawn child processes that handle requests before they die.
C. Apache uses therenice service to load balance between different system daemons.
D. Upon reaching a set number of requests, Apache uses a raw socket to adjust a system's bandwidth to
handle the additional requests.

Answer: B

QUESTION NO: 6

Consider the file "test.html". Which of the following best describes what code does?

<html>
<from>
<INPUT TYPE=" button" VALUE="set cookie"
onClick ="document. Cookie =`first_name=Fred`;">
<INPUT TYPE ="button" VALUE ="display cookie"
onClick ="alert (document.cokkie);">
</from>
</html>


A. When the user clicks on "set cookie," it prompts the user for value. Once the value is entered, it can be
displayed using the "display cookie" button.
B. When the user clicks on "set cookie," thefirst_name cookie is set to "Fred." The first_name cookie can
be displayed by clicking the "display cookie" button.
C. When the user first loads "test.html,"first_name is automatically set to "Fred." The value of first_name
can be seen with the "display cookie" button. The first_name cookie can be reset to " 3
empty ("") by clicking the "set cookie" button.
D. When the user clicks on the "set cookie" button, a new HTML page is loaded that displays the word
"Fred". When the user clicks on the "display cookie" button, it alerts the user that it has been

deleted.

Answer: B

QUESTION NO: 7

Which of the following can be used send to used to send a cookie to the http client? (Choose two.)

A. XMLScript
B. Static HTM
C. J ava Script
D. CGI scripts
E. GIFScript

Answer: C,D

QUESTION NO: 8

Ralf, a user, wishes to upgrade his existing version of Apache by including mod_ssl as a loadable module.
Assuming that the shared object for mod_ssl is libssl. So, that mod_ssl is located in

"/prefix/modules/," which of the following must be present in his httpd, conf file?

A. LoadModule mod_ssl modules/libssl.so
B. Addmodule mod_ssl modules/libssl.so
C. LoadModule /prefix/modules/libssl.so mod_ssl
D. AddModule /prefix/modules/libssl.so mod_ssl

Answer: A

QUESTION NO: 9

Liz has completed an Apache installation on her computer. She did not encounter any errors. Which of
the following can she use to see Apache's default index? (Choose two.)

A. http://localserver
B. http://localhost
C. http://index
D. http://192.268.0.0
E. http://127.0.0.1

Answer: B,E

QUESTION NO: 10

One security exploit with Apache is to include a command in a script that lets the scripts execute a
command found in one of its variables. For example, a script might contain the who command and

display a list users logged into the server. Which of the following, if included in a CGI script, will run a
command with the appropriate permissions?

A. declare
B. fork
C. export
D. eval
E. eacho

Answer: D

QUESTION NO: 11

Which of the following represents a security concern of programming CGI scripts using the C
programming language?

A. C programs must be run withsetuid root.
B. If the program receives more data than the amount of memory it has allocated, a buffer overflow can
cause the program to exit to a shell on the server.
C. Many early C compile lack the ability to dynamically alter file permissions, which results in many C
program running with root permissions.
D. CGI script written in C compile at runtime on the client system, which makes the client vulnerable.
E. If the server and client do not have identical compilerversions, the lesser compiler is used, which may
have known exploits.

Answer: B

QUESTION NO: 12

Which of the following best explains the function of the KeepAlive directive in Apache 1.1?

A. It defines the length of time Apache will wait before spawning additional processes.
B. It constantly checks on the Apache service and reports viasyslogd if there is a server problem.
C. It makes a backup by spawning clones ofitself in case the server goes down.
D. It defined how long a server process can keep a connection before shutting down.
E. It tells Apache how long to wait before going into the zombie process state.

Answer: D

QUESTION NO: 13

Which of the following scenarios most accurately describes the Apache initialization sequence?

A. Apache spawns one child process each second untilMaxSpareServer is satisfied or MaxClients is
reached.
B. Apache spawns one child, then two, then four, and up to 32 processes per seconds untilMaxClients is
reached or Minspare Servers is satisfied.
C. Apache spawns one process then continues to double the number of processes spawned each second
indefinitely untilMaxClients is reached or MinSpareServers is satisfied.
D. Apache spawns the needed number of child processes dependent on the incoming requests
untilMaxClients is reached or MinSpareServer is satisfied. For example, if three requests come in,
Apache

would spawn three processes, and soon.

Answer: B

QUESTION NO: 14

How does Apache enable CGI scripts? (Choose two.)

A. It links source pages to the appropriate client compiler.
B. It implementssuid and makes the script excitable.
C. It defines content types based on the extension.
D. It references directories that contain the scripts.

Answer: C,D

QUESTION NO: 15

J ake has the text below in his httpd conf file. He does NOT have mod_mime_magic compiled as part of
the Apache server configuration. Which of the following are TRUE concerning this information?

(Choose two.)

LoadModule vhost_alias_module modules/mod_vhost _alias.so
#LoadModule env_module modules/mod_env.so
#LoadModule agent_log_module modules/mod_log_agent.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule mime_module modules/mod_mime_magic.s
<IFModeule mod_mime_magic.c>
MIOMEMagicFile share/magic
</ifModule>

A. The MIMEMagicFile directive will be processed.
B. The MIMEMagicFile directive will NOT be processed.
C. The server will NOT be able to use hints in share/magic to determine file types.
D. The server will be able to use hints in share/magic to determine file types.

Answer: B,C

QUESTION NO: 16

An administrator needs to set the permissions an Apache Web server to maximize security, while still
allowing for full functionality. Which of the following permissions are most appropriate for

Apache configuration files and Apache executables, respectively?

A. 755, 000
B. 755, 111
C. 511, 755
D. 777, 555
E. 755, 511

Answer: E

QUESTION NO: 17

The block of code below is found in the http conf file. Under what conditions would this block of code
execute?

<If Module !PHP/4.0>
...
</If Module>

A. If PHP/4.0 is NOT compiled or loaded into Apache when the block of code is called
B. If PHP/4.0 is NOT compiled or loaded in the module's shared library when the block of code is called
C. If PHP/4.0 is compiled or loaded into Apache when the block of code is called
D. If PHP/4.0 is compiled or loaded in the module's shared library when the block of code is called

Answer: A

QUESTION NO: 18

Which of the following is a requirement for IP-based virtual hosting?

A. Separate network devices, each with its own I address.
B. Separate IP addresses for each virtual host
C. Separate configuration files for each virtual host.
D. SeparateIPAlias directives in the httpd.conf file for each virtual host.

Answer: B

QUESTION NO: 19

Tom would like to group all of his CGI scripts to /lib/cgi-bin/. In order to do this, he needs to use the
ScriptAlias directive in the httpd.conf file of his Apache server. What modules need to be

compiled in order for this to work? (Choose two.)

A. mod_cgi.c or any module that supports the common gateway interface
B. mod_bin.c
C. mod_negotiation.c or any module that does protocol negotiation
D. mod_alias.c
E. mod_script.c or any module that does script parsing

Answer: A,D

QUESTION NO: 20

The system administrator has configured Apache to write its log files via the system logging daemon.
When Apache write its log files to syslog, it will run with the permissions of which user?

A. Always as root
B. Always as nobody
C. Always aswebuser
D. Always as the owner of the http process
E. Always as the owner of thesyslogd process

Answer: B

QUESTION NO: 21

If a user has already defined a log format called "common, "which of the following directives will
ALWAYS make Apache log requests to "/var/log/apache/access_log" using the " common" format?

A. TransferLog /var/log/apache/access_log format=common
B. TransferLog /var/log/apache/access_log common
C. CustomLog /var/log/apache/access_log format=common
D. CustomLog /var/log/apache/access_log common
Answer: D

QUESTION NO: 22

The system administrator wishes to make the Web server run with UID "web." Which of the following
lines should be added to httpd.conf to allow this?

A. UID web
B. ServerAdmin web
C. Owner web
D. User web
E. RunAs web

Answer: D

QUESTION NO: 23

Which one of the following http conf entries will tell the server which access directive can be overridden
by the. Htaccess file?

A. Order Allow. Deny
B. AllowOveride
C. Order Deny, Allow
D. Allow

Answer: B

QUESTION NO: 24

An administrator would like to set up Apache server with multiple IP addresses. Which httpd.conf
directives are used to change the port and the IP address on which httpd listens? (Choose two.)

A. Listen
B. Address
C. Bind
D. Active
E. BindAddress

Answer: A,B

QUESTION NO: 25

Amanda is configuring an Internet Web server with server with two virtual host. One of the host server is
a time clock, and the other is a Web mail server. Both hosts are configured to provide

service on port 8080. One host is using the IP address 192.168.1.10, and the order is using 192.168.1.20.
Which of the following will occur when Amanda tries to run both hosts on the same port

number?

A. Requests to both virtual hosts will be denied.
B. The host listed last in thehttpd.conf configuration file will receive all f the requests on that port
number.
C. The underlying IP layer willnondeteministically transfer network packets to either host.
D. Both virtual hosts will function normally.

Answer: D

QUESTION NO: 26

Which statement best describes the outcome of the following commands?

Root@example apache $ bin/htpasswd /etc/httpd/conf/users nobody
Root@example apache $ bin/apache 1restart

A. Create a new and set the password for the Web page
B. Create a new user for the http group file
C. Create a new group and password for the system
D. Create a new alias for all the http users

Answer: A

QUESTION NO: 27

A system administrator has entered the directive below into httpd.conf. Which of the following will she
have to type into the browser to get to the aliased page? Assuming the file access

permissions are set correctly.

Alias/html/usr/local/my_dir/my_html/

A. http://localhost/
B. http://localhost/htm/
C. http://localhost/usr/local/html/
D. http://localhost/my_dir/html
Answer: B

QUESTION NO: 28

J oe, a system administrator, wants to allow visitors to sign one of two default usernames and a valid e-
mail address. He decides the default names should be "janedoe" and "johndoe". In the.

htsccess file,which module should J oe edit to achieve the desired results, and what information should he
enter?

A. anon_auth_module; Anonymous johndoe and johndoe
B. access_module; Anonymous johndoe and johndoe
C. anon_auth_module; Anonymous *doe
D. access_module; Anonymous *doe

Answer: A

QUESTION NO: 29

As a security measure, the system administrator has set the policy that all system logs must be written to a
remote system. Which of the following directives should be used to make Apache log in

this fashion?

A. CustomerLog | /sbin/syslogd
B. CustomerLog remotesystem:/var/httpd/access_log
C. TransferLog remotesystem:/var/httpd/access_log
D. TransferLog | /sbin/syslogd

Answer: D

QUESTION NO: 30

The system administrator is setting up Apache to limit access to the directory "/ Linux/example/." Only
visitors from linuxsite.org should be able to access the directory. What lines need to be
added to the following entery in the .htaccess file to make this restriction possible? Select the best pair for
lines two and four.

1 <Directory "/Linux/example/">
3 Deny from All

5 </Directory>

A. Allow fromlinuxsite.org;End
B. Deny,Allow;Allow from linuxsite.org
C. OrderAllow,Deny; Allow from linuxsite.org
D. OrderDeny,Allow; Allow from linuxsite.org

Answer: D

QUESTION NO: 31

David wants to set up a virtual host that uses the IP address 192.168.2.2, but he wants the server to attain
individual settings from the main server. He uses the http.conf file below. David then
restarts httpd and receives an error. What error did he make in the configuration file?

<VirtualHost 192.168.2.2>
ServerAdmin david@davidsvirualhost.com
ServerRoot /www/docs/davidhost2
ServerName davidsvirtualhost.com
TransferLog logs/ davidsvirtualhost.com-access_log
ErrorLog log/ davidsvirtualhost.com-error_log
</VirtuaulHost>

A. The TransferLog directive is improperly formatted.
B. The ServerRoot directive is invalid the VirtualHost container.
C. The VirtualHost containor is not terminated correctly.
D. The TypesConfig directive is missing inside the VirtualHost containe.
E. The MultiViews directive is missing inside the VirtualHost container.

Answer: B

QUESTION NO: 32

Which of the following fields is NOT a part of the CommonLog Format (CLF)?

A. Requesting host
B. Byte length of the request
C. Data of request
D. Time to serve request
E. HTTP status code

Answer: D

QUESTION NO: 33

J erry has a directory dedicated to J PEG image but does not have the .jpg extension on each file. How can
he get the server to inform the client of the content type of the files in the directory?

A. Within a Directory container, use theDefaultType directive to specify the file type.
B. Within a Directory container, use theAddType directive to specify the file type.
C. Within a Directory container, use theAddEncoding directive to specify the file type.
D. Within a Directory container, use theTypeConfig directive to specify the file type.

Answer: A

QUESTION NO: 34

Using a name-based virtual host, how does a client make a request to the desired host?

A. The client listens for a particular IP address that is in thehttpd.conf file.
B. The client requestare command to the server's /etc/hosts file.
C. The client browser provides the host header, the host header, which the server matches against the list
of virtual hosts.
D. The client browser provides a virtual hostsctipt that includes the desired port number.

Answer: C

QUESTION NO: 35

Tom has entered the information below in his httpd.comf file. He has no .htaccess file that override these
directives. Which of the following is TRUE concerning this files?

ExpiresActive on
Anywhere, .htaccess when Allow Override indexes
ExpiresByType image/gif A1000
Anywhere, .htaccess when Allow Override indexes

A. A GIF image on the server will be active for 1000 seconds after its last modification time.
B. If the file size a GIF image is over 1000Kb,then the GIF image will expire in the server's cache.
C. After the client accesses a GIF image on the server, it will NOT expire in the client's cache for 1000
seconds.
D. The server will hold no more than 1000 GIF image in its cache.

Answer: C

QUESTION NO: 36

Assume the following block of code is placed in the httpd.conf file. What task does it perform?

RewriteCond %{TIME_DAY} !Monday {OR}
RewriteCond %{TIME_HOUR} 10
RewriteCond ^index\.html /index\.html
RewriteCond %{TIME_DAY} Monday
RewriteCond ^index\.html /index\.mon\.html

A. It rewrites the URL http://someserver/index.html to http://somerver/index.mon.html if the day is NOT
Monday and the hour is NOT 10.
B. It rewrites the URL http://someserver/index.html to http://somerver/index.mon.html if the day is
Monday and the hour is 10.
C. It rewrites the URL http://someserver/index.html to http://somerver/index.mon.html if the day is NOT
Monday and the hour is 10.
D. It rewrites the URL http://someserver/index.html to http://somerver/index.mon.html if the day is
Monday and the hour is NOT 10.

Answer: C

QUESTION NO: 37

Which of the following MUST Apache 1.1 and higher have in order to run?

A. httpd.conf
B. httpd.conf and srm.conf
C. httpd.conf and access.conf
D. httpd.conf access.conf, srm.conf

Answer: A

QUESTION NO: 38

Paul has placed all images to offered by an Apache Web server in a single directory. The images are to be
handled as GIF images, but he does not wants to individually label each of the images with

the ".gif" extension. Which of the following methods could Paul use to efficiently associate all files in the
/images directory (and only the /images directory) with the ".gif" .extension?

A. If Paul crates an .htaccess file in /images and uses the Force Type directive in the file, all files
classified as images can be given the ".gif" association despite their current association.
B. If Paul crates an .htaccess file in /images and uses the Force Type directive in the file, individual files
can be processed and associated with any extension defined in the Add Type filed
located in httpd.conf.
C. Paul must use theRemoveHandler and Addhandler directives to remove current extensions then add
new extensions. Both directives must be used in the global container of httpd.conf.
D. Paul must use theRemoveHandler and SetHandler directives to remove current extensions then add
new extensions. The RemoveHandler directive must be placed in an. Htaccess file in
/images and the SetHandler directive must be defined in httpd.conf.

Answer: A

QUESTION NO: 39

Which of the following is the main problem with using.htaccess to override directives in httpd.conf?

A. .htaccess must have a per-loaded PAM module that requires extra configuraton.
B. .htaccess is insecure because it requires root permission to access subirectories.
C. .htaccess delays page access by recursively searching subdirectories.
D. .htaccess does not search every directory, possibly leaving subdirectories open.

Answer: C

QUESTION NO: 40

The Web document root directory can be changed by which line in httpd.conf?

A. Root
B. RootDir
C. DocumentRoot
D. WebRoot
E. BaseDir

Answer: C

QUESTION NO: 41

What is the function of the XbitHack directive in the httpd.conf file?

A. To active the X interface for Apache from a remote location
B. To prevent serving requests for executable files
C. To authenticate the requesting client based on user permissions
D. To parse Web files for includes based on their permissions

Answer: D

QUESTION NO: 42

Bad has placed a limit on the maximum requests per child process on his Apache server. To do this, he
added the MaxRequestsPerChild directive to httpd.comnf and gave it a value of 800. Which of the

following are TRUE concerning this situation? (Choose two.)

A. It limits the amount of memory that processes can consume in the event of accidental memory leakage.
B. Limiting the number of child processes increases processing done by each child; this increases system
load.
C. By giving process a finite lifetime, the number of processes will be reduced when requests decrease;
this frees up system resources.
D. Limiting the number of child processes increases mean network packet length; this allows more data to
be transferred at once.

Answer: A,B

QUESTION NO: 43

What is the IANA-recommended value for the Port directive?

A. 0
B. 80
C. 255
D. 8080

Answer: B

QUESTION NO: 44

Examine the following block of code. What should be added on line 3 so that the following events occur.
If the value of "test" is equal to 100, the Web page will print, "you are our on hundredth

customer," and if the value of "test" is not equal to 100, the Web page will print, "Have a nice day"

1 <!--#if expr="${test} !=${100]"
2 Have a nice day
4 you are our one hundredth customer
5 <!--#else -- >
6 Have a nice day
7 <! -- #endif -- >

A. <!-- #elseif expr="${test} =${100}" -- >
B. <!-- #elseif expr="${test} !=${100}" -- >
C. <!-- elif expr="${test} !=${100}" -- >
D. <!-- #elif expr="${test} =${100}" -- >

Answer: D

QUESTION NO: 45

A Web site has a standard header that should be included on all Web pages. Which of the following lines
would make the server include a eparate file, clled "header.html, " instead of write
the header code for every page on the site?
Assume that "header.html" is in same directory as all other HTML files, which is "/www/htdocs."

A. <!--#include "/www/htdocs/header.html"-- >
B. <!--#include "/www/htdocs/header.html"-- >
C. <!--#nclude file="/www/htdocs/header.html"-- >
D. <!--#virtual "/www/htdocs/header.html"-- >
E. <!--#file="/www/htdocs/header.html"-- >

Answer: B

QUESTION NO: 46

To crate dynamic HTML content, which of the following MUST be included with each CGI script?

A. each $cgi
B. #/bin/bash
C. #nclude cgi
D. #/bin/perl
E. each Content-type

Answer: E

QUESTION NO: 47

Suppose that a user wishes to dynamically include the contents of the file "message.txt" within a Web
page. Which of the following lines within the HTML code will allow this to be done?

A. <!--#exec "cat message.txt" -- >
B. <!--#exec cmd "cat message.txt" -- >
C. <!--#exec cmd cat message.txt -- >
D. <!-- exec cmd "cat message.txt" -- >
E. <!-- cat message.txt" -- >

Answer: B

QUESTION NO: 48

Adam has decided to start maintaining status information on current connections by setting the
ConnectionStatus directive to "on." Which of the following modules MUST be installed for this

directive to work?

A. mod_status
B. mod_info
C. mod_logging
D. mod_connect
E. mod_reports

Answer: A

QUESTION NO: 49

In order to make the Web server parver parse file with extension ".shtml" for server side includes, which
of the following should be added to httpd.conf?

A. AddHandler server-persed .shtml
B. AddHandler Handler .shtml
C. NewHandler server-parsed .shtml
D. NewHandler .shtml

Answer: A

QUESTION NO: 50

J ohn is running multiple virtual server from a single Apache Web server daemon. He has separate log
files each virtual server. Some of the error logs start reporting the error "unable to fork."

J ohn's system supports the setrlimit () call. Which of the following can john do to fix this error? (Choose
two.)

A. Send each log file to the same partition and compress the partition periodically.
B. Compilemod_fork.c into the Apache source or dynamically load the mod_fork module in httpd.conf.
C. Consolidate all log files into one file.
D. In the Apache startup script, increase the number of available file descriptors with theulimit utility.
E. Edit thehttpd.conf file to include "forking=yes" in the globals section.

Answer: A,B

QUESTION NO: 51

Natalie, the Webmaster for a small company, wishes to log Web server access using a custom log file
format. In order to do this, she decides to use the CustomLog directive. However, she neglected

to define the structure of the log entries. Which of the following directives did Natalie fail to place in
httpd.conf?

A. LogStructure
B. TransferLog
C. CommonLog
D. LogFormat

Answer: D

QUESTION NO: 52

Given the following exerpt of code from httpd.conf, what function will be performed?

LogFormat"%h %1 %u %t \"%r\" %>s %b \"%{Referer} i\" \"%{User-Agent } i \""\ combined
LogFormat"%h %1 %u %t \"r\" %>a %b" common
LogFormat "%{Referer}i ->%U" referer
LogFormat "%{User-agent}i" agent
TransferLog /var/log/httpd/access_log

A. The log file /var/log/httpd will be written with the format "agent".
B. The log file /var/log/httpd will be written with the format "combine".
C. The log file /var/log/httpd will be written in common log format.
D. The log file /var/log/httpd will be written, but will only log the IP address.

Answer: A

QUESTION NO: 53

An administrator needs to perform host name lookups on users accessing HTML and SWF files, but no
other files. The administrator has added the following lines to the httpd.conf file but is not
getting the desired result. What is the result of the lines added by the administrator?

<Files ^^"\. (html | svf) $">
HostnameLookups on
</Files>

A. The server performs lookups and all users accessing files other than HTML or SWF and ignores users
accessing HTML or SWF files.
B. The server performs lookups for all users accessing all files.
C. The serverperform lookups for some users on the HTML and SWF files.
D. The serverperform lookups on users accessing HTML files, but not on users accessing SWF files.

Answer: D

QUESTION NO: 54

When installing Apache from source, the system administrator adds the line below to the
"apacke_1.3.19/src/Configure" file. What does this accomplish?

AddModulemodules/standard/mod_so.o

A. mod_so.o will be loaded into the Apache binary after Apache has been restarted.
B. mod_so.0 will be combined with the Apache binary at run time.
C. mod_so.o will be added, provided it is already built into the binary.
D. mod_so.o will become part of the Apache binary at compile time.

Answer: D

QUESTION NO: 55

If the Web server and the browser use a persistent connection, then multiple requests can occur over the
same _________ connection.

A. IP
B. ftpd
C. CGI
D. TCP

Answer: D

QUESTION NO: 56

Which of the following are TRUE concerning directives and Apache? (Choose two)

A. Directives are commands issued throughapachetl.
B. Directives are used to control Apache's runtime configuration.
C. Directives can be used to alter Apache's configuration during runtime.
D. Directives can be used in configuration files other thanhttpd.conf.

Answer: B,D

QUESTION NO: 57

Which of the following is TRUE concerning chunked encoding?

A. It allows the server to grab small bits of dynamically produced data (chunks), determine the content,
and sent it to the client.
B. It helps identify a client by dropping chunks of information onto the client's computer and then reading
it from the computer later.
C. It divides RAM into chunks so that Apache can better utilize itsRequestsHeader info.
D. It forces a TCP connection into two chunks-one for the client and one for the server.

Answer: A

QUESTION NO: 58

When using persistent connections with HTTP1.1, a server must know the Content-Length of the
response it sends back to a client. If a Web page is dynamically created, there is no way for the
server to know the exact size of the content. Which of the following helps to solve this problem?

A. Parsing header protocol
B. Cookies
C. Chunked encoding
D. UDP packet encryption

Answer: C

QUESTION NO: 59

Maynard has recently been places in charge of a large Apache server that may be a target for Denial of
Service (DOS) attacks. To increase security, Maynard has decides to modify httpd.conf
and strengthen the server's resistance to attacks. Of the following httpd.conf directives, which can be used
as a protection against DOS attacks? (Choose two)

A. LimitRequestFields
B. LimitRequestFieldSize
C. AuthTypeMax
D. AuthBufferLimit
E. AuthOverflow

Answer: A,B

QUESTION NO: 60

The text below is found in your Apache server's error_log file. Which of the following could have caused
this error?

/var/run/httpd.pid overwritten - Unclean shutdown of previous Apache run?

A. The Apache server as shut down by an unauthorized user.
B. The graceful shutdown of Apache was overwritten byinetd.
C. Apache was terminated by an unexpected system failure.
D. Another instance ofhttpd was started, which caused the original httpd to shut down.

Answer: C

QUESTION NO: 61

Which of the following can increase Web sever performance? (Choose three)

A. Move all swap space to the same partition as the Web server data.
B. Turn off logging.
C. Place Apache logs on the fastest drive.
D. Add additional RAM to the system.
E. Place Apache logs on the slower drive and the Web data on the faster drive.

Answer: A,B,C

QUESTION NO: 62

Which of the following statements concerning Apache and Secure Socket Layer (SSL) is TRUE?

A. Apache and SSL can only be used if the proper security certificate has been purchased.
B. Themod_ssl module gives SSL functionality to Apache.
C. Apache +SSLis a commercial version of Apache distributed as closed source.
D. Apache +SSLprovides maximum 256 bit encryption.
E. Themod_https module is equivalent to the mod_ssl module.

Answer: B

QUESTION NO: 63

Which of the following will occur if the MaxSpare Servers Apache directive is set to 15?

A. No more than 15 child processes will be left running and unused.
B. No more than 15 requests to the server will be allowed.
C. It will provide for 15 fail-over servers in a cluster.
D. It will provide 15 spare servers for each virtual host request.

Answer: A

QUESTION NO: 64

Recently LinuxCorp upgraded its Web server. In the process, several directories containing Web content
were moved. The Webmaster wishes to modify Apache so that when clients access the original

URL, they will be automatically sent to a new directory. Which module will allow Apache to perform this
task?

A. mod_url
B. mod_redirect
C. mod_link
D. mod_rewrite
E. mod:urlmanip

Answer: D

QUESTION NO: 65

J ohn has a Web server running Apache, and his Web site has information that is updated periodically.
J ohn wants to make sure clients who access his Web site are viewing the most up-todate

information. Which of the following should J ohn use to accomplish this?

A. BrowserMatch 10
B. ExpiresDefault 10
C. ReloadTime 10
D. CacheDocument 10
E. MaxKeepAlive 10

Answer: B

QUESTION NO: 66

George has taken over Web server administration for a colleague. He has located the httpd.conf file, the
document root, and the files that Apache servers, but he cannot find the error log files.

They are not in their default location. Which command can he use to find the log files?

A. grep -i errorlog httpd.conf
B. locate -uerrorlog
C. locate -i uvET httpd.conf | grep errorlog
D. find /etc -nameerrorlog

Answer: A

QUESTION NO: 67

George does not want to use the default HTML error page; he wants to customize his version of Apache
to handle problems or errors. He creates an HTML page named error.html, with his customized

error message, and saves it in the /cgi-bin/ directory. How can George get Apache to display his
customized error message when a page is not found?

A. Use theErrorDocument directive in the following manner: ErrorDocument 404 /cgibin/error.html.
B. Use theErrorLog directives in the following manner: ErrorLog 404 /cgi-bin/error.html.
C. Use theErrorDocument directives in the following manner: ErrorDocument 401 error.html.
D. Use theErrorLog directives in the following manner: ErrorLog 401 error.html.

Answer: A

QUESTION NO: 68

Which of the following are valid options for the ServerType directive? (Choose two)

A. intranet
B. internet
C. inetd
D. httpd
E. stand-alone

Answer: A,B

QUESTION NO: 69

J ohn wants to apply several directives to the following directories: /gardening, /garden_tools, /fertilizers,
and /herbs. How can J ohn configure Apache to do this without affecting any of his other
directories, considering the list of his directories below?

/woodshed_tools /fertilizers /decks
/garden_tools /herbs /boat_accessories
/gardening /charcoal_grills /misc

A. Use the <Directory>directive in the following manner:
<Directory ~[f-h]?.*>... </Directory>
B. Use the <Directory>directive in the following manner:
<Directory>~/[f-h]*>... </Directory>
C. Use the <File>directive in the following manner:
<File ~[f-h]*>... </File>
D. Use the <File>directive in the following manner:
<File>~/[f-h]?.*>... </File>

Answer: B

QUESTION NO: 70

J ulie has three files in the same directory named index.html, index.htm, and index.shtml, respectively.
She wants index.htm to be sent to the client when this directory is accessed. Which
of the following httpd.conf entries will allow her to do this? (Choose two)

A. DirectoryIndex index.htm index.html index.shtml index.cgi
B. DirectoryIndex index-html index.cgi index.shtml index.htm
C. DirectoryIndex index.html index.shtml index.cgi index.htm
D. DirectoryIndex index.htm index.cgi index.shtml index.html

Answer: A,B

QUESTION NO: 71

J ohn is creating multiple virtual Web servers with separate document root directories. J ohn's boss says to
keep duplication to a minimum by using the same executable scripts. In which section if
the httpd.conf file would J ohn have to define the path of the executable scripts in order to accomplish this
task?

A. Directory environment
B. Virtual host environment
C. Global environment
D. Default environment
E. Local environment

Answer: C

QUESTION NO: 72

Which of the following best describes the relationship between modules and directives in Apache?

A. Modules are the dynamic counterparts of directives.
B. Directives are used to direct the client to load the appropriate modules.
C. Modules contain code to carry out directives specifies inhttpd.conf.
D. Directives contain code to execute static modules.

Answer: C

QUESTION NO: 73

When the httpd.conf file is altered, Apache must re-read the file by stopping and restarting the server.
There are two methods of restarting the server when using the apachectl tool. Which command

lies will perform the restart? (Choose two)

A. apachectl reload
B. apachectl reboot
C. apachectl restart
D. apachectl HUP
E. apachectl graceful

Answer: C,E

QUESTION NO: 74

A system administrator wishes to define several separate log file formats to handle different log files
within Apache. After defining a block of format definitions, the directive below is

specifies. Which of the following definitions will be used? TransferLog/var/httpd/access_log

A. Common Log Format
B. The first specifiesLogFormat directive line
C. The last specifiedLogFormat directive line.
D. The server will report an error parsing the configuration file.

Answer: C

QUESTION NO: 75

J amie is running Apache 1.3. He wants different pages with similar content on his Web site to be served
to best accommodate each browser that views them. He alters the httpd.conf file and makes the

changes below. Which line still needs to be altered to enable the desired effect?

<Directory /usr/local/httpd/htdocs>
Options All
AllowOverride Authconfig
Order allow.deny
Allow from all

A. He needs to add "MultiViews On" to the "Options All" line.
B. He needs to change "AllowOverride Authconfig" to "AllowOverride None".
C. He needs to change "Orderallow,deny" to "Order deny,allow".
D. He needs to add "localhost" to the "Allow from all" line.

Answer: A

QUESTION NO: 76

You find a Segmentation fault error in one of your Apache error_log files. Which of the following
tools will help you determine what caused this fault?

A. segfind
B. gdb
C. apachectl
D. top

Answer: B

QUESTION NO: 77

Dharma, a system administrator, wants to allow server side includes on the Web server. Which of the
following directives would be the most secure way for her to do this?

A. Options +Includes --NOEXEC
B. Options -Include
C. Options +IncludesNOEXEC
D. Options +NOEXEC

Answer: C

QUESTION NO: 78

The following is an example of what type of CGI script?


#1/bin/bash
#Hello, World! Script
echoContent-type: text/html
echo
echo'<html>
<head><title>Hello, World!</title></head>
echo'<body bgcolor=#FFFFFFF">
<h1>Hello, World!</body></html>'

A. PHP script
B. HTMLscipt
C. Shell script
D. J avaScript
E. Perl script

Answer: C

QUESTION NO: 79

J oni, a system administrator, would like to test a Web server to see how it will withstand a load of 100
simultaneous hits. Which command would she most likely use?

A. ab -<100 http://127.0.0.1:80/htdocs
B. ab -L100 http://127.0.0.1:80/htdocs
C. ab 100 http://127.0.0.1:80/htdocs
D. ab http://127.0.0.1:80/htdocs 100
E. ab -n100 http://127.0.0.1:80/htdocs

Answer: E

QUESTION NO: 80

J ustin has entered the following lines into httpd.conf, but he is not sure what exactly these new lines will
do. Which of the following will be caused by the lines J ustin entered? (Choose two)

ExpiresActive on
ExpiresByType text/html M604800
ExpiresByType image/jpg A2592000

A. J PG images will expire after a month in the client's cache.
B. J PG images will expire after a week of non-use.
C. J PG images will expire a month from the time they were changed.
D. HTML documents will remain active for a week from the time they were changed.
E. HTML documents will remain active for a month from the time they were changed.
F. HTML documents will remain active for a week in the client's cache.

Answer: A,B

QUESTION NO: 81

Which of the following will occur if the StartServer Apache directive is set to five?

A. Five instances ofmod_quickstart.o will be started.
B. Five child processes will be started for every request.
C. Five child processes will be started when Apache starts.
D. Five virtual hosts will be started for every request.
Answer: C

QUESTION NO: 82

Which of the following is NOT an option that is supported by the Linux apachectl script?

A. start
B. restart
C. stop
D. graceful
E. kill

Answer: E

QUESTION NO: 83

An administrator wishes to install a new Apache module without recompiling Apache. He wants the
modules automatically placed in the proper locations and the appropriate directive added in the

httpd.conf file. Which of the following utilities will allow the administrator to accomplish this task?

A. apmodprobe
B. apxs
C. apachectl
D. apconfig
E. apbuild

Answer: B

QUESTION NO: 84

Using a name-based virtual host, how does a client make a request to the desired host?

A. The client listens for a particular IP address that is set in thehttpd.conf file.
B. The client requests are compared to the server's /etc/hosts file.
C. The client browser provides the host header, which the server matches against the list of virtual hosts.
D. The client browser provides a virtual script that includes the desired port number.

Answer: C

QUESTION NO: 85

Eddy is maintaining a large Apache server used for holding and transferring files via the Web. He has
accumulated many archive files with the tar.gz extension and would like to prevent them from

being shown when directories are listed. Which line could he add to either httpd.conf or .htaccess to
accomplish this?

A. IndexHide "tar.gz
B. IndexHide "-tar.gz"
C. IndexIgnore *.tar.gz
D. IndexIgnore!.tar.gz
E. IndexList no .tar.gz
F. IndexList !tar.gz off

Answer: C

QUESTION NO: 86

Which of the following modules MUST be compiled into the Apache server?

A. http_core.c
B. apache_so.c
C. charset_so.c
D. tcpip_core.c

Answer: A

QUESTION NO: 87

A system administrator has entered the directive below into httpd.conf. Which of the following will she
have to type into the browser to get the aliased page? Assume the file access permissions are
set correctly.

Alias /html/ /user/local/my_dir/my_html/

A. http://localhost/
B. http://localhost/html/
C. http://localhost/usr/local/html
D. http://localhost/my_dir/html

Answer: B

QUESTION NO: 88

Apache servers a document according to certain characteristics provided by the requesting browser.These
characteristics of the document are called the document's dimensions. What dimension is used

when Apache serves a request from a browser that has a preference for gzip compressed document?

A. type
B. encoding
C. compression
D. format

Answer: B

QUESTION NO: 89

You are the system administrator of an Apache server that houses the Web site linuxsite.org. This site
allows users with normal accounts to have home pages, and it houses several other mission
critical Web sites. A user, J oe, has a home page that requires a change in one of the Apache configuration
directives. J oe wants to allow or deny access to his home page based on a

username/password combination. Which of the following is the best way to implement this change?

A. Allow J oe to configure the appropriate .htaccess file.
B. Install themod_runtime_auth module and allow J oe to make the appropriate changes to httpd.conf.
C. Make the appropriate changes tohttpd.conf file and restart httpd.
D. Make the appropriate changes to the global .htaccess file and restart httpd.

Answer: A

QUESTION NO: 90

Which of the following represents a security concern of programming CGI scripts using the C
programming language?

A. C programs must run withsetuid root.
B. If the program receives more data then the amount of memory it has allocated, a buffer overflow can
cause the program to exit to a shell on the server.
C. Many early C compilers lack the ability to dynamically alter file permissions, which result in many C
programs running with root permissions.
D. CGI scripts written in C compile at runtime on the client system, which makes the client vulnerable.
E. If the server and client do not have identical compilerversions, the lesser compiler is used, which may
known exploits.

Answer: B

Samba Question & Answer

QUESTION NO: 1

Which of the following best describes the function of smbd?

A. It provides NetBIOS name resolution services to clients.
B. It provides LDAP services to clients.
C. It provides Active Directory services to clients.
D. It provides file sharing and print services to clients.

Answer: D

QUESTION NO: 2

You have a Linux machine running Samba with the configuration below. Your machine's IP address is 192.168.1.20, and
it is on a LAN with other Linux clients and Windows 9x clients. Which of the

following is this machine's primary function?

[global]
netbios name =SAMBA
security =user
local master=yes
preferred master=yes
domain master=yes
workgroup=AUTH
wins server =192.168.1.99
encrypt passwords=yes
logon script- /usr/local/samba/bin/%u.bat
domain admin group =@bigusers
os level=65
logon home =\\%L\%U\.profiles
logon path =\\%L\profile\%U

A. A domain controller
B. A WINS server
C. A Security Account Manager (SAM) host
D. A Master Samba Share Server (MSSS)

Answer: A

QUESTION NO: 3

Which of the following best describes the function of the global max xmit parameter in smb.conf?

A. It defines the maximum number of TCP ACKs the server can transmit to the clients.
B. It defines the maximum packet size that Samba exchanges with a client.
C. It defines the maximum number of packets that are stored in RAM before they are written to disk.
D. It defines the maximum NetBIOS queries a server can accept.

Answer: B

QUESTION NO: 4

Diego, an administrator, has set up a Samba server to provide Windows users access to their Linux home directories. In
the [homes] share, which of the following should he use to define the path of

the home directories as "/home/samba/<user name>"?

A. path =/home/samba/%n
B. path =/home/samba/%u
C. path =/home/samba/%l
D. path =/home/samba/%h

Answer: B

QUESTION NO: 5

What is the function of the smbclient command?

A. It allows a Windows share to be mounted from a computer running Linux.
B. It provides access to shared resources on a Windows computer.
C. It provides access to Linux shares from a Windows computer.
D. It provides access to a Samba-enabled computer from a Windows machine.

Answer: B

QUESTION NO: 6

Ron, a Windows user on his local network, asked his co-worker Ned to save a fle on the file server (a Linux machine).
Ned saves the file in the specified directory and sends Ron a message to tell

him it is there. Ron looks in the file server share, but he cannot find the file until he checks it 20 minutes later. Why is Ron
having this problem?

A. The "change notify timeout" parameter of the smb.conf file is set to 1200.
B. The "browseable" parameter of the smb.conf file is set to 1200.
C. The "browse list" parameter of thesmb.conf file is set to 1200.
D. The "deadtime" parameter of the smb.conf file is set to 1200.

Answer: A

QUESTION NO: 7

In order for encrypted passwords to be available to Samba, which of the following lines should appear in smb.conf?
(Choose two.)

A. encryptpasswd =yes
B. encrypt =/etc/shadow
C. smb passwd file =/usr/local/etc/smbpasswd
D. encryptpass =/usr/local/etc/smbpasswd
E. encrypt passwords =yes

Answer: C,E

QUESTION NO: 8

Molly, an administrator, would like to poll the network to ensure that Samba is working properly. Which of the following
commands would allow her to do this?

A. nmblookup --all
B. testparm --poll "*"
C. smbclient -L "*"
D. nmblookup -d 2 "*"

Answer: D

QUESTION NO: 9

Which of the following best describes the number of smbd processes that should be running at one time on a properly
configured Samba server?

A. One for each client connected to Samba
B. Only one
C. At least one, and an additional one for each printer being used by Samba
D. At least one, and an additional process for each client connected to Samba

Answer: D

QUESTION NO: 10

The Samba server (luke.linuxsite.org) using the smb.conf file below is experiencing problems. What is most likely wrong
with the smb.conf file?

[global]
netbios name =luke
workgroup =network1
security =share
load printers =yes
log file =/home/admin/
max log size =10000
wins support =yes
wins server =samba.linuxsite.org
bind interfaces only =yes

A. The wins support parameter is set to "yes" , and the wins server parameter is set.
B. The max log size is set too high.
C. The log file path is not in the same directory as the Samba executables.
D. The log file is defined before the wins server.
E. The wins support parameter and the bind interfaceparameter are both set to "yes".

Answer: A

QUESTION NO: 11

Which of the following commands will be executed first by Samba?

A. preexec =rm -r /home/samba/tmp/*
B. root execute =rmdir -R /home/temp
C. rootpostexec =mkisofs -log-file %H/log-%d.txt
D. rootpreexec =mkdir /home/temp
E. prescript =/home/samba/scripts

Answer: D

QUESTION NO: 12

Maynard is optimizing his Samba services to provide ease of use as well as security. He has added the line below to
/etc/auto.misc. Which of the following best describes the purpose of this

addition? docs -fstype=smb, username=bob, password=2ghtex9s ://servermain/docs

A. This prevents users listed ("bob") from accessing the "docs" share.
B. This line is required for Samba to export the "docs" share.
C. This allows automatic logins and logouts to the "docs" share.
D. This prevents users other than "bob" from accessing the "docs" share.
E. This allows the "docs" share to beautomounted by "bob" on login.

Answer: E

QUESTION NO: 13

Instead of linking all Samba commands to paths already defined in his environment, Fred wants to include
/usr/local/samba/bin in his path. Which of the following will allow Fred to do this?

A. Edit the /etc/samba/smb.conf file to change Fred's environment to look in /usr/local/samba/bin for commands.
B. Edit thesmb.conf file to include the parameter "include=/usr/local/samba/bin".
C. Add Fred's paths to the /path directory.
D. Edit the /etc/profile file to change Fred's environment to look in /usr/local/samba/bin for commands.

Answer: D

QUESTION NO: 14

Annie is using Windows 95. In order for her to connect to the Samba server, she needs to run the regedit program and add
an entry to the Windows registry. What type of registry entry should Annie

add, and what should its value be?

A. Enter a new DWORD Value named "EnablePlainTextPassword" with a value of one.
B. Enter a new String Value named "EnablePlainTextPassword" with a value of zero.
C. Enter a new Binary Value named "EnablePlainTextPassword" with a value of one.
D. Enter a new Host Value named "EnablePlainTextPassword" with a value of zero.
Answer: A

QUESTION NO: 15

Which of the following is FALSE regarding NetBIOS?

A. NetBIOS names are limited to 16 characters.
B. NetBIOS characters are always converted to uppercase.
C. The first character of a NetBIOS name is known as a NetBIOS prefix.
D. The last character in a NetBIOS name indicates the type.

Answer: C

QUESTION NO: 16

Which of the following is a function of a WINS server?

A. Map IP addresses to IPX names
B. Map IP addresses to subnet addresses
C. Map IP addresses to domain names
D. Map IP addresses to logical addresses
E. Map IP addresses to NetBIOS names

Answer: E

QUESTION NO: 17

Which of the following Samba programs will listen for NetBIOS over IP name service requests?

A. nmbd
B. swat
C. named
D. smbd

Answer: A

QUESTION NO: 18

Which of the following best describes the function of nmbd?

A. It provides NetBIOS name resolution services to clients.
B. It provides file sharing and print services to clients.
C. It provides Active Directory services to clients.
D. It provides LDAP services to clients.

Answer: A

QUESTION NO: 19

Liz wants to grant administrative access to the users sam, bob, and erica. How should she edit the smb.conf file?

A. users =sam, bob, erica
B. root users =sam, bob, erica
C. admin users =sam, bob, erica
D. superusers =sam, bob, erica

Answer: C

QUESTION NO: 20

Which of the following methods should be used to make changes to the smbpasswd file?

A. Editing the /etc/shadow file
B. smbpasswd
C. adduser
D. useradd
E. Editing the /etc/passwd file
Answer: B

QUESTION NO: 21

Pete wants to configure Samba to be a WINS server. Which of the following must he do in the smb.conf file for Samba to
do this?

A. Make sure the wins proxy parameter is set to "wins proxy =yes" and change the wins support parameter to "wins
support =yes".
B. Make sure the wins support parameter is set to "wins support =yes" and change the wins proxy parameter to the
appropriate IP address.
C. Make sure the wins server parameter is set to the appropriate IP address and change the wins support parameter to
"wins support =yes".
D. Make sure the wins server parameter is set to "wins server =none" and change the wins support parameter to "wins
support =yes." Configure the Windows 95/98 and NT clients.

Answer: D

QUESTION NO: 22

A system administrator has Samba running on a machine that has direct access to the Internet, as well as access to the local
area network through two different network interfaces. As part of the

configuration, the administrator adds the lines below to smb.conf. Which of the following describes the function of these
two lines?

interfaces =192.168.1.0/255.255.255.0
bind interfaces only =yes

A. Samba will not accept connection requests from the 192.168.1 subnet.
B. Hosts outside the local area network will not be allowed to connect to the Samba shares.
C. Samba will only serve requests to the IP address 192.168.1.0.
D. Samba will use the IP address 192.168.1.0 when making DNS requests.

Answer: B

QUESTION NO: 23

An administrator has modified his smb.conf file with regards to the server's behavior during elections for preferred master
browser. The two modified lines listed below cause which of the following

to take place?

preferred master =true
domain master =yes

A. nmbd will not hold elections for domain master.
B. smbd will hold elections for preferred master but not for domain master.
C. smbd will bypass the election process and become preferred master.
D. nmbd will hold elections with a guarantee of winning.

Answer: D

QUESTION NO: 24

Hans wants to change his SMB password on the local system. Which of the following should he type to do this?

A. smbpasswd -U <username>
B. smbpasswd -f /etc/passwd <username>
C. smbpasswd <username>
D. smbpasswd -U -F <username>

Answer: C

QUESTION NO: 25

An administrator has recently discovered many malicious attacks on a Samba server. The attacks originate from two rogue
hosts (badhost1 and badhost2) in the NIS netgroup called "nisnet".
Which of the following smb.conf entries will allow any host from nisnet to access the Samba server except badhost1 and
badhost2?

A. hosts allow =*.nisnet hosts deny =!badhost1, !badhost2
B. hosts allow =nisnet EXCEPT badhost1, badhost2 hosts deny =ALL
C. hosts allow =@nisnet hosts deny =ALL EXCEPT badhost1, badhost2
D. hosts allow =@nisnet hosts deny =badhost1, badhost2

Answer: D

QUESTION NO: 26

Phillipe, an administrator, would like to configure Samba as a domain client and has added the following lines to
smb.conf. The domain client is not functioning properly. What is wrong with this
section of his smb.conf file?

security =domain
netbios name =bigsamba
domain name =mydomain
machine password timeout =100

A. Line 2 should be "netbios name =true"
B. Line 3 should be "workgroup =mydomain"
C. Line 1 should be "domain =security"
D. Line 4 should be "machine password timeout =true"

Answer: B

QUESTION NO: 27

An administrator needs to define how files written to the server by users are handled. He has added the following lines to
his smb.conf file in order to do this. Considering these lines, what will
be the permissions on a file that a user sets to 555?

security mask =0777
force security mode =0
directory security mask =0777
force directory security mode =0

A. 700
B. 000
C. 777
D. 555

Answer: D

QUESTION NO: 28

Palmer, an administrator working on a Linux/Windows NT network, has issued the command below. What is he doing?
rpcclient -S '\\NTmachine' -U administrator -W NTDOM

A. He is resetting the password and login on "NTmachine" to "NTDOM" and "administrator," respectively.
B. He is connecting to a Windows NT machine called "NTmachine" as administrator.
C. He is adding a Windows NT machine called "NTmachine" to Samba's list of secure systems.
D. He is defining the method by which RPCs connect to and communicate with the Samba server; in this case using a
login and password combination.

Answer: B

QUESTION NO: 29

A system administrator is preparing to take down the system for routine maintenance. The network is primarily used for
Samba services. Before upgrading to the latest Linux kernel, the administrator
wants to make sure there are no remaining connections. Which of the following programs can the administrator use to see
the open connections?

A. traceroute
B. smbd
C. smbrowser
D. ping
E. smbstatus

Answer: E

QUESTION NO: 30

The system administrator is trying to set up a smbpasswd file from the /etc/passwd file. The system is not using NIS.
Which of the following is the proper command line to produce the smbpasswd file

in the "/usr/local/samba/private/" directory?

A. mksmbpasswd.sh /usr/local/samba/private/smbpasswd
B. cat /etc/passwd | mksmbpasswd.sh >/usr/local/samba/private/smbpasswd
C. cat /etc/passwd >/usr/local/samba/private/smbpasswd
D. mksmbpasswd.sh | /etc/passwd >/usr/local/samba/private/smbpasswd

Answer: B

QUESTION NO: 31

J acques, an administrator, has changed a smbpasswd file entry to the line below. What will happen when the user "steve"
attempts to log in to the Samba server?

steve:1005:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX: \
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:
\ LCT-00000000:steve smith:/home/ssmith:/usr/bin/ksh

A. He will be prompted to enter his current password.
B. He will be denied login.
C. He will be prompted for usual login with "NO PASSWORD" for a password.
D. He will be prompted to set a new password.

Answer: D

QUESTION NO: 32

Many smb.conf parameters take list arguments such as the hide files parameter. From the following, select the "hide files"
parameter with the proper syntax that would prevent users from accessing

files with .mbx extensions and files beginning with samba.

A. hide files =.mbx, samba.
B. hide files =.mbx / samba.
C. hide files ="*.mbx","samba.*"
D. hide files =*.mbx / samba.*
E. hide files =*.mbx, samba.*

Answer: D

QUESTION NO: 33

You have two machines that run Linux on your LAN. host1 is running Samba while host2 is just a standard Linux
machine. You run the command "smbclient -L host1" from host2 and receive the error

below. Which of the following is the most probable reason for this error?

added interface ip=192.168.1.48 bcast=192.168.1.255 nmask=255.255.255.0
session request to HOST1 failed (Not listening for calling name)
session request to *SMBSERVER failed (Not listening for calling name)

A. Thesmbd program is not running.
B. Thenetbios-ssn port is not in the appropriate state.
C. The "/etc/hosts.deny" file on host1 contains the IP address for host2.
D. The "valid users" parameter in host1'ssmb.conf file does not reference the guest account.
E. The "hosts deny" field insmb.conf contains host1's IP address.

Answer: E

QUESTION NO: 34

Dora, an administrator, would like to temporarily disable a share so she can change its contents. Which of the following
should she add to smb.conf in the share's section to do this?

A. comment =off
B. fstype =no
C. available =no
D. public =no
E. browseable =false

Answer: C

QUESTION NO: 35

Pauline is the system administrator of a Local Area Network (LAN) that contains Linux and Windows clients. The LAN
uses a file server that runs on a Windows NT server. In order to have fewer

servers on the network, Pauline wants to place all Linux users' home directories on the Windows server. Can the Linux
machines be configured so that this is possible Why or why not?

A. Yes, by mounting the remote file system using NTFS instead ofsmb.
B. No, only localsmb file systems may be mounted on Linux systems.
C. Yes, an entry can be placed in /etc/fstab to mount smb file systems.
D. No,smb file systems cannot be mounted on Linux systems.

Answer: C

QUESTION NO: 36

Two daemons, smbd and nmbd, provide communication between Windows and Linux machines. Each daemon controls a
portion of the work. Which of the following statements correctly match these daemons

with the jobs they perform? (Choose two.)

A. smbd performs file and print sharing.
B. smbd performs NetBIOS lookups.
C. nmbd performs NetBIOS lookups.
D. nmbd performs file and print sharing.

Answer: A,C

QUESTION NO: 37

Which of the following does the "create mask" parameter allow Samba to do?

A. It allows authentication for MS-DOS withUnix.
B. It allows Samba to overrideUnix and MS-DOS permissions.
C. It allows authentication forUnix with MS-DOS.
D. It allows Samba to map MS-DOS modes toUnix permissions.
E. It allows Samba to mapUnix permissions to MS-DOS modes.

Answer: D

QUESTION NO: 38

A Samba server is experiencing packet loss and data corruption when multiple users access a file simultaneously. Which
of the following, if added to smb.conf, would most likely fix the problem?

A. fakeoplocks =no
B. lock files =yes
C. wins support =yes
D. file sharing =no
E. interfaces only =yes

Answer: A

QUESTION NO: 39

Which of the following does SWAT provide for administrators maintaining a Samba server?

A. An alternative to Samba
B. A simple command-line sharing monitor
C. A powerful security system
D. An easy-to-use, Web-based tool

Answer: D

QUESTION NO: 40

Isabella has recently enabled SSL support on a large Samba server and has issued the command below. What did Isabella
accomplish with this command?

ssleay ca -days 100 -infiles client1-csr >client1.pem

A. She has removed the client (client1) certificate from the system.
B. She has "signed" the client (client1) certificate and authorized it to use the server.
C. She has created a temporary file (client1.pem) that generates a public certificate for the client (client1).
D. She has generated a public key (client1.pem) for the client.

Answer: B

QUESTION NO: 41

Nicolas, an administrator, needs to create a new log file for each client computer connecting to the Samba server. In the
past, Nicolas entered each client computer name into smb.conf, but now he

is looking for a faster method to direct Samba to the correct log file for each computer. Which log path can Nicolas use so
he does not have to manually enter each individual NetBIOS name?

A. /var/logs/samba.%g
B. /var/logs/samba.%m
C. /var/logs/samba.%h
D. /var/logs/samba.%n

Answer: B

QUESTION NO: 42

Michael is experiencing major security problems with his Samba server, and he would like to make all of the shares
unbrowsable until he can resolve these problems. Which of the following parameters

should Michael change to accomplish his goal?

A. No share =yes
B. Browse list =no
C. Blocking =yes
D. Browse =no

Answer: B

QUESTION NO: 43

Which of the following are ways Samba resolves NetBIOS names? (Choose three.)

A. Reverse DNS lookups
B. LAN Manager Hosts table
C. Network broadcasts
D. Local name resolution through /etc/smbhosts
E. NetBIOS Name Server

Answer: B,C,E

QUESTION NO: 44

Bruce needs Samba to act as a Primary Domain Controller. The smbpasswd file is in "/usr/local/etc/smbpasswd." What
should Bruce do in the smb.conf file to accomplish this?

A. Add the following line to the [global] section: encrypt passwords =yesusr/local/etc/smbpasswd
B. Add the following lines to the [global] section: encrypt passwords =nosmb passwd file =/usr/local/etc/
C. Add the following lines to the [global] section: encrypt passwords =yessmb passwd file =/usr/local/etc/smbpasswd
D. Add the following lines to the [homes] section: encrypt passwords =yessmb passwd file =/usr/local/etc/smbpasswd

Answer: C

QUESTION NO: 45

Matthew recently noticed problems in his Samba service when he was running the netstat program. It appears that TCP
packets are progressing fine, but UDP packets are not. Which function of Samba

depends directly on UDP?

A. Mounting/unmounting of Samba shares
B. Translating NetBIOS names
C. Print sharing
D. File sharing

Answer: B

QUESTION NO: 46

Sharon has the share modes parameter in her smb.conf file set to "no." Given this information, which of the following is
TRUE?

A. No remote Windows clients can access her Samba shares.
B. No remote Linux clients can access her Samba shares.
C. No remote guest accounts can access her Samba shares.
D. No network clients can access her Samba shares.

Answer: A

QUESTION NO: 47

Caroline, an administrator working with a hybrid cross-subnet, wants to force Samba to send server announcements
between subnets. Which of the following should Caroline add to smb.conf to implement

this?

A. subnet announce =force
B. remote browse sync =<remote LMB IP address>
C. remote announce =<IP subnet list>
D. announce =force <IP subnet list>
E. lm announce =auto

Answer: C

QUESTION NO: 48

The system administrator needs to back up the contents of a smb share (docs) on a Windows client (winhost) onto the
Linux network server. The administrator wants to back up to a tape drive. Which

of the following commands will allow this?

A. smbtar -s winhost -x /docs -u administrator -p abc123 -t /dev/nst0
B. smbmnt /mnt/winhost -u administrator -p abc123 /dev/nst0
C. smbtar //winhost/docs -u administrator%abc123 /dev/nst0
D. smbclient //winhost -u administrator%abc123 cat docs>/dev/nst0
E. smbclient //winhost/docs -u administrator%abc123 | tar -cf /dev/nst0

Answer: A

QUESTION NO: 49

Melissa needs to reconfigure a Samba server to include an additional share. How can she do this?

A. Edit thesmb.conf file or use SWAT.
B. Edit thesmbaccess.conf file or use BigBrother.
C. Edit thesmbpasswd.conf file or use SMBAdmin.
D. Edit thesmbshare.conf file or use WebSMB.

Answer: A

QUESTION NO: 50

An administrator would like to add a Samba server to an implemented Windows NT Domain (NTDOM). Which of the
following smb.conf global entry excerpts contains the correct parameters to accomplish

this?

A. encrypt passwords =no security =share workgroup =NTDOM password server =*
B. encrypt passwords =yes security =domain workgroup =NTDOM password server =*
C. encrypt passwords =yes security =user workgroup =NTDOM password server =*
D. encrypt passwords =yes security =share workgroup =NTDOM password server =*

Q: - How are devices represented in UNIX?
All devices are represented by files called special files that are located in /dev directory.
Q: - Tell me the steps to remove the swap file?
Firstly disable the swap file by swapoff command.
Remove Swap file entry from /etc/fstab file.
Now remove the swap file by rm command.
Q: - What can we do with parted command or utility?
- View the existing partition table
- Add partitions from free space or additional hard drives
- Change the size of existing partitions
Q: - What is 'inode'?
All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the
file-size, its location, time of last access, time of last modification, permission and so on. Directories are
also represented as files and have an associated inode.
Q: - Can we resize the size of a partition?
Yes, we can resize the size of partition by parted command.
#parted /dev/sda
print
To resize the partition, use the resize command followed by the minor number for the partition, the
starting place in megabytes, and the end place in megabytes. For example:
resize 3 1024 2048
After resizing the partition, use the print command to confirm that the partition has been resized correctly,
is the correct partition type, and is the correct file system type.
Q: - What is LVM?
LVM stands for Logical Volume Manager. LVM, is a storage management solution that allows
administrators to divide hard drive space into physical volumes (PV), which can then be combined into
logical volume groups (VG), which are then divided into logical volumes (LV) on which the filesystem
and mount point are created.
Q: - What are the steps to create LVM?
- Create physical volumes by pvcreate command
#pvcreate /dev/sda2
- Add physical volume to volume group by vgcreate command
#vgcreate VLG0 /dev/sda2
- Create logical volume from volume group by lvcreate command.
#lvcreate -L 1G -n LVM1 VLG0
Now create file system on /dev/sda2 partition by mke2fs command.
#mke2fs -j /dev/VLG0/LVM1
Q: - How we will check free space on drive /dev/sda with parted command?
#parted /dev/sda
print
Q: - What are the process states in Unix?
As a process executes it changes state according to its circumstances. Unix processes have the following
states:
Running : The process is either running or it is ready to run .
Waiting : The process is waiting for an event or for a resource.
Stopped : The process has been stopped, usually by receiving a signal.
Zombie : The process is dead but have not been removed from the process table.
Q: - What command should you use to check the number of files and disk space used and each
user's defined quotas?
repquota
Q: - What is the difference between LVM and RAID?
RAID provides redundancy but LVM doesnt provide Redundancy.
Q: - What are LVM1 and LVM2?
LVM1 and LVM2 are the versions of LVM.
LVM2 uses device mapper driver contained in 2.6 kernel version.
LVM 1 was included in the 2.4 series kernels.
Q: - What is physical extent (PE)?
Each physical volume is divided chunks of data, known as physical extents; these extents have the same
size as the logical extents for the volume group.
Q: - What is logical extent (LE)?
Each logical volume is split into chunks of data, known as logical extents. The extent size is the same for
all logical volumes in the volume group.
Q: - What command is used to remove the password assigned to a group?
gpasswd -r

Q: - What is Volume group (VG)?
The Volume Group is the highest level abstraction used within the LVM. It gathers together a collection
of Logical Volumes and Physical Volumes into one administrative unit.
Q: - Explain LVM snapshot?
LVM snapshots allow the administrator to create a new block device which presents an exact copy of a
logical volume, frozen at some point in time.
Q: - What can you type at a command line to determine which shell you are using?
echo $SHELL
Q: - Write a command to find all of the files which have been accessed within the last 30 days.
find / -type f -atime -30 >filename.txt

Q: - How you will check on Your server or system device-mapper is installed or not?
Check the following file.
#cat /proc/misc
if this file contains "device-mapper" term it means device mapper is installed on your system.
Q: - How are snapshots in LVM2 different from LVM1?
In LVM2 snapshots are read/write by default, whereas in LVM1, snapshots were read only.
Q: - What is a zombie?
Zombie is a process state when the child dies before the parent process. In this case the structural
information of the process is still in the process table.

Q: - If a volume group named as VG0 already exists but i need to extend this volume group up to
4GB.Explain all steps?
Firstly create Physical volume (/dev/sda7) of size 4GB.
Now run following command.
vgextend VG0 /dev/sda7
Q: - If a volume group VG0 have 3 PV's (/dev/sda6, /dev/sda7, /dev/sda8) but i want to remove
/dev/sda7 pv from this VG0?
vgreduce VG0 /dev/sda7
Q: - What is the maximum size of a single LV?
For 2.4 based kernels, the maximum LV size is 2TB.
For 32-bit CPUs on 2.6 kernels, the maximum LV size is 16TB.
For 64-bit CPUs on 2.6 kernels, the maximum LV size is 8EB.
Q: - Which command is used to extend a logical volume?
lvextend --size +<addsize>/dev/<vgname>/<lvname>
resize2fs /dev/<vgname>/<lvname>
Q: - What daemon is responsible for tracking events on your system?
syslogd
Q: - What do you mean a File System?
File System is a method to store and organize files and directories on disk. A file system can have
different formats called file system types. These formats determine how the information is stored as files
and directories.
Q: - Tell me all steps to remove a LVM?
To remove a logical volume from a volume group, first unmount it with the umount command:
umount /dev/<vgname>/<lvname>
and then use the lvremove command:
lvremove /dev/<vgname>/<lvname>
Q: - Which command is used to create LVM Snapshot?
vcreate --size <size>-s -n <snapshotname><lvname>
The lvcreate command is used to create a new logical volume, meaning there must be
free physical extents in the logical volume group to create a snapshot. The -s option
means that the LV is a snapshot, <snapshotname>is the name of the new LV created, and
<lvname>is the name of the LV from which to create the snapshot.
Q: - What is the location of "network" file and what does this contains?
location :- /etc/sysconfig/network
This file contains following fields
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
Q: - Which deamon is required to start Network services?
network
/etc/init.d/network start
Q: - Tell me the name of directory structure hierarchy for Linux
/root
/boot
/bin
/sbin
/proc
/mnt
/usr
/var
/lib
/etc
/dev
/opt
/srv
/tmp
/media
Q: - What is the role of /etc/resolv.conf file?
In this file we sets the DNS servers (using their IP addresses) and the search domain. The values of the
DNS servers are often added when the network is activated because the data can be provided by DHCP or
a similar service.
Q: - Is there any relation between modprobe.conf file and network devices?
Yes, This file assigns a kernel module to each network device.
For Example :-
[root@localhost ~]#cat /etc/modprobe.conf
alias eth0 b44
Here b44 is the kernel module for network device eth0.
We can Confirm by following command (This module b44 is present or not).
[root@localhost ~]#lsmod |grep b44
b44 29005 0
Q: - What does /boot directory contains?
The /boot/ directory contains static files required to boot the system, such as the Linux kernel, boot loader
configuration files. These files are essential for the system to boot properly.
Q: - If some one deletes /boot directory from your server, than what will happen?
In that case your server will be in unbootable state. Your Server cant boot without /boot directory
because this directory contains all bootable files
Q: - What is the location of log files for CUPS?
The log files for the CUPS printing system are located in the /var/log/cups/ directory.
Q: - What is YUM?
YUM stands for Yellow dog Updater, Modified because it is based on YUP, the Yellow dog Updater.
Where does the name Yellow dog come from? Yellow Dog is a version of Linux for the Power
Architecture hardware and is RPM-based, just like Red Hat Enterprise Linux and Fedora. YUP, and later
YUM, were written by the Linux community as a way to maintain an RPM-based system.
Q: - How you will install software by YUM?
yum install <pkgname>
Q: - Which option is required to assume the answer "yes" to any questions asked during
installation of package dependencies for YUM?
The "-y" option is used to assume the answer "yes".
For Example
yum -y install squid
Q: - What does /dev directory contain?
The /dev directory contains all device files that are attached to system or virtual device files that are
provided by the kernel.
Q: - What are the advantages of YUM?
- Automatic resolution of software dependencies.
- Multiple software locations at one time.
- Ability to specify particular software versions or architectures.
Q: - How to remove a software by YUM?
yum remove <pkgname>
Q: - What is the role of udev daemon?
The udev demon used to create and remove all these device nodes or files in /dev/ directory.
Q: - What kind of files or nodes /dev/ directory contains and how do I access or see device files?
Block Device Files:-
Block device files talks to devices block by block [1 block at a time (1 block =512 bytes to 32KB)].
Examples: - USB disk, CDROM, Hard Disk

#ls /dev/sd*
brw-rw---- 1 root root 8, 0 Mar 15 2009 sda
brw-rw---- 1 root root 8, 1 Mar 15 2009 sda1
brw-rw---- 1 root root 8, 2 Mar 15 2009 sda2
brw-rw---- 1 root root 8, 3 Mar 15 2009 sda3
brw-rw---- 1 root root 8, 4 Mar 15 2009 sda4
brw-rw---- 1 root root 8, 16 Mar 15 2009 sdb
Character Device Files:-

Character device files talk to devices character by character.
Examples: - Virtual terminals, terminals, serial modems, random numbers

#ls /dev/tty*
crw-rw---- 1 root root 4, 64 Mar 15 2009 ttyS0
crw-rw---- 1 root root 4, 65 Mar 15 2009 ttyS1
crw-rw---- 1 root root 4, 66 Mar 15 2009 ttyS2
crw-rw---- 1 root root 4, 67 Mar 15 2009 ttyS3
Q: - How to install Linux softwares by RPM?
rpm -ivh test-1.0-1.i386.rpm
Q: - If a file associated with test-1.0-1.i386.rpm deleted, than How we will recover that file?
We can reinstall this rpm again.
Q: - Which options are required to upgrade a RPM?
Upgrading a package is similar to installing one. Type the following command at a shell prompt:
rpm -Uvh test-2.0-1.i386.rpm
Q: - In which directory RPM database stored?
/var/lib/rpm
Q: - Tell me the name of device file for PS/2 mouse connection.
/dev/psaux
Q: - If you are getting error "package is already installed" but you have to install package any how.
what option you will use?
rpm -ivh test-1.0-1.i386.rpm
Preparing... ###########################################[100%] package test-1.0-1 is already
installed
In this case you can use "--replacepkgs" option.
rpm -ivh replacepkgs test-1.0-1.i386.rpm
Q: - Explain the command "rpm -qa"?
It will queries all currently installed packages.
Q: - Tell me the name of device file for parallel port (Printers).
/dev/lp0
Q: - What does /etc/X11/ directory contains?
The /etc/X11/ directory is for X Window System configuration files, such as xorg.conf.
Q: - How to list PCI Devices on your server or System?
use "lspci" command.
Q: - What is the role of "Kudzu"?
Kudzu is used to Detect new Hardware
Q: - How to Enable ACLs for /home partition?
Add following entry in /etc/fstab
LABEL=/home /home ext3 acl 1 2
Now remount /home partition with acl option.
mount -t ext3 -o acl /dev/sda3 /home
Q: - How to View ACLs for a file(test_file)?
getfacl test_file
Q: - What does /etc/skell directory contains?
The /etc/skel directory contains files and directories that are automatically copied over to a new
user's home directorywhen such user is created by the useradd or adduser command.
Q: - What happens when you add a new device after installation?
The Kudzu program runs each time the system boots and performs a hardware probe. If new hardware is
found, Kudzu attempts to map it to a kernel module. If successful, the information is saved, and the
device is configured.
Q: - How to remove an ACL?
setfacl --remove-all <file-name>
Q: - Tell me name of Linux File systems?
Ext2
Ext3
Q: - What is the difference between ext2 and ext3 file systems?
The ext3 file system is an enhanced version of the ext2 file system.
The most important difference between Ext2 and Ext3 is that Ext3 supports journaling.
After an unexpected power failure or system crash (also called an unclean system shutdown), each
mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is
a time-consuming process and during this time, any data on the volumes is unreachable.
The journaling provided by the ext3 file system means that this sort of file system check is no longer
necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is in
certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system
after an unclean system shutdown does not depend on the size of the file system or the number of files;
rather, it depends on the size of the journal used to maintain consistency. The default journal size takes
about a second to recover, depending on the speed of the hardware.
Q: - Explain the command "rpm -qf "?
it queries the RPM database for which package owns <filename>. When specifying a file, specify the
absolute path of the file.
Q: - How to verify all installed packages?
rpm -Va
Q: - How Many Run Levels present in Linux?
There are 7 run levels, with each having its own properties.
- 0: Halt the system
- 1: Single-user mode
- 2: Not used
- 3: Multi-user mode with text login
- 4: Not used
- 5: Multi-user mode with graphical login
- 6: Reboot
Q: - Which configuration file is required to change the Run Level of Server or system?
/etc/inittab
To change the default run level, modify this line.
id:5:initdefault:
Q: - Any idea about ext4 file system?
The ext4 or fourth extended filesystem is a journaling file system developed as the successor to ext3. Ext4
filesystem released as a functionally complete and stable filesystem in Linux with kernel version 2.6.28.
Features of ext4 file system:-
1. Currently, Ext3 supports 16 TB of maximum file system size and 2 TB of maximum file size. Ext4
have 1 EB of maximum file system size and 16 TB of maximum file size.
[An EB or exabyte is 1018 bytes or 1,048,576 TB]
2. Fast fsck check than ext3
3 In Ext4 the journaling feature can be disabled, which provides a small performance improvement.
4. Online defragmentation.
5. Delayed allocation
Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed allocation.
It consists of delaying block allocation until the data is going to be written to the disk, unlike some other
file systems, which may allocate the necessary blocks before that step.
Q: - How to verify the signature of an rpm?
rpm -K test-1.0-1.i386.rpm
Q: - Explain architectures required for RPMs?
noarch Architecture-independent, can run on any architecture
i386 Generic build for a 32-bit x86 system
i586 Sometimes used when building kernels for older x86 processors
IntelPentium II, Intel Pentium III, Intel Pentium 4, AMD Athlon, and
i686 AMD Duron systems (Most RPMs for these architectures are built using the i386 architecture, with
the kernel for these architectures being built with the
i686 for optimal performance.)
x86_64 64-bit processors such as AMD Athlon64, AMD Opteron, and Intel EM64T
ia64 IntelItanium
ppc 32-bit IBMPOWER, IBM eServer pSeries, and IBM eServer iSeries
s390x 64-bit IBM eServer System z
Q: - How we create ext3 file system on /dev/sda7 disk?
#mkfs j /dev/sda7
Q: - Can we convert ext2 filesystem to ext3 file system?
Yes, we can convert ext2 to ext3 file system by tune2fs command.
tune2fs j /dev/<Block-Device-Name>
Q: - What "neat" command will do?
neat command provides Graphical interface to change network settings for network devices.
Q: - Which protocol is required to allow local printing and print sharing?
Internet Printing Protocol (IPP) is required to allow local printing and print sharing.
Q: - What is SWAP Space?
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs
more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.
While swap space can help machines with a small amount of RAM, it should not be considered a
replacement for more RAM. Swap space is located on hard drives, which have a slower access time than
physical memory.
Q: - What are the steps to create SWAP files or Partition?
- Create swap partition or file
- Write special signature using mkswap
- Activate swap space by swapon a command
- Add swap entry into /etc/fstab file
Q: - <p class="ans">
No
Q: - How you will create swap file of size 4 GB and explain swap file entry in /etc/fstab file?
Use dd command to create swap file.
dd if=/dev/zero of=/SWAPFILE bs=1024 count=4
mkswap /SWAPFILE
swapon a
Entry into /etc/fstab file.
/SWAPFILE swap swap defaults 0 0
Q: - What is CUPS?
CUPS stands for "Common UNIX Printing System". CUPS is a open source printing system developed
by Apple Inc. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and print sharing.
Q: - How we will create ext4 file system?
#mke2fs -t ext4 /dev/DEV
Q: - which utility or command is used for creating software RAIDs for RHEL5?
mdadm
Q: - Can we create software RAID during Linux installation?
Yes, we can create Software RAID during Linux Installation by Disk Druid
Q: - Explain /proc filesystem?
/proc is a virtual filesystem that provides detailed information about Linux kernel, hardwares and
running processes. Files under /proc directory named as Virtual files. Because /proc contains virtual files
thats why it is called virtual file system. These virtual files have unique qualities. Most of them are listed
as zero bytes in size. Virtual files such as /proc/interrupts, /proc/meminfo, /proc/mounts, and
/proc/partitions provide an up-to-the-moment glimpse of the system's hardware. Others, like the
/proc/filesystems file and the /proc/sys/ directory provide system configuration information and
interfaces.
Q: - Can we change files parameters placed under /proc directory?
Yes
To change the value of a virtual file, use the echo command and a greater than symbol (>) to redirect the
new value to the file. For example, to change the hostname on the fly, type:
echo www.nextstep4it.com >/proc/sys/kernel/hostname
Q: - Explain RAID 1?
RAID Level 1 is based on Mirroring technique. Level 1 provides redundancy by writing identical data to
each member disk of the array. The storage capacity of the level 1 array is equal to the capacity of one of
the mirrored hard disks in a Hardware RAID or one of the mirrored partitions in a Software RAID. RAID
1 provides redundancy means good protection against disk failure. In RAID 1 write speed is slow but read
speed is good.
Q: - Explain RAID 5?
RAID Level 5 is based on rotating parity with striping technique. RAID-5 stores parity information but
not redundant data (but parity information can be used to reconstruct data). The storage capacity of
Software RAID level 5 is equal to the capacity of the member partitions, minus the size of one of the
partitions if they are of equal size. The performance of RAID 5 is based on parity calculation process but
with modern CPUs that usually is not a very big problem. In RAID 5 read and write speeds are good.
Q: - Which kernel module is required for Software RAID?
md module
Q: - What is the role of chunk size for software RAID?
Chunk size is very important parameter on which RAID performance based.
We know stripes go across disk drives. But how big are the pieces of the stripe on each disk? The pieces a
stripe is broken into are called chunks.To get good performance you must have a reasonable chunk size.
For big I/Os we required small chunks and for small I/Os we required big chunks.
Q: - What is the use of sysctl command?
The /sbin/sysctl command is used to view, set, and automate kernel settings in the /proc/sys/ directory.
Q: - /proc/ directory contains a number of directories with numerical names. What is that?
These directories are called process directories, as they are named after a program's process ID and
contain information specific to that process.
Q: - What is the difference between hardware RAID and Software RAID?
The hardware-based RAID is independent from the host. A Hardware RAID device connects to the SCSI
controller and presents the RAID arrays as a single SCSI drive. An external RAID system moves all
RAID handling "intelligence" into a controller located in the external disk subsystem. The whole
subsystem is connected to the host via a normal SCSI controller and appears to the host as a single disk.
Software RAID is implemented under OS Kernel level. The Linux kernel contains an MD driver that
allows the RAID solution to be completely hardware independent. The performance of a software-based
array depends on the server CPU performance and load.
Q: - What are the commonly used RAID types?
RAID 0
RAID 1
RAID 5
Q: - Explain RAID 0?
RAID level 0 works on striping technique. In RAID 0 the array is broken down into strips and data is
written into strips. RAID 0 allows high I/O performance but provides no redundancy. RAID 0 Array Size
is equal to sum of disks in array. If one drive fails then all data in the array is lost.
Q: - What is RAID?
RAID, stands for Redundant Array of Inexpensive Disks. RAID is a method by which same data or
information is spread across several disks, using techniques such as disk striping (RAID Level 0), disk
mirroring (RAID Level 1), and disk striping with parity (RAID Level 5) to achieve redundancy, lower
latency, increased bandwidth, and maximized ability to recover from hard disk crashes.
Q: - Why should we use RAID?
System Administrators and others who manage large amounts of data would benefit from using RAID
technology.
Following are the reasons to use RAID
- Enhances speed
- Increases storage capacity using a single virtual disk
- Minimizes disk failure

Puppet
Q: - What is Puppet ?
Puppet is a configuration Tool which is use to automate administration tasks.Puppet Agent(Client) sends
request to Puppet Master (Server) and Puppet Master Push Configuration on Agent.

Q: - What is Manifests ?
Manifests, in Puppet, are the files in which the client configuration is specified.

Q: - What is Module and How it is different from Manifest ?
Whatever the manifests we defined in modules, can call or include into other manifests. Which makes
easier management of Manifests.It helps you to push specific manifests on specific Node or Agent.

Q: - Command to check requests of Certificates ?
puppetca --list (2.6)
puppet ca list (3.0)

Q: - Command to sign Requested Certificates
puppetca --sign hostname-of-agent (2.6)
puppet ca sign hostname-of-agent (3.0)

Q: - Where Puppet Master Stores Certificates
/var/lib/puppet/ssl/ca/signed
Q: - What is Facter ?
Sometime you need to write manifests on conditional experession based on agent specific data which is
available through Facter. Facter provides information like Kernel version,Dist release, IP Address, CPU
info and etc.You can defined your facter also.

Q: - What is the use of etckeeper-commit-post and etckeeper-commit-pre on Puppet Agent ?
etckeeper-commit-post: In this configuration file you can define command and scripts which executes
after pushing configuration on Agent

Etckeeper-commit-pre: In this configuration file you can define command and scripts which executes
before pushing configuration on Agent

Q: - What is Puppet Kick ?
By default Puppet Agent request to Puppet Master after a periodic time which known as runinterval.
Puppet Kick is a utility which allows you to trigger Puppet Agent from Puppet Master.

Q: - What is MCollective ?
MCollective is a powerful orchestration framework. Run actions on thousands of servers simultaneously,
using existing plugins or writing your own.


sendmail server
Q: - How to start sendmail server ?
service sendmail restart
Q: - On which ports sendmail and senmail with SSL works ?
By default, Sendmail uses TCP and UDP port 25 for non-encrypted transfers. If the Sendmail server is
configured to use SSL for encrypting email sent and received, it uses port 465.
Q: - Explain use of "trusted-users" file ?
List of users that can send email as other users without a warning including system users such as apache
for the Apache HTTP Server.
Q: - Explain the use of "local-host-names" file ?
If the email server should be known by different hostnames, list the host- names in this file, one line per
hostname. Any email sent to addresses at these hostnames is treated as local mail. The
FEATURE(`use_cw_file) option must be enabled in the sendmail.mc file for this file to be
referenced.

Q: - explain the use of /etc/aliases file ?
/etc/aliases, can be used to redirect email from one user to another. By default, it includes redirects for
system accounts to the root user. It can then be used to redirect all email for the root user to the user
account for the system administrator.

Q: - Can we use SSL Encryption with Sendmail ?
Yes, Sendmail can be configured to encrypt email sent and received using SSL (secure sockets layer).
Q: - What is Sendmail ?
Sendmail is an MTA, meaning it accepts email messages sent to it using the SMTP proto- col and
transports them to another MTA email server until the messages reach their destinations. It also accepts
email for the local network and delivers them to local mail spools, one for each user.

Q: - What is the role of MUA ?
An MUA (Mail User Agent) with access to the mailbox file, directly or through a network file system,
can read messages from the disk and display them for the user. This is generally a console or webmail
application running on the server.

Q: - Which are the important configuration files for Sendmail server ?
The /etc/mail/ directory contains all the Sendmail configuration files, with sendmail.cf and submit.cf
being the main configuration files. The sendmail.cf file includes options for the mail transmission agent
and accepts SMTP connections for sending email. The submit.cf file configures the mail submission
program.
Q: - How to configure sendmail to accept mail for local delivery that is addressed to other hosts?
Create a /etc/mail/local-host-names file. Put into that file the hostnames and domain names for which
sendmail should accept mail for local delivery. Enter the names with one hostname or domain name per
line. And also make sure that Sendmail configuration file should contain "use_cw_file" option.
dnl Load class $=w with other names for the local host
FEATURE(`use_cw_file')

Q: - When an organization stores aliases on an LDAP server, how you will configure sendmail to
read aliases from the LDAP server?
Use "sendmail -bt -d0" command to check the sendmail compiler options. If sendmail was not compiled
with LDAP support, recompile and reinstall sendmail.
Add an ALIAS_FILE define, containing the string ldap to the sendmail configuration.
#Set the LDAP cluster value
define(`confLDAP_CLUSTER', `wrotethebook.com')
#Tell sendmail that aliases are available via LDAP
define(`ALIAS_FILE', `ldap:')

Q: - How to forward emails of a local user to external address?
Add an alias to the aliases file for each user whose mail must be forwarded to another system. The
recipient field of the alias entry must be a full email address that includes the host part. After adding the
desired aliases, rebuild the aliases database file with the newaliases command.
Q: - You have been asked to create a sendmail configuration that sends all local mail to a mail hub,
while directly delivering mail addressed to external systems.
Create a sendmail configuration containing the MAIL_HUB define to identify the mail relay host for
local mail. Use the LOCAL_USER command to exempt the root user's mail from relaying.
dnl Define a relay server for local mail
define(`MAIL_HUB', `smtp.test.com')
dnl Users whose mail is not passed to the mail hub
LOCAL_USER(root)
Rebuild and reinstall sendmail.cf, and then restart sendmail.

Q: - How to configure multiple mail queues?
mkdir /var/spool/mqueue/queue.1
mkdir /var/spool/mqueue/queue.2
mkdir /var/spool/mqueue/queue.3
chmod 700 /var/spool/mqueue/queue.1
chmod 700 /var/spool/mqueue/queue.2
chmod 700 /var/spool/mqueue/queue.3
Add the QUEUE_DIR define to the sendmail configuration to use the new queue directories.
dnl Declare the queue directory path
define(`QUEUE_DIR', `/var/spool/mqueue/queue.*')

Q: - How to disable certain SMTP commands?
Add the confPRIVACY_FLAGS define to the sendmail configuration to set Privacy Options that disable
unwanted, optional SMTP commands. Here we will disables the EXPN, VRFY, VERB, and ETRN
commands.
dnl Disable EXPN, VRFY, VERB and ETRN
define(`confPRIVACY_FLAGS', `noexpn,novrfy,noverb,noetrn')
Rebuild and reinstall sendmail.cf, and then restart sendmail.
Q: - In which Sendmail configuration file we have to make changes?
we will make the changes only in the sendmail.mc file, and the changes will be moved into the
sendmail.cf file for us.

Q: - When Sendmail dispatches your email, it places the servers hostname behind your username,
which becomes the "from address" in the email (ie. user@mail.test.com).But we want to use the
domain name and not the hostname?
define(`confDOMAIN_NAME', `test.com')dnl
FEATURE(`relay_entire_domain')dnl

Q: - What does /etc/mail/access file contains?
The access database ("/etc/mail/access") is a list of IP addresses and domainnames of allowable
connections.
FEATURE(`access_db',`hash -T<TMPF>-o /etc/mail/access.db')dnl
and cat /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.0 RELAY
test.com RELAY
Q: - How to restrict sendmail to sending a big file?
define(`confMAX_MESSAGE_SIZE',`52428800')dnl
or If you are using a PHP based webmail application like SquirrelMail, you can adjust the max file size in
php.ini file.
vi php.ini
post_max_size =50M
upload_max_filesize =50M
memory_limit =64M

Q: - How to set 25 recipients for each email?
define(`confMAX_RCPTS_PER_MESSAGE',`50')dnl

Q: - Which antivirus you have integrated with sendmail ?
ClaimAV
Q: - What is Clamav-Milter?
Clamav-Milter is a tool to integrate sendmail and clamAV antivirus.

Q: - Which configuration files are required to integrate sendmail and ClaimAV antivirus?
milter.conf and clamav-milter

Q: - How to test sendmail integration with ClaimAV?
grep Milter /var/log/maillog
You have to get following type of messages.
sendmail: Milter add: header: X-Virus-Scanned: ClamAV version 0.88.2, clamav-milter version 0.88.2 on
mail.test.com
sendmail: Milter add: header: X-Virus-Status: Clean
Q: - Which tool you have used to block spamming?
SpamAssassin

Q: - What does "/etc/mail/" directory contains?
The /etc/mail/ directory contain all the Sendmail configuration files, with sendmail.cf and submit.cf being
the main configuration files.
Q: - Explain the use of /etc/mail/relay-domains file?
The /etc/mail/relay-domains file is used to determine domains from which it will relay mail. The contents
of the relay-domains file should be limited to those domains that can be trusted not to originate spam.
Q: - What is the name of spamassassin configuration file?
/etc/mail/spamassassin/local.cf

Q: - How to check mail Queue of sendmail?
/usr/lib/sendmail -bp
or
mailq
Q: - How to use m4 macro processor to generate a new sendmail.cf?
m4 /etc/mail/sendmail.mc >/etc/mail/sendmail.cf

postfix mailserver
Q: - What is the location of postfix mailserver Queue ?
By default, the Postfix mail queues are located in the /var/spool/postfix directory. Each message queue is
created as a separate subdirectory within this directory. Each message is stored as a separate file in the
subdirectory, using a unique identifier for the filename.

Q: - What is LMTP ?
The Local Mail Transport Protocol (LMTP) is a different mail transport protocol described in RFC 2033.
LMTP utilizes a set protocol similar to SMTP for delivering messages to the local host. Postfix can be
configured to deliver messages to local users using LMTP if desired.

Q: - What is canonical Table ?
The cleanup program uses the canonical table to rewrite message addresses contained in the message
header. The mail administrator can use one canonical lookup table for both received messages and sent
messages or separate tables for each. The canonical table is often used in conjunction with the alias file to
provide address header rewriting of outgoing mail messages.
Q: - Who is the creater of Postfix ?
Wietse Venema wrote Postfix as a complete MTA package

Q: - What is the difference between postfix and sendmail ?
The main difference between Postfix and Sendmail is Postfixs modularity. Just as the Unix system
broke up e-mail functionality between modules, Postfix extends that practice to the MTA program.
Postfix uses several different programs to implement the MTA functionality.This allows each modular
program to be smaller and quicker than one large monolithic program would be.
Postfix is more secure than sendmail.Postfix requires a separate userid to be added to the mail server.
Each module runs under this userid. If an intruder compro-mises a Postfix module, he most likely will
still not be able to break out of the module and gain control of the mail server.
Instead of one large compiled configuration file, Postfix uses multiple files that use plaintext parameter
and value names to define functionality. Most of the parameters used in Postfix default to common-sense
values that allow the mail administrator to configure a complete mail server with a minimal amount of
effort.

Q: - what is qmgr ?
Once the valid message is rewritten and placed in the incoming message queue, the qmgr program
ensures that the message is delivered to the proper destinations. The qmgr program then examines
message headers and passes them to the appropriate delivery program depending on the destination
addresses. Currently, the qmgr program can forward messages to the local, smtp, and pipe programs.
Q: - Tell me about latest Version of Postfix on which u have worked ?
postfix 2.6

Q: - What are the important files for postfix server ?
/etc/postfix/main.cf
/etc/postfix/access
/etc/postfix/aliases

Q: - Where postfix mail server logs created ?
/var/log/maillog
Q: - Explain the working of local mail submission for postfix?
When a local email message enters the postfix system. Local messages are deposited into the maildrop
directory of the Postfix queue by the postdrop command, usually through the sendmail compatibility
program. The pickup daemon reads the message from the queue and feeds it to the cleanup daemon. The
cleanup daemon processes all inbound mail and notifies the queue manager after it has placed the
cleaned-up message into the incoming queue. The queue manager then invokes the appropriate delivery
agent to send the message to its next hop or ultimate destination.

Q: - What are the benefits of using SMTP AUTH?
- Using SMTP AUTH we can make it possible for clients, colleagues, and ourselves to relay messages
from everywhere in the world using only one (our) SMTP server.
- Being a mobile user, we don't have to deal with the hassle to find a SMTP server that permits us to
relay.
- We can make use of scripts and daemons that run on our server and provide services that we need e.g.
server-side virus scanning.

Q: - by using postconf command, how you will set fully qualified hostname (mail4.test.com)?
#postconf -e myhostname=mail.example.com
The -e option tells postconf to edit the configuration with the parameters and values specified.
Q: - Which command checks for configuration problems?
#postfix check

Q: - How you will see the queue of postfix server?
#postqueue -p
Q: - How can I clear postfix mail server queue?
#postsuper -d ALL
Q: - How you will reload the postfix queue?
#postsuper -r ALL
Q: - Can postfix server configured with MySQL database?
Yes
Q: - which command is used to find out that postfix is complied with mysql or not?
#postconf -m
nis
regexp
environ
mysql
btree
unix
hash
Q: - What steps required to get Postfix to connect to the MySQL database?
- define the MySQL alias_maps entry in the main.cf configuration file
alias_maps =hash:/etc/postfix/aliases, mysql:/etc/postfix/mysql-aliases.cf
- The configuration file mysql-aliases.cf defines the parameters necessary for postfix to connect to the
MySQL database.
Q: - Explain smtpd_recipient_limit parameter? And what is the default value for this parameter?
The smtpd_recipient_limit parameter can limit the number of recipients allowed in a single incoming
message.
The default value for this parameter is 1000.

Q: - Explain smtpd_timeout Parameter?
The smtpd_timeout parameter limits the amount of time Postfix waits for an SMTP client request after
sending a response. This allows the Postfix administrator to quickly disconnect SMTP servers that camp
out on the SMTP connection, utilizing system resources for the SMTP connection without actually
sending a message.
smtpd_timeout =value
By default, Postfix will assume the value is in seconds.
Q: - Explain queue_run_delay Parameter?
The queue_run_delay parameter sets the time interval (in seconds) that Postfix scans the deferred message
queue for messages to be delivered. The default value for this is 1,000 seconds.
Q: - Explain maximal_queue_lifetime Parameter?
The maximal_queue_lifetime parameter sets the amount of time (in days) that a message remains in the
deferred message queue before being returned as undeliverable. The default value is 5 days. Once this
value is reached, Postfix returns the message to the sender.
Q: - Explain minimal_backoff_time Parameter?
The minimal_backoff_time parameter sets one value that has two uses: the minimum amount of time used
to hold a message in the deferred message queue and the minimum amount of time for which a host can
be marked unreachable. The default value for this parameter is 1,000 seconds.
Q: - Explain maximal_backoff_time Parameter?
The maximal_backoff_time value sets an upper limit to the amount of time a message is left in the
deferred message queue without a delivery attempt. The default value for this parameter is 4,000 seconds.
Q: - Explain default_destination_concurrency_limit Parameter?
The default_destination_concurrency_limit parameter defines the maximum number of concurrent SMTP
sessions that can be established with any remote host. This parameter is related to the SMTP maxprocess
parameter in the master.cf configuration file. The maximum number of concurrent SMTP sessions cannot
exceed the maxprocess value set for the maximum number of SMTP client processes. Thus, if the default
maxprocess value of 50 is used, setting the default_destination_concurrency_limit greater than 50 has no
effect.
Q: - Explain initial_destination_concurrency Parameter?
The initial number of concurrent SMTP sessions Postfix will establish with a remote host is defined by
the initial_destination_concurrency parameter. The default value for this parameter is 2.


Apache Interview Questions & Answers
Q: - How to check the version of Apache server ?
rpm -qa |grep httpd
Q: - What is meaning of "Listen" in httpd.conf file ?
Port number on which to listen for nonsecure (http) transfers.
Q: - What is DocumentRoot ?
it is a location of files which are accessible by clients. By default, the Apache HTTP server in RedHat
Enterprise Linux is configured to serve files from the /var/www/html/ directory.
Q: - How to check the version of Apache server ?
rpm -qa |grep httpd
Q: - What is meaning of "Listen" in httpd.conf file ?
Port number on which to listen for nonsecure (http) transfers.
Q: - What is DocumentRoot ?
it is a location of files which are accessible by clients. By default, the Apache HTTP server in RedHat
Enterprise Linux is configured to serve files from the /var/www/html/ directory.
Q: - On which port Apache server works ?
http - port 80
https - port 443
Q: - Tell me name of main configuration file of Apache server ?
httpd.conf
Q: - On which version of apache you have worked ?
httpd-2.2.3
Q: - What do you mean by a valid ServerName directive?
The DNS system is used to associate IP addresses with domain names. The value of ServerName is
returned when the server generates a URL. If you are using a certain domain name, you must make sure
that it is included in your DNS system and will be available to clients visiting your site.
Q: - What is the main difference between <Location> and <Directory> sections?
Directory sections refer to file system objects; Location sections refer to elements in the address bar of the
Web page
Q: - What is the difference between a restart and a graceful restart of a web server?
During a normal restart, the server is stopped and then started, causing some requests to be lost. A
graceful restart allows Apache children to continue to serve their current requests until they can be
replaced with children running the new configuration.
Q: - What is the use of mod_perl module?
mod_perl scripting module to allow better Perl script performance and easy integration with the Web
server.
Q: - If you have added loglevel Debug in httpd.conf file, than what will happen?
It will give you more information in the error log in order to debug a problem.
Q: - Can you record the MAC (hardware) address of clients that access your server.
No
Q: - If you have only one IP address, but you want to host two web sites on your server. What will
you do?
In this case I will use Name Based Virtual hosting.
ServerName 10.111.203.25
NameVirtualHost *:80
<VirtualHost *:80>
ServerName web1.test.com
DocumentRoot /var/www/html/web1
</VirtualHost>

<VirtualHost *:80>
ServerName web2.test2.com
DocumentRoot /var/www/html/web2
</VirtualHost>
Q: - Can I serve content out of a directory other than the DocumentRoot directory?
Yes, by using Alias we can do this.
Q: - If you have to more than one URL map to the same directory but you don't have
multiple Alias directives. What you will do?
In this case I will use AliasMatch directives.
The AliasMatch directive allows you to use regular expressions to match arbitrary patterns in URLs and
map anything matching the pattern to the desired URL.
Q: - Can you record all the cookies sent to your server by clients in Web Server logs?
Yes, add following lines in httpd.conf file.
CustomLog logs/cookies_in.log "%{UNIQUE_ID}e %{Cookie}i" CustomLog logs/cookies2_in.log
"%{UNIQUE_ID}e %{Cookie2}i"
Q: - Can we do automatically roll over the Apache logs at specific times without having to shut
down and restart the server?
Yes
Use CustomLog and the rotatelogs programs
Add following line in httpd.conf file. CustomLog "| /path/to/rotatelogs /path/to/logs/access_log.%Y-%m-
%d 86400" combined
Q: - What we can do to find out how people are reaching your site?
Add the following effector to your activity log format. %{Referer}
Q: - How you will put a limit on uploads on your web server?
This can be achieved by LimitRequestBody directive.
<Directory "/var/www/html/data_uploads">
LimitRequestBody 100000
</Directory>
Here I have put limit of 100000 Bytes
Q: - I want to stop people using my site by Proxy server. Is it possible?
<Directory proxy:http://www.test.com/myfiles>
Order Allow,Deny
Deny from all
Satisfy All
</Directory>
Q: - What is mod_evasive module?
mod_evasive is a third-party module that performs one simple task, and performs it very well. It detects
when your site is receiving a Denial of Service (DoS) attack, and it prevents that attack from doing as
much damage. mod_evasive detects when a single client is making multiple requests in a short period of
time, and denies further requests from that client. The period for which the ban is in place can be very
short, because it just gets renewed the next time a request is detected from that same host.
Q: - If Some One want Apache server should handle multiple requests over a single TCP
connection. Which of the following would allow to do this?
A. Expirations
B. BrowserMatch
C. KeepAlive
D. PersistentConnect
E. ChunkEncode
Ans: C
Q: -Which of the following HTTP headers will direct a browser to www.nextstep4it.com after
waiting five seconds?
A. Rerwrite 5; URL =http://www.nextstep4it.com/
B. Location 5; URL =http://www.nextstep4it.com/
C. Refresh 5; URL =http://www.nextstep4it.com/
D. Reload http://www.nextstep4it.com/ -t 5
E. Direct -t 5 http://www.nextstep4it.com/
Ans: C
Q: -Cookies can be used by Apache to create a click stream log of user activity. However, for the
cookies to work, Apache must be compiled with the _______ module, then the ______ directive
must be
A. mod_usertrack; Cookie Tracking on
B. mod_cookies; Cookies on}
C. mod_cookietracking; cookie Tracking on
D. mod_cookielog; Cookielogging on
E. mod_userlog, cookielogging on

Ans: A
Q: - Which of the following are TRUE regarding contains in httpd.conf? (Choose two.)
A. Containers consist of a Paired set of delimiters.
B. If two containers contradict, the first is applied.
C. Containers may only be applied globally.
D. Containers allow individual virtual hosts to have their own settings.
Ans: A,D
Q: -Which of the following best explains why Apache Web servers are able to handles multiple
requests?
A. In addition to port 80, Apache opens ports 8080, 8000, and others to handle the additional requests.
B. Apache is able to spawn child processes that handle requests before they die.
C. Apache uses therenice service to load balance between different system daemons.
D. Upon reaching a set number of requests, Apache uses a raw socket to adjust a system's bandwidth to
handle the additional requests.
Ans: B
Q: - Consider the file "test.html". Which of the following best describes what code does?
<html>
<from>
<INPUT TYPE=" button" VALUE="set cookie"
onClick ="document. Cookie =`first_name=Fred`;">
<INPUT TYPE ="button" VALUE ="display cookie"
onClick ="alert (document.cokkie);">
</from>
</html>

A. When the user clicks on "set cookie," it prompts the user for value. Once the value is entered, it can be
displayed using the "display cookie" button.
B. When the user clicks on "set cookie," thefirst_name cookie is set to "Fred." The first_name cookie can
be displayed by clicking the "display cookie" button.
C. When the user first loads "test.html,"first_name is automatically set to "Fred." The value of first_name
can be seen with the "display cookie" button. The first_name cookie can be reset to " 3
empty ("") by clicking the "set cookie" button.
D. When the user clicks on the "set cookie" button, a new HTML page is loaded that displays the word
"Fred". When the user clicks on the "display cookie" button, it alerts the user that it has been

deleted.
Ans: B

Bind Name Server Interview Questions & Answers
Q: - which are the important configuration files for DNS server ?
BIND uses /etc/named.conf as its main configuration file, the /etc/rndc.conf file as the configuration file
for name server control utility rndc, and the /var/named/ directory for zone files and the like.
Q: - What is BIND ?
BIND stands for Berkeley Internet Name Domain which is the most commonly used Domain Name
System (DNS) server on the Internet.
Q: - On which version of bind u have worked ?
BIND 9
Q: - What is the role of DNS ?
A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.
Q: - On which port DNS server works ?
DNS servers use port 53 by default. Incoming and outgoing packets should be allowed on port 53. Also
allow connections on port 921 if you configure a lightweight resolver server.
The DNS control utility, rndc, connects to the DNS server with TCP port 953 by default. If you are
running rndc on the name server, connections on this TCP port from localhost should be allowed. If you
are running rndc on additional systems, allow connections to port 953 (or whatever port you have chosen
to configure) from these additional systems.
Q: - What is round robin DNS?
Round robin DNS is usually used for balancing the load of geographically distributed Web servers. For
example, a company has one domain name and three identical home pages residing on three servers with
three different IP addresses. When one user accesses the home page it will be sent to the first IP address.
The second user who accesses the home page will be sent to the next IP address, and the third user will be
sent to the third IP address. In each case, once the IP address is given out, it goes to the end of the list.
The fourth user, therefore, will be sent to the first IP address, and so forth.
Q: - What is Name Server?
A name server keeps information for the translation of domain names to IP addresses and IP addresses to
domain names. The name server is a program that performs the translation at the request of a resolver or
another name server.
Q: - What is Primary name server or primary master server?
Primary name server/primary masteris the main data source for the zone. It is the authoritative server for
the zone. This server acquires data about its zone from databases saved on a local disk. The primary
server must be published as an authoritative name server for the domain in the SOA resource record,
while the primary master server does not need to be published.
Q: - What is Secondary name server/slave name server?
Secondary name server/slave name server acquires data about the zone by copying the data from the
primary name server (respectively from the master server) at regular time intervals. It makes no sense to
edit these databases on the secondary name servers, although they are saved on the local server disk
because they will be rewritten during further copying.
Q: - what is Root name server?
Root name server is an authoritative name server for the root domain (for the dot). Each root name server
is a primary server, which differentiates it from other name servers.
Q: - what is Stealth name server?
Stealth name server is a secret server. This type of name server is not published anywhere. It is only
known to the servers that have its IP address statically listed in their configuration. It is an authoritative
server. It acquires the data for the zone with the help of a zone transfer. It can be the main server for the
zone. Stealth servers can be used as a local backup if the local servers are unavailable.
Q: - What do you mean by "Resource Records"?
Information on domain names and their IP addresses, as well as all the other information distributed via
DNS is stored in the memory of name servers as Resource Records(RR).
Q: - Explain "TTL"?
Time to live. A 32-bit number indicating the time the particular RR can be kept valid in a server cache.
When this time expires, the record has to be considered invalid. The value 0 keeps nonauthoritative
servers from saving the RR to their cache memory.
Q: - Tell me 5 Types of DNS records?
A, NS, CNAME, SOA, PTR, MX.
Q: - explain "SOA Record"?
The Start of Authority(SOA) record determines the name server that is an authoritative source of
information for the particular domain. There is always only one SOA record in the file, and it is placed at
the beginning of the file of authoritative resource records.
Q: - what is "A Record"
A (Address) records assign IP addresses to domain names of computers. The IP address cannot have a dot
at the end.
Q: - Explain "CNAME Record"?
Synonyms to domain names can be created using CNAME records. This is often referred to as 'creating
aliases for computer names'.
Q: - What are "HINFO and TXT Records"?
HINFO and TXT records are for information only. An HINFO record has two items in its data part. The
first item is information about hardware, and the second one is information about software. A TXT record
contains a general data string in its data part.
Example :
test.com IN SOA ...
...
mail IN A 192.1.1.2
IN HINFO My_Server UNIX
IN TXT my server
Q: - what are "MX Records"?
MX records specify the mailing server of the domain. An MX record shows to which computer a mail of
a particular domain should be sent. The MX record also includes a priority number, which can be used to
determine several computers where the mail for the domain can be sent. The first attempt is to deliver the
mail to the computer with the highest priority (lowest value). If this attempt fails, the mail goes to the next
computer (with a higher priority value), and so on.

test.com IN SOA ...
...
mail IN A 192.1.1.2
IN HINFO AlphaServer UNIX
IN TXT my server
IN MX 30 mail2.nextstep4it.com
IN MX 20 mail3.nextstep4it.com
IN MX 10 mail2.nextstep4it.com
Submitted By:-Anshu Email-ID: - anshu.raahti@gmail.com
Q: - Explain "PTR Records"?
A Pointer Record(PTR) is used to translate an IP address into a domain name.
Q: - What is Dynamic DNS?
Dynamic DNS a method of keeping a domain name linked to a changing IP address as not all computers
use static IP addresses. Typically, when a user connects to the Internet, the user's ISP assigns an unused
IP address from a pool of IP addresses, and this address is used only for the duration of that specific
connection. This method of dynamically assigning addresses extends the usable pool of available IP
addresses. A dynamic DNS service provider uses a special program that runs on the user's computer,
contacting the DNS service each time the IP address provided by the ISP changes and subsequently
updating the DNS database to reflect the change in IP address.

IP Tables Interview Questions & Answers
Q: - What is iptables ?
iptables is a user space application program that allows a system administrator to configure the tables
provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and
rules it stores. Different kernel modules and programs are currently used for different protocols; iptables
applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.
Q: - What is the configuration file of iptables in linux ?
/etc/sysconfig/iptables
Q: - How Do I Save Iptables Rules or Settings?
Fedora Linux you can use following commands to save and restore firewall rules. To Save the rules to
/etc/sysconfig/iptables file: #/etc/init.d/iptables save To restore the rules from /etc/sysconfig/iptables file:
#/etc/init.d/iptables start If you are using Debian / Ubuntu Linux open /etc/network/interfaces: #vi
/etc/network/interfaces Append the line to eth0 section: post-up iptables-restore Close and save the file.
Reboot the system.
Q: - What are tables used in iptables ?
Nat Table
Mangle Table
Filter Table
Q: - What is Nat Table in iptables ?
The nat table is used mainly for Network Address Translation. "NAT"ed packets get their IP addresses
altered, according to our rules. Packets in a stream only traverse this table once. We assume that the first
packet of a stream is allowed. The rest of the packets in the same stream are automatically "NAT"ed or
Masqueraded etc, and will be subject to the same actions as the first packet. These will, in other words,
not go through this table again, but will nevertheless be treated like the first packet in the stream. This is
the main reason why you should not do any filtering in this table, which we will discuss at greater length
further on. The PREROUTING chain is used to alter packets as soon as they get in to the firewall. The
OUTPUT chain is used for altering locally generated packets (i.e., on the firewall) before they get to the
routing decision. Finally we have the POSTROUTING chain which is used to alter packets just as they
are about to leave the firewall.
Q: - Describe mangle Table of iptables ?
This table is used mainly for mangling packets. Among other things, we can change the contents of
different packets and that of their headers. Examples of this would be to change the TTL, TOS or MARK.
Note that the MARK is not really a change to the packet, but a mark value for the packet is set in kernel
space. Other rules or programs might use this mark further along in the firewall to filter or do advanced
routing on; tc is one example. The table consists of five built in chains, the PREROUTING,
POSTROUTING, OUTPUT, INPUT and FORWARD chains. PREROUTING is used for altering packets
just as they enter the firewall and before they hit the routing decision. POSTROUTING is used to mangle
packets just after all routing decisions have been made. OUTPUT is used for altering locally generated
packets after they enter the routing decision. INPUT is used to alter packets after they have been routed to
the local computer itself, but before the user space application actually sees the data. FORWARD is used
to mangle packets after they have hit the first routing decision, but before they actually hit the last routing
decision. Note that mangle can't be used for any kind of Network Address Translation or Masquerading,
the nat table was made for these kinds of operations.
Q: - Explain filter table in iptables ?
The filter table should be used exclusively for filtering packets. For example, we could DROP, LOG,
ACCEPT or REJ ECT packets without problems, as we can in the other tables. There are three chains built
in to this table. The first one is named FORWARD and is used on all non-locally generated packets that
are not destined for our local host (the firewall, in other words). INPUT is used on all packets that are
destined for our local host (the firewall) and OUTPUT is finally used for all locally generated packets.
Q: - What are the target vaules in iptables ?
Following are the possible special values that we can specify in the target.
ACCEPT Firewall will accept the packet.
DROP Firewall will drop the packet.
QUEUE Firewall will pass the packet to the userspace.
RETURN Firewall will stop executing the next set of rules in the current chain for this packet. The
control will be returned to the calling chain
Q: - How To list all the rules applied on your system and how to flush all iptables rules ?
To list the rules we have on our system use:
#iptables -nL
To flush (drop) all the rules we can use:
#iptables -F
Q: - Explain filter table in iptables ?
The filter table should be used exclusively for filtering packets. For example, we could DROP, LOG,
ACCEPT or REJ ECT packets without problems, as we can in the other tables. There are three chains built
in to this table. The first one is named FORWARD and is used on all non-locally generated packets that
are not destined for our local host (the firewall, in other words). INPUT is used on all packets that are
destined for our local host (the firewall) and OUTPUT is finally used for all locally generated packets.
Q: - What are the target vaules in iptables ?
Following are the possible special values that we can specify in the target.
ACCEPT Firewall will accept the packet.
DROP Firewall will drop the packet.
QUEUE Firewall will pass the packet to the userspace.
RETURN Firewall will stop executing the next set of rules in the current chain for this packet. The
control will be returned to the calling chain.
Q: - How To list all the rules applied on your system and how to flush all iptables rules ?
To list the rules we have on our system use:
#iptables -nL
To flush (drop) all the rules we can use:
#iptables -F

Network Security Interview Questions & Answers
Q: - What is Data encryption?
Data encryption ensures data safety and very important for confidential or critical data. It protect data
from being read, altered or forged while transmission.
Q: - What is the Public Key Encryption?
Public key encryption use public and private key for encryption and decryption. In this mechanism, public
key is used to encrypt messages and only the corresponding private key can be used to decrypt them. To
encrypt a message, a sender has to know recipient's public key.
Q: - What is Digital Signatures ?
Digital signature is an attachment to an electronic message used for security purpose. It is used to verify
the authenticity of the sender.
Q: - What are Brute Force Attacks?
Brute forcing is a mechanism which is used by an attacker to break the encryption of data by applying a
set of various key. Cryptanalyst has a set of number of keys and apply them one by one to the encryption
algorithm until he get the right key.
Example: http://www.abc.com/online/Displaymsg.asp?msgID=87951
In this example a cryptanalyst may apply bruteforcing to the value of msgID and read the users data.
In this the browser requesting for Displaymsg.asp page and sending msgID 87951 to the web server.
Q: - How do you use RSA for both authentication and secrecy?
RSA is a public key encryption algorithm. The RSA algorithms are based on the mathematical part that it
is easy to find and multiply large prime numbers together, but it is extremely difficult to factor their
product.
For authentication: One can encrypt the hash (MD4/SHA) of the data with a private key. This is known as
digital signature.
For Secrecy: Secrecy/confidentiality is achieved by encrypting the data with public key and decrypting
with private key.
Q: - If you are a victim of Denial of Service (Dos) then what you do?
The function of a denial of service attack is to flood its target machine with too much traffic and prevents
it from being acc essible to any other requests or providing services.
To prevent DoS attacks firewall can be configured as a relay; in this approach the firewall responds on
behalf of the internal host. During the attack, the firewall responds to the SYN sent by the attacker; since
the ACK never arrives, the firewall terminates the connection.
By Keeping protocols and Antivirus software up-to-date, we can prevent to be a victim of DoS. A regular
scanning of the machine is also necessary in order to detect any anomalous behavior.
Q: - What are the differences among encoding, encryption and hashing?
Encoding: Basically encoding is used to protect the integrity of data as it crosses through communication
network to keep its original message upon arriving. It is primarily an insecure function because it is easily
reversible.
Encryption: Encryption is basically designed for confidentiality and data integrity and reversible only if
you have the appropriate key.
Hashing: With hashing the operation is one-way i.e. non-reversible. It takes an input (or ,message ) and
returns a fixed-size string, which is called the hash value.
needed in a secure hash function?
A secure hash function should have the following characteristics:
I. The output generated by a hash function should be of a fixed length.
II. It should be very easy to find out a hash function for a given message.
III. If a hash value is given of a message than it is almost impossible to get that message.
IV. The two different messages should not have the same hash value; it is against the hash function property.
Q: - What is Authentication Header and how it provides the protection to IP header?
Basically Authentication Header protects IP header and provides the complete authenticity to the IP
packets.
AH may work in two ways: transport mode and tunnel mode.
In tunnel mode; AH protects the IP header using two IP header layers inner and outer. Inner IP header is
used to contain the source and destination addresses, and the outer IP header is used to contain the
security gateway information.

LINUX Interview Questions : PART 1


Hi Friends...i planned to update interview questions and answers for LINUX admins. Hope this will help
you to refresh your knowledge at the time of interview perparation.


Few points before start,

1.Be Clear and Frank while prepare resume. Since mostly question wil be asked based on ur resume.
2.Try to focus more about ur day to day job in resume.
3.Make sure you are clear in basic Linux such as booting, LVM, Architecture, servermodel which you
worked.
4.Before give interview write down your day to day work , server model information ,your current
environment details and review your self.
5.Dont prepare upto last minute it will spoil your mood and confidence.
6.Once interview over note down the Question which they asked. It will help for next interview.

For L1 & L2 Admin Interview:

Maximum the Question will be on below area

1.Booting procedure of linux server
2.user administration
3.LVM -FS creation/ extend / FS issues & recover
4.Software install / remove / update - RPM or YUM
5.Basic services config /troubleshoot - E.G : NFS ,FTP , SAMBA , DNS , DHCP
6.Utilization issues - CPU , MEMORY , DISK
7.Hardware errors and troubleshoot
8.PAtch installation / roll back


Ok Now we can start look into questions and answers



QUESTIONS :

1.Explain Booting Procedure?
2.What is stage 1.5 Bootloader ?
3.How will you reinstall GRUB?
4.How to resolve booting issues in linux?
5.How to reset root password or recover root password
6.What is Super Block? How will you recover it?



Question 1: Explain Booting procedure or steps in Linux?


1. Once System powered on, it automatically invokes BIOS

2. BIOS will start the processor and perform a POST [power on self test] to check the connected device
are ready to use and are working properly.

3. After POST , BIOS will check for the booting device. The boot sector is always the first sector of the
hard disk and BIOS will load the MBR into the memory.
MBR holds the boot loader of the OS.

4. Then boot loader takes the control of the booting process.

5. GRUB is the boot loader for Linux.

6. Depending on the boot option selected the kernel is loaded first.

7. After kernel is loaded the kernel will take the control of the booting process

8. Initrd will be loaded which contains drivers to detect hardware (its called Initialization of RAM Disk)

9. Then it will initialize all the hardware including I/O processors etc.

10. Kernel will mounts the root partition as read-only

11. INIT is loaded as the first process.

12. INIT will mount the root partition and other partitions as read/write and checks for file system errors.

13. Sets the System Clock, hostname etc..

14. Based on the Runlevel, it will load the services and runs the startup scripts which are located in
/etc/rcX.d/ (Network, nfs, SSH etc.)

15. Finally it runs the rc.local script & Now the login prompt will appear.




Question 2: What is stage 1.5 boot loaded in linux?

The great thing about GRUB is that it includes knowledge of Linux file systems. Instead of using raw
sectors on the disk, as LILO does,
GRUB can load a Linux kernel from an ext2 or ext3 file system. It does this by making the two-stage boot
loader into a three-stage boot loader.

A. Stage 1.5 boot loader , it contains extra coe to allow cylinders above 1024, or LBA type drives, to be
read.
B. It will be stored on MBR or Boot partition .
C. Stage 1 (MBR) boots a stage 1.5 boot loader that understands the particular file system containing the
Linux kernel image.
D. Basically this module will load the knowledge of Filesystem to Grub to read the kernel
so ,
Stage 1 Boot loaded is : MBR
Stage 1.5 Boo loader : e2fs_stage1_5
Stage 2 Boot loader is : GRUB


Question 3: How to reinstall GRUB?

A.Boot up using RHEL4 disk.

B.Enter into rescue mode

#linux rescue (hit ok)

C. Then follow below commands

#chroot /mnt/sysimage

#grub

#find /boot/grub/stage1 or find /grub/stage1

root(hd0,0) //example o/p

Now install the GRUB

#setup (hd0)

#EXIT

Another Method

#linux rescue

#chroot /mnt/sysimage

#/sbin/grub-install /dev/hda

Question 4: Linux Booting Issues : How to solve ??

Option 1: init not found error
Option 2: Run fsck on all FS in rescue mode
Option 3: Reinstall GRUB
Option 4: Recover grub.conf / grub configuration

Option 1: For normal panic and "init not found" error.

Error : "init not found" displayed

1) Launch the system to Bash shell prompt

Reboot the server and interrupt to edit the GRUB.

Edit grub and enter the below in last

init=/bin/bash

Then save and exit and boot the server. This will launch you straight into a Bash shell prompt.Then you
can remount / file system and check /var/log/messages for any error.

Note : init=/bin/bash (Grub boot loader) or linux init=/bin/bash (if Lilo boot loader).

2) Once server booted and if it is in Bash shell prompt

#mount -o remount,rw /

3) Now you can check the log messages and try to find the reason for server pacnic or error.

#more /var/log/messages


Option 2: If the above option not helped then follow the next

1) Boot from the Linux First CD (boot CD).

2) Type boot rescue at Linux boot prompt.

3) After the bash shell prompt show up, type the below command

#chroot /mnt/sysimage

a) Run fsck and Check for any disk error

#fdisk -l /dev/sda //check how many partion you have

then run fsck on each partition

#fsck -y /dev/sda2'

Option 3: If the above also not helped then reinstall grub and retry.

In rescue mode.

# chroot /mnt/sysimage

#/sbin/grub-install /dev/hda


Option 4: If a system has issues with the GRUB configuration

(possibly caused by incorrect changes to the the GRUB configuration file, installation of another OS,
changes to device ordering due to hardware or BIOS changes, etc.)

#grub>find /boot/grub/grub.conf (or) grub>find /grub/grub.conf (or) find /boot/grub/stage1
(hd0,1)
(hd1,2)

>>This tells us that we have two /boot partitions. Then we have to reinstall the GRUB config on disk
(one by one) and try.

#grub>root (hd0,1) //Write the GRUB bootloader on the MBR of the first disk
grub>setup (hd0)
grub>quit

If you have doubt as to where the root partition is located then try to find a file in /etc.

#grub>find /etc/fstab
(hd0,1)


Note: You must pay attention to your devices, for me "hd0" is the root disk and (hd0,1) is /boot partition ,
and (hd0,1) is my ROOT (/) partition. mostly / "root" partion will be on LVM.
You might not even have "hd0" mapped out. Review your "/boot/grub/device.map" file

#cat /boot/grub/device.map

Question 5 : How to recover or rest Root password in LINUX?

While booting

1. Select the kernel
2. Press the "e" key to edit the entry
3. Select second line (the line starting with the word kernel)
4. Press the "e" key to edit kernel entry so that you can append single user mode
5. Append the letter "S" (or word Single) to the end of the (kernel) line
6. Press ENTER key
7. Now press the b key to boot the Linux kernel into single user mode
8. At prompt type passwd command to reset password:

You need to mount at least / and other partitions:
#mount -t proc proc /proc
#mount -o remount,rw /

Change the root password,

#passwd

thenreboot system:
#sync
#reboot

Question 6: What is super Block and how will u recover it ?


The blocks used for two different purpose:

1. Most blocks stores user data aka files (user data).
2. Some blocks in every file system store the file system's metadata.

So what the hell is a metadata?

File system type
Size
Status
Information about other metadata structures


To find super block

#dumpe2fs /dev/sda3|grep -i superblock

or

#mke2fs -n /dev/sda3



To repair file system by alternative-superblock use command as follows:

#e2fsck -f -b 8193 /dev/sda3

Linux Interview Questions : PART 2 : Click Here
7. What is hard link and soft link? How to create symbolic link?

8. What is INODE ? How to reduce inode utilization?

9. What is HARD and SOFT mount in NFS ?

10. Explain NFS mount options ?

11. CPU states in TOP or Explain o/p of TOP command

12. How to check architecture of Linux server OS
Question 7: What is hard link and soft link? How to create symbolic link?


A. Hard links cannot link directories.
Cannot cross file system boundaries.

B. Soft or symbolic links are just like hard links. It allows to associate multiple filenames with a single
file. However, symbolic links allows:

To create links between directories.
Can cross file system boundaries.



How do I create symbolic link?

You can create symbolic link with ln command:

#ln -s /path/to/file1.txt /path/to/file2.txt

(inode number will be same for hard linked file )

#ln /mades/file1 /mades/file2 - ( create hard link)

Question 8: What is INODE ? How to reduce inode utilization?

An inode is a data structure on a traditional Unix-style file system such as UFS or ext3.
An inode stores basic information about a regular file, directory, or other file system object.

=>File type (executable, block special etc)
=>Permissions (read, write etc)
=>Owner
=>Group
=>File Size
=>File access, change and modification time

(remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux
sys admin job interview)


How to reduce inode usage in File system?

For examble /opt filesystem's inode usage is high means we have to do below steps

#bdf -i /opt : check the FS usage

Create a test directory on your filesystem;

#mkdir /opt/test

Create a script that will create 10000 null files.

#cd /opt/test
#i=1
#while [ $i -lt 10000 ]
>do
>touch $i
>i=`expr $i +1`
>done

Else you will be watching the terminal for years to get you the prompt or else CTRL +C will do :-D

once files are created do

#bdf -i /opt
Question 9 : What is HARD and SOFT mount in NFS ?

In HARD mount ...

If the NFS file system is hard mounted, the NFS daemons will try repeatedly to contact the server. The
NFS daemon retries will not time out, will affect system performance, and you cannot interrupt them

If you just mount a file system without specifying hard or soft, the default is a hard mount. Hard mounts
are preferable because of the stateless nature of NFS.

If a client sends an I/O request to the server (such as an ls -la), and the server gets rebooted, in client
machine the process will keep on running.
This preserves data transfers in the event of a server failure

IN SOFT Mount :

A soft mount allows the client to stop trying an operation after a period of time. If the NFS server goes
down at the time of data transfer , it will alert and the process will do down.Thsi may cause the data
corruption.
A soft link will return with an error and fail.

you should only use soft mounts in the cases where client responsiveness is more important than data
integrity.

In another word ..soft mount will allow automatic unmount if the filesystem is idle for a specified time
period

Question 10 : Explain NFS mount options ?

Syntax to mount NFS FS:

#mount -t vfstype [-o options] NFS Servername:/exporteddirectory /mount point

or

#mount -t nfs -o options host:/remote/export /local/directory

Mount options explained below :

1. -0 initr

This option is used in non reliable network, or network having more network congestion. NFS request
will be interrupted when server is not reachable.

2. -o hard

If hard option is specified during nfs mount, user cannot terminate the process waiting for NFS
communication to resume. For ex ..if u ran ls -a command on ur NFS mounted directory but that time ur
NFS server went down means .
The process wont get killed or stopped ..it will wait until the NFS server and mount poit become
available.

3. -o soft

If soft option is specified during nfs mount, user will get error alert when NFS server is not reachable.
This is just inverse of hard mount option. It wont wait for reply if the NFS server went down , it will alert
us and the process will go down.

4. -o Nfsvers=value

If this option is specified during nfs mount NFS client uses particular NFS protocol version to
communicate.

For example - TCP

#mount -t nfs -o tcp 192.168.1.4:/mnt/array1/RHEL5 /data/
#mount | grep -i tcp
192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,tcp,addr=192.168.1.4)

The Difference between HARD and SOFT mount option explained in another POST.

Question 11: Explain TOP command output / Various states of CPU

#us ->User CPU time: The time the CPU has spent running users processes that are not niced.
#sy ->System CPU time: The time the CPU has spent running the kernel and its processes.
#ni ->Nice CPU time: The time the CPU has spent running users process that have been niced.
#wa ->iowait: Amount of time the CPU has been waiting for I/O to complete.
#hi ->Hardware IRQ: The amount of time the CPU has been servicing hardware interrupts.
#si ->Software Interrupts.: The amount of time the CPU has been servicing software interrupts
Question 12: How to check architecture of Linux OS
We can use below commands to check the architecture of server OS,

1. #getconf LONG_BIT

2.#uname -a

3.#grep flags /proc/cpuinfo

4.#arch

5.#file /bin or file bc

List of Network Diagnostic Tools
In RHEL/Centos/Fedora
ip -- show / manipulate routing, devices, policy routing and tunnels
ifconfig --configure a network interface
ethtool -- query or control network driver and hardware settings
tcpdump -- dump traffic on a network
wireshark -- Interactively dump and analyze network traffic
netstat -- Print network connections, routing tables, interface statistics, masquerade connections, and
multicast memberships
ss -- another utility to investigate sockets
dropwatch -- dropwatch aims to consolidate several of those checks into one tool, making it easier for a
sysadmin or developer to detect lost packets.
systemtap -- systemtap script translator/driver
nmap -- Network exploration tool and security / port scanner
nc -- arbitrary TCP and UDP connections and listens
ping -- send ICMP ECHO_REQUEST to network hosts
ping6 -- send ICMP ECHO_REQUEST to network hosts
iptables -- administration tool for IPv4 packet filtering and NAT
ip6tables -- administration tool for IPv6 packet filtering and NAT
arp -- Linux ARP kernel module.
arping -- send ARP REQUEST to a neighbour host
tc -- show / manipulate traffic control settings, is used to configure Traffic Control in the Linux
lnstat -- unified linux network statistics
nstat -- rtacct - network statistics tools
traceroute -- print the route packets trace to network host
tracepath -- traces path to a network host discovering MTU along this path
tunctl --create and manage persistent TUN/TAP interfaces


1) What is GRUB
GNU GRUB is a Multiboot boot loader. It was derived from GRUB, the GRand Unified Bootloader,
which was originally designed and implemented by Erich Stefan Boleyn.
Briefly, a boot loader is the first software program that runs when a computer starts. It is
responsible for loading and transferring control to the operating system kernel software
(such as the Hurd or Linux). The kernel, in turn, initializes the rest of the operating
system (e.g. GNU)
2) Explain Linux Boot Process
Press the power button on your system, and after few moments you see the Linux login prompt.
Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears?
The following are the 6 high level stages of a typical Linux boot process.

a. BIOS
BIOS stands for Basic Input/Output System
Performs some system integrity checks
Searches, loads, and executes the boot loader program.
It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the
BIOS startup to change the boot sequence.
Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.
So, in simple terms BIOS loads and executes the MBR boot loader.
b. MBR
MBR stands for Master Boot Record.
It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda
MBR is less than 512 bytes in size. This has three components 1) primary boot loader info in 1st 446 bytes 2) partition table info in next 64
bytes 3) mbr validation check in last 2 bytes.
It contains information about GRUB (or LILO in old systems).
So, in simple terms MBR loads and executes the GRUB boot loader.
c. GRUB
GRUB stands for Grand Unified Bootloader.
If you have multiple kernel images installed on your system, you can choose which one to be executed.
GRUB displays a splash screen, waits for few seconds, if you dont enter anything, it loads the default kernel image as specified in the grub
configuration file.
GRUB has the knowledge of the filesystem (the older Linux loader LILO didnt understand filesystem).
Grub configuration file is /boot/grub/grub.conf (/etc/grub.conf is a link to this). The following is sample grub.conf of CentOS.

1
2
3
4
5
6
7
8
9
<span style="background-color: #dff10d; color: #260af4;"><strong>#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/
initrd /boot/initrd-2.6.18-194.el5PAE.img</strong></span>
As you notice from the above info, it contains kernel and initrd image.
So, in simple terms GRUB just loads and executes Kernel and initrd images.
d. Kernel
Mounts the root file system as specified in the root= in grub.conf
Kernel executes the /sbin/init program
Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a ps -ef | grep init and check the pid.
initrd stands for Initial RAM Disk.
initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary
drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.
e. Init
Looks at the /etc/inittab file to decide the Linux run level.
Following are the available run levels
o 0 halt
o 1 Single user mode
o 2 Multiuser, without NFS
o 3 Full multiuser mode
o 4 unused
o 5 X11
o 6 reboot
Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.
Execute grep initdefault /etc/inittab on your system to identify the default run level
If you want to get into trouble, you can set the default run level to 0 or 6. Since you know what 0 and 6 means, probably you might not do
that.
Typically you would set the default run level to either 3 or 5.
f. Runlevel programs
When the Linux system is booting up, you might see various services getting started. For example, it might say starting sendmail . OK.
Those are the runlevel programs, executed from the run level directory as defined by your run level.
Depending on your default init level setting, the system will execute the programs from one of the following directories.
o Run level 0 /etc/rc.d/rc0.d/
o Run level 1 /etc/rc.d/rc1.d/
o Run level 2 /etc/rc.d/rc2.d/
o Run level 3 /etc/rc.d/rc3.d/
o Run level 4 /etc/rc.d/rc4.d/
o Run level 5 /etc/rc.d/rc5.d/
o Run level 6 /etc/rc.d/rc6.d/
Please note that there are also symbolic links available for these directory under /etc directly. So, /etc/rc0.d is linked to /etc/rc.d/rc0.d.
Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K.
Programs starts with S are used during startup. S for startup.
Programs starts with K are used during shutdown. K for kill.
There are numbers right next to S and K in the program names. Those are the sequence number in which the programs should be started or
killed.
For example, S12syslog is to start the syslog deamon, which has the sequence number of 12. S80sendmail is to start the sendmail daemon,
which has the sequence number of 80. So, syslog program will be started before sendmail.
There you have it. That is what happens during the Linux boot process.
3) Which files are called for user profile by default when a user gets login
$HOME/.bash_profile, $HOME/.bash_bashrc
4) Which file needs to update if srequired to change default runlevel 5 to 3
File is /etc/inittab and required to change below lines:
id:5:initdefault: to id:3:initdefault:
5) What command used for showing user info like Login Name, Canonical Name, Home Directory,Shell etc..
FINGER command can be used i.g; finger username
6) What is inode number
An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An
inode stores basic information about a regular file, directory, or other file system object
iNode number also called as index number, it consists following attributes:
File type (executable, block special etc)
Permissions (read, write etc)
Owner
Group
File Size
File access, change and modification time (remember UNIX or Linux never stores file creation
time, this is favorite question asked in UNIX/Linux sys admin job interview)
File deletion time
Number of links (soft/hard)
Extended attribute such as append only or no one can delete file including root user
(immutability)
Access Control List (ACLs)
Following command will be used to show inodes of file and folders:
ls -i
Following command will show complete info about any file or folders with inode number
stat file/folder
Files/Folders can also be deleted using inode numbers with following command:
find out the inode number using ls -il command then run below command
find . -inum inode_number -exec rm -i {}\;
7) How can we increase disk read performance in single command
blockdev command
This is sample output yours may be different.
#Before test
$ blockdev getra /dev/sdb
256
$ time dd if=/tmp/disk.iso of=/dev/null bs=256k
2549+1 records in
2549+1 records out
668360704 bytes (668 MB) copied, 6,84256 seconds, 97,7 MB/s
real 0m6.845s
user 0m0.004s
sys 0m0.865s
#After test
$ blockdev setra 1024 /dev/sdb
$ time dd if=/tmp/disk.iso of=/dev/null bs=256k
2435+1 records in
2435+1 records out
638390272 bytes (638 MB) copied, 0,364251 seconds, 1,8 GB/s
real 0m0.370s
user 0m0.001s
sys 0m0.370s
8) . command to change user password expiration time
CHAGE
9) Command used to lock user password
usermod -L username
10) How many default number of Shells available and what are their names?
SH, BASH, CSH, TCSH, NOLOGIN, KSH
11) Which file defines the attributes like UID, PASSWORD expiry, HOME Dir create or not while adding user
/etc/login.defs
12) command used for changing authentication of linux system to LDAP/NIS/SMB/KERBOS
authconfig
13) command used for changing the attributes of any file
chattr
14) What is the path of network (ethX) configuration files
/etc/sysconfig/network-scripts/ethX
15) How can we change speed and make full duplex settings for eth0
We can do this with below given 2 methods:
ethtool -s eth0 speed 100 duplex full
ethtool -s eth0 speed 10 duplex half
OR
mii-tool -F 100baseTx-HD
mii-tool -F 10baseT-HD
16) File which stores the DNS configuration at client side
/etc/resolve.conf
17) Main configuration file and command used for exporting NFS directories and its deamons
/etc/exports and exportfs -av , deamons are quotad, portmapper, mountd, nfsd and nlockmgr/status
18) What is command to check ports running/used over local machine
netstat -antp
19) What is the command to check open ports at remote machine
nmap
20) What is the difference between soft and hard links
Soft Links =>1) Soft link files will have different inode numbers then source file
2) If original file deleted then soft link file be of no use
3) Soft links are not updated
4) Can create links between directories
5) Can cross file system boundaries
Hard Links =>1) Hard links will have the same inode number as source file
2) Hard links can not link directories
3) Can not cross file system boundaries
4) Hard links always refers to the source, even if moved or removed
21) How to setup never expired user password
chage -E never username
22) Restricting insertion into file if full permission are assigned to all
chattr +i filename
23) Display or Kill all processes which are accessing any folder/file
Display User who are using file/folder : fuser -u file/folder
Kill All Processes which are using file/folder: fuser -k file/folder
24) Kill any users all processes
killall -u username
25) How can we have dail y system analysis and reports over mail
Use logwatch
26) How can we rotate logs using logrotate without performing any operation like move and gzipng over original file and then
creating new file (which is very lengthy process)
We can use logrotates copytruncate option which will simply copy original file and truncate original file
27) Command to collect detailed information about the hardware and setup of your system
dmidecode , sysreport
28) Command to check PCI devices vendor or version
Ans lspci
29) What is the difference between cron and anacron
Cron :
1) Minimum granularity is minute (i.e J obs can be scheduled to be executed
every minute)
2) Cron job can be scheduled by any normal user ( if not restricted by super
user )
3) Cron expects system to be running 24 x 7. If a job is scheduled, and
system is down during that time, job is not executed
4) Ideal for servers
5) Use cron when a job has to be executed at a particular hour and minute
Anacron :
1) Minimum granularity is only in days
2) Anacron can be used only by super user ( but there are workarounds to
make it usable by normal user )
3) Anacron doesnt expect system to be running 24 x 7. If a job is scheduled,
and system is down during that time, it start the jobs when the system
comes back up.
4) Ideal for desktops and laptops
5) Use anacron when a job has to be executed irrespective of hour and
minute
30) Default Port numbers used by ssh,ftp,http,https,telnet,smtp,pop3,pop3s,imap,imaps
SSH 22, ftp 20/21, http 80, https 443, SMTP/SMPTS 25/465, POP3/POP3S 110/995, IMAP/IMAPS 143/993
31) How to setup ACLs in following case:
1) Create a file FILE1 and this should be read,write,executable for all user but Read only for user USER1
2) Copy FILE1 ACLs to FILE2 ACL
3) Delete a USER1s rule for FILE1 which were setup in step 1)
Ans 1) touch FILE1 ; chmod 777 FILE1 ; setfacl -m u:USER1:r FILE1
2) getfacl FILE1 | setfacl set-file=- FILE2
3) setfacl -x u:USER1 FILE1
32) How to make USB bootable?
Write efidisk.img from RHEL 6 DVD images/ subdirectory to USB
dd if=efidisk.img of=/dev/usb (usb device name)
33) How can we check disk/device status/failure/errors using smartctl utility?
Try following to check:
Enable/Disable SMART on device/disk : smartctl -s on /dev/sda
Check device SMART health : smartctl -H /dev/sda
Check device SMART capabilities : smartctl -c /dev/sda
Enable/Disable automatic offline testing on device : smartctl -o on/off /dev/sda
Show device SMART vendor-specific Attributes and values : smartctl -A /dev/sda
Show device log [TYPE : error, selftest, selective, directory,background,
scttemp[sts,hist]] : smartctl -l TYPE /dev/sda
Run test on device [TEST: offline short long conveyance select,M-N pending,N
afterselect,[on|off] scttempint,N[,p] : smartctl -t /dev/sda
34) What is the difference between ext2 vs ext3 vs ext4?
http://www.thegeekstuff.com/2011/05/ext2-ext3-ext4/
35) Disable ping to avoid network/ICMP flood
Set following in /etc/sysctl.conf : net.ipv4.icmp_echo_ignore_all =1
Then sysctl -p
or
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
36) What is SYN Flood, ICMP Flood
SYN Flood : A SYN flood occurs when a host sends a flood of TCP/SYN packets, often with a
fake/forged sender address. Each of these packets is handled like a connection request, causing the
server to spawn a half-open connection, by sending back a TCP/SYN-ACK packet(Acknowledge), and
waiting for a packet in response from the sender address(response to the ACK Packet). However,
because the sender address is forged, the response never comes. These half-open connections
saturate the number of available connections the server is able to make, keeping it from responding to
legitimate requests until after the attack ends
ICMP Flood : There are three types of ICMP Flood :
1) Smurf Attack : http://en.wikipedia.org/wiki/Smurf_attack
2) Ping Flood : http://en.wikipedia.org/wiki/Ping_flood
3) Ping of Death : http://en.wikipedia.org/wiki/Ping_of_death
37) What is the difference between Unix vs Linux Kernels?
Please find below given link :
http://www.thegeekstuff.com/2012/01/linux-unix-kernel/
38) How to setup Password less remote login/ssh?
Use ssh-keygen -t dsa or rsa at local system for creating public and private keys
Then copy /root/.ssh/id_dsa.pub to remote_server by name /root/.ssh/authorized_keys
Change permissions of /root/.ssh/authorized_keys file at remote_server chmod 0600 ~/.ssh/authorized_keys
Now try to login from local system to remote_server ssh root@remote_server
39) Command to see default kernel image file
grubby default-kernel
40) How to create lvm mirror
lvcreate -L 50G -m1 -n LVMmirror vg0
41) Command to check last runlevel
who -r
42) What do you mean by File System?
File System is a method to store and organize files and directories on disk. A file system can have different formats called file system types.
These formats determine how the information is stored as files and directories.
43) What is the requirement of udev daemon?
Create and remove device nodes or files in /dev/ directory
44) What are block and character devices?
Both the devices are present in /dev directory
Block device files talks to devices block by block [1 block at a time (1 block =512 bytes to 32KB)].
Examples: USB disk, CDROM, Hard Disk (sda, sdb, sdc etc.)
Character device files talk to devices character by character.
Examples: Virtual terminals, terminals, serial modems, random numbers (tty{0,1,2,3})
45) How to Convert ext2 to ext3 File System?
tune2fs -j /dev/{device-name}
46) File required to modify for setting up kernel parameters permanent
/etc/sysctl.conf
47) Commands used to install, list and remove modules from kernel
Installing/adding a module:
insmod mod_name
modprobe mod_name
List installed modules : lsmod
Removing a module : modprobe -r mod_name
48) How to create swap using a file and delete swap
Adding swap :
dd if=/dev/zero of=/opt/myswap bs=1024 count=4
mkswap /opt/myswap
swapon -a
For adding this myswap at boot time, add following in /etc/fstab file:
/opt/myswap swap swap defaults 0 0
Deleting Swap :
Run swapoff /opt/myswap command
Remove the entry from /etc/fstab file
Remove /opt/myswap file (using rm command)
49) What vmstat show
vmstat (virtual memory statistics) is a computer system monitoring tool that collects and displays summary information about operating
system memory, processes, interrupts, paging and block I/O
50) What is tmpfs File System
Reference : http://en.wikipedia.org/wiki/Tmpfs
tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file
system, but stored in volatile memory instead of a persistent storage device. A similar construction is a RAM disk, which appears as a virtual
disk drive and hosts a disk file system.
Everything stored in tmpfs is temporary in the sense that no files will be created on the hard drive; however, swap space is used as backing
store in case of low memory situations. On reboot, everything in tmpfs will be lost.
The memory used by tmpfs grows and shrinks to accommodate the files it contains and can be swapped out to swap space.
51) What is the difference between screen and script commands?
Screen is an screen manager with VT100/ANSI terminal emulation and used to take GNU screen session remotely or locally and while Script
make typescript of terminal session
Screen : needs to be detached, should not be exited to access remotely/locally
Script : creates a file and store all the terminal output to this file
52) How can we check which process is assigned to which processor?
Ans Run ps -elFL and find out the PSR column which is showing the processor number to the process
53) How can we check vendor, version, release date, size, package information etc of any installed rpm?

rpm -qi package-name , for example:
rpm -qi ypbind-1.19-12.el5

You might also like