Something Different In Linux

Home » indianwebportal » linux system administrator interview questions and answers

linux system administrator interview questions and answers

Posted by indianwebportal indianwebportal Categories: indianwebportal

1. How to check Gateway and net mask??
Ans. netstat -ar

2. RSYNC command executed, got error while copying, again the command initiated, whether the file copies from 1st and incremental.
Ans:- The rsync command is incremental copy(check the files with destination and copies rest of the part).

3. In RAID 5, two disks are corrupted what to do ?
Ans:- In RAID 5 , if one disk is corrupted , we can replace that effective drive without any downtime. But here the scenario is two disks are corrupted , in this case we don’t have much option left. Need to replace all the effective disks and rebuild the OS. If we kept two spare hard disk while creating RAID , the situation will be different.

4.what is hard and soft mounting?

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 timeout, will affect system performance, and you cannot interrupt them.

Soft mount

— If the NFS file system is soft mounted, NFS will try repeatedly to contact the server until either:
A connection is established

The NFS retry threshold is met

The nfs timeout value is reached

When one of these events occurs, control returns to the calling program.

5.what is /proc file system ?

Ans. procfs (or the proc file system is a special file system in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.

6.what is daemon responsible for tracking events in a server?
Ans. syslogd

7.what is difference between raid 0 and raid 1?
Ans. RAID 0, No redundancy
RAID 1, Redundancy

8.what is kernel panic?
Ans. A kernel panic is an action taken by an operating system upon detecting an internal fatal error from which it cannot safely recover. The term is largely specific to Unix and Unix-like systems; for Microsoft Windows operating systems the equivalent term is “bug check” (or “Blue Screen of Death”).

9.what is ‘0’ process?
Ans. parent process id of ‘init’ (sched process)

10.what is the last service started by init before logging screen appears?
Ans. /etc/rc.local which are the last commands run in initialization process or even booting process

11.difference between LILO &GRUB?
Ans. LILO, Linux Loader, on kernel versions = 2.6, supports booting from network.

12.Stages of boot loader?
Ans.6 stages.

2. MBR
4. Kernel
5. Init
6. Runlevels

13.when two machines are there, one machine MAC & IP address is known, another machine MAC address is there, how to find IP of another machine using command?

Ans. ‘arp’ command

14.while ‘ping’ cmd is used the system not receiving any o/p?
Ans. ping cmd is blocked in kernel parameters

ping cmd uses icmp protocol.

15.Issue is there with hard drives ,dont know which drive is fault. how to check which drive is fault?

Ans. If it is HP and IBM Servers, it will show amber color for faulty HDD. otherwise we can see the status of the hard disks in ILO (Integrated Lights Out)configuration for HP servers and the same remote accessing feature also available for IBM. otherwise you can check in dmesg .

16.In production server one drive got failed,how to replace new drive?
Ans. plug and play devices, in raid -1 mirror is used machine can run with one hard disk . we can replace


18. What is Network bonding? Requirements for bonding?
Ans. N/w Bonding will configure on the servers for redundancy. It requires minimum 2 Ethernet Ports/Cards.

19. MI means?

Ans. Major Incident

20. Different mount options apart from mount command?
Ans. crazy question, i will say /bin/mount., But it is mount command full form. I heard guestmount command also there to mount a disk …but didn’t used yet. to start services apart from ‘service’ cmd?
Ans. /ect/init.d/ start to display memory info?
Ans. cat /proc/meminfo

free -go (To see in GB) to display hardware information?
Ans. dmidecode |less

Command: lscpu

List available cpus and their characteristics , Not available on older distribution

Command: lshal

Require HAL (Hardware Abstraction Layer) to be installed . List all hardware visible by HAL

Command: lshw

Available on Debian and Ubuntu based distributions by default .Available in the Fedora repositories .Uses many inputs to detect all hardware: Kernel, HAL, DMI, etc. use ‘-html’ switch that generates hardware reports

Command: lspci

Standard command ,List all hardware connected to the PCI bus as detected by the kernel

Command: lsusb

Standard command. List all hardware connected to the USB buses as detected by the kernel

Command: dmidecode

Standard command, Get the source information from the DMI (a kind of BIOS interface) .List all hardware as reported by the DMI interface

25. command to check the directory’s partition or mount ?

Ans. df -P file/goes/here | tail -1 | cut -d’ ‘ -f 1 to rollback application?

Ans. insert ‘ts_flags=repackage’ in /etc/yum.conf and create file /etc/rpm/macros with an entry’repackage’ parameter. to rollback filesystem?
Ans. If ‘Snapshot'(backup) is taken, using superblocks we can rollback file system.

28. Newly attached hard drive is not recognizing how to make it active ?
Ans. After building server with 2 hard disks, again if we attach any hdd, server wont recognizes it. if the server want to recognize it, we need to reboot it and create RIAD fo that HDD also.

If we replaced Faulty hard disk with new one, Server will take 1 ohr time t synchronize the data (RIAD 1 and RAID 5).

29.Different raid levels & explanation?
Ans. raid 0, raid1, raid1+0, raid 1+0, raid3, raid 5, raid50, raid6.

30.file system is full? user need some space to run his work ?
Ans. 1. If it is configured with ‘lvm’ we can extend it, or else we can make use of reserved blocks.
2. Delete the old files after getting confirmation from user.

31. How to check a package is installed or not?
Ans. rpm -qa | grep , it will gives package name and version, if it installed, returns empty screen if not installed. to check which ports are working?
Ans. netstat cmd to configure static route?
Ans. vi /etc/sysconfig/network-scripts/ifcfg-route0

34. How to check the processor type ?
Ans. grep “model name” /proc/cpuinfo

35.what is GRUB?
Ans. Grand unified Boot loader. Its boot loader in linux. (kernel versions >=2.6) to check with hard drives ?
Ans. df or mount

37.difference between rpm and yum ?
1] What Is RPM?Redhat Package Manager, shortly known as RPM is like setup file, somewhat similar to “.exe” files we have in Windows. RPM files are the packages which will install the program in your computer. While commands are very basic and simple to install and uninstall the program, it sometime gets difficult to actually find the links to download these RPM (Linux is as user friendly as a computer can get). 2] What Is YUM?Yellowdog Updater Modified, shortly known as YUM is like a Library which has all the RPMs indexed in it. Since we’re using Linux, we’re cool, we don’t want to waste our time finding the setup files. Hence, we have an entire Library that already has all the RPMs indexed in it. All we need to do is execute the command “yum install package” where package is the software you’re looking to install. Isn’t it cool? No need to Google around to find your programs. YUM is somewhat like Google for Linux programs. You can even search the possible software with commands like “yum list package” “yum search package” etc.Hence, you can not possibly find any DIFFERENCE between RPM and YUM because they are NOT competitors. They work with each other. You would most likely end up using YUM in order to install, uninstall the programs. In case YUM doesn’t have your program indexed, then you will need to download the RPM package from the internet in order to install it.
38.How to increase physical memory in steps?
Ans. Hard ware Part, Need to get down time form the users or customers , upagrde the memeory . (memory size should be match with old memory modules.)

40.kernel patching?
Ans. to mount alternate superblock command?
Ans. mount sb=alternative superblock /dev/sda to create a never expire passwd for user?
Ans. chage -E -1 username

43.tune2fs command used for ?

Ans. for tuning the filesystem parameters

44.In samba share directory is sharing, everything is access apart from soft link files ,how to share those soft links shares?
Ans. Apply parameters in share definition
follow symlinks =yes
wide links =yes

46.what is the way to set dump and fsck options in /etc/fstab?

47.maximum file grow in ext4 filesystem?

48.difference between linear and mirror volumes?

# df -h
……………. file system full
#ls -l
two files…..1. one file is occupying full space
# rm -f filename
#df -h
same output …file system is full
#ls -l
file is not there ..still file system is full.
# lsof | grep “(deleted)” # (or lsof | grep (filename))

If it’s safe to do so, take the pid from the lsof command, and do:

# ls -l /proc/(pid)/fd # to get the fd# for the file
# > /proc/(pid)/fd/(fd#) # to empty the file.

Otherwise the space will be freed when the application using it closes, or the system restarts.

# implies a root prompt, meaning your sysadmin needs to do this.

(S)he will need to install lsof if it’s not already installed.

50.what is webstack? how to improve performance and bottlenecks?


51. No such file or directory error?
Ans. ls -ld , error, no such file or directory..

Reasons: Check it , by logging as a root. might be normal user not having the permissions to view it.
we will get it, if the directory or file is unmounted or deleted. to check database and other applications running?
Ans. ps -ef | grep

53.mpstat, iostat,vmstat statistics define?
1. iostat – Basic example

Iostat without any argument displays information about the CPU usage, and I/O statistics about all the partitions on the system as shown below.

Linux 2.6.32-100.28.5.el6.x86_64 (dev-db) 07/09/2013

avg-cpu: %user %nice %system %iowait %steal %idle
5.68 0.00 0.52 2.03 0.00 91.76

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 194.72 1096.66 1598.70 2719068704 3963827344
sda1 178.20 773.45 1329.09 1917686794 3295354888
sda2 16.51 323.19 269.61 801326686 668472456

vmstat : vmstat by default will display the memory usage (including swap) as shown below.


procs ———–memory———- —swap– —–io—- –system– —–cpu——
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 305416 260688 29160 2356920 2 2 4 1 0 0 6 1 92 2 0

Procs – r: Total number of processes waiting to run
Procs – b: Total number of busy processes
Memory – swpd: Used virtual memory
Memory – free: Free virtual memory
Memory – buff: Memory used as buffers
Memory – cache: Memory used as cache.
Swap – si: Memory swapped from disk (for every second)
Swap – so: Memory swapped to disk (for every second)
IO – bi: Blocks in. i.e blocks received from device (for every second)
IO – bo: Blocks out. i.e blocks sent to the device (for every second)
System – in: Interrupts per second
System – cs: Context switches
CPU – us, sy, id, wa, st: CPU user time, system time, idle time, wait time

Mpstat – Display basic info

By default mpstat displays CPU statistics. to list newly attached hardware?
Ans. dmidecode | less

55.In RAID , statistics display “_U” .what is the meaning?
Ans. MeAns one of the hard disk is failed.

56.what is initrd? what it does?
Ans. 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 parts of the server.

58.where /proc file system rests?
Ans. Linux systems store all data as files. Most users are familiar with the two primary types of files: text and binary. But the /proc/ directory contains another type of file called a virtual file. As such, /proc/ is often referred to as a virtual file system.

59.where tmpfs stores?
Ans. Tmpfs is a file system which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. If you unmount a tmpfs instance, everything stored therein is lost. tmpfs lives completely in the page cache and on swap, all tmpfs pages currently in memory will show up as cached

60.Daemons in nfs?
Ans. mountd ,nfsd,lockd,statd,nfslogd to change user access to entire file system?
Ans. chown -R

62.why UMASK is used, where to change its value to be effective on entire OS?
Ans. When user create a file or directory under Linux or UNIX, it creates with a default set of permissions. In most case the system defaults may be open or relaxed for file sharing purpose. For example, if a text file has 666 permissions, it grants read and write permission to everyone. Similarly a directory with 777 permissions, grants read, write, and execute permission to everyone.

You can setup umask in /etc/bashrc or /etc/profile file for all users. By default most Linux machines set it to 0022 (022) or 0002 (002).
Open /etc/profile or ~/.bashrc file, enter:
# vi /etc/profile


# vi ~/.bashrc

Append/modify following line to setup a new umask:

umask 022

Save and close the file. Changes will take effect after next login. All UNIX users can override the system umask defaults in their /etc/profile file, ~/.profile (Korn / Bourne shell) ~/.cshrc file (C shells), ~/.bash_profile (Bash shell) or ~/.login file (defines the user’s environment at login). to display the list of specific port ?
Ans. netstat -ntlp | grep

68.what is SFTP? file transfer protocol, a network protocol for secure file transfer over a secure shell.

69.Top responding slowly..other option to check load average?
Ans. vmstat

71.Difference between crontab and at ?
list crontab entry?
Ans.Cron command is used to schedule the task daily at the same time repeatedly ,
“at” command is used to schedule the task only once i.e to run only one time

Crontab -l
72.what is MTA?
Ans. Mail Transfer Agent

73.while install rpm package, progress reports already use , but no package name doesn’t exist in rpm list ?
Ans. rpm –reinstall

74.create user in different directory?
Ans.useradd -m -d /newdir/ username

75.What is Linux and why is it so popular?
Ans. – Linux is an operating system that uses UNIX like Operating system…….

76.What is LILO?
Ans. – LILO is Linux Loader is a bootloader for Linux. It is used to load Linux into the memory and start the Operating system…….

77.What is the difference between home directory and working directory?
Ans. – A home directory is where you start when you open a shell. The working directory is where you are right now. You can usually go directly to the home directory with the command cd and you can find out what the working directory is with pwd.
78.What is the difference between internal and external commands?
Ans. – Internal commands are commands that are already loaded in the system. They can be executed any time and are independent. On the other hand, external commands are loaded when the user requests for them. Internal commands don’t require a separate process to execute them. External commands will have an individual process.
79. Explain the difference between a static library and a dynamic library.
Ans. – Static libraries are loaded when the program is compiled and dynamically-linked libraries are loaded in while the program is running. Dynamic libraries save the RAM space as against the static library because linking to static libraries includes the actual code for the library function(s)/procedure(s) with the executable. DLL code is kept at one location and is usually shared among all the processes that use the DLL.
Ans. – LD_LIBRARY_PATH is an environment variable. This is used to search for the shared objects / dynamic libraries by the operating system for extendable functionality at runtime.

81.What is the file server in Linux server?
Ans. – File server is used for file sharing. It enables the processes required for sharing…….

82.What is NFS? What is its purpose?
Ans. – NFS is Network File system. It is a file system used for sharing of files over a network…….

83.Explain RPM (Red Hat Package Manager) features.
Ans. – RPM is a package managing system (collection of tools to manage software packages)…….

84.What is Kernel? Explain the task it performs.
Ans. – Kernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well.
Kernel Activities:
The Kernel task manager allows tasks to run concurrently.
Managing the computer resources: Kernel allows the other programs to run and use the resources. Resources include i/o devices, CPU, memory.
Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask.
Kernel has an access to the systems memory and allows the processes to access the memory when required.
Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so.
For the processes to access and make use of these services, system calls are used.

85.What is Linux Shell? What is Shell Script?
Ans. – Linux shell is a user interface used for executing the commands. Shell: A Command-Line Interpreter that connects a user to Operating System and allows to execute the commands or by creating text script.

86.What are Pipes? Explain use of pipes.
Ans. – A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP.
e.g. sort file | lpr ( sort the file and send it to printer)

87.Explain trap command; shift Command, getopts command of linux.
Ans. – Trap command: controls the action to be taken by the shell when a signal is received.
Trap [OPTIONS] [ [arg] signspec..]
Arg is the action to be taken or executed on receiving a signal specified in signspec.
e.g. trap “rm $FILE; exit” // exit (signal) and remove file (action)
Shift Command: Using shift command, command line arguments can be accessed. The command causes the positional parameters shift to the left. Shift [n] where n defaults to 1. It is useful when several parameters need to be tested.
Getopts command: this command is used to parse arguments passed. It examines the next command line argument and determines whether it is a valid option
Getopts {optstring} {variable1}. Here, optsring contains letters to be recognized if a letter is followed by a colon, an argument should be specified. E.g (whether the argument begins with a minus sign and is followed by any single letter contained inside options ) If not, diagnostic messages are shown. It is usually executed inside a loop.

88.What Stateless Linux server? What feature it offers?
Ans. – A stateless Linux server is a centralized server in which no state exists on the single workstations. There may be scenarios when a state of a particular system is meaningful (A snap shot is taken then) and the user wants all the other machines to be in that state. This is where the stateless Linux server comes into picture.

89.What does nslookup do? Explain its two modes.
Ans. – Nslookup is used to find details related to a Domain name server. Details like IP addresses of a machine, MX records, servers etc. It sends a domain name query packet to the corresponding DNS.
Nslookup has two modes. Interactive and non interactive. Interactive mode allows the user to interact by querying information about different hosts and domains.
Non interactive mode is used to fetch information about the specified host or domain.
Interactive mode:
Nslookup [options] [server]

90.What is Bash Shell?
Ans. – Bash is a free shell for UNIX. It is the default shell for most UNIX systems. It has a combination of the C and Korn shell features. ……
91.Explain some Network-Monitoring Tools in Linux: ping, traceroute, tcpdump, ntop
Ans. – Network monitoring tools are used to monitor the network, systems present on the network, traffic etc.
Ping: Ping command is used to check if the system is in the network or not. To check if the host is operating.
e.g. ping ip_address
When the command is executed, it returns a detailed summary of the host. Packets sent, received, lost by estimating the round trip time.
Traceroute: the command is used to trace the path taken by the packet across a network. Tracing the path here means finding out the hosts visited by the packet to reach its destination. This information is useful in debugging. Roundtrip time in ms is shown for every visit to a host.
Tcpdump: commonly used to monitor network traffic. Tcdump captures and displays packet headers and matching them against criteria or all. It interprets Boolean operators and accepts host names, ip address, network names as arguments.
Ntop: Network top shows the network usage. It displays summary of network usage by machines on the network in a format as of UNIX top utility. It can also be run in web mode, which allows the display to be browsed with a web browser. It can display network traffic statistics, identify host etc. Interfaces are available to view such information.

92.What are the process states in Linux?
Ans. – Process states in Linux:
Running: Process is either running or ready to run
Interruptible: a Blocked state of a process and waiting for an event or signal from another process
Uninterruptible: a blocked state. Process waits for a hardware condition and cannot handle any signal
Stopped: Process is stopped or halted and can be restarted by some other process
Zombie: process terminated, but information is still there in the process table.

93.What is a zombie?
Ans. – 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. Having a zombie process listed in your ps output is not a bad thing, necessarily. It’s usually being kept around in the process table because the parent process may still need to read the exit status of the child process.

94.Explain each system calls used for process management in linux.
Ans. – System calls used for Process management:
Fork () :- Used to create a new process
Exec() :- Execute a new program
Wait():- wait until the process finishes execution
Exit():- Exit from the process
Getpid():- get the unique process id of the process
Getppid():- get the parent process unique id
Nice():- to bias the existing property of process
95.Which command is used to check the number of files and disk space used and the each user’s defined quota?
Ans. repquota command is used to check the status of the user’s quota along with the disk space and number of files used. This command gives a summary of the user’s quota that how much space and files are left for the user. Every user has a defined quota in Linux. This is done mainly for the security, as some users have only limited access to files. This provides a security to the files from unwanted access. The quota can be given to a single user or to a group of users.

96.What is the name and path of the main system log?

Ans. By default the main system log is /var/log/messages. This file contains all the messages and the script written by the user. By default all scripts are saved in this file. This is the standard system log file, which contains messages from all system software, non-kernel boot issues, and messages that go to ‘dmesg’. dmesg is a system file that is written upon system boot.

97.How secured is Linux? Explain.
Ans. Security is the most important aspect of an operating system. Due to its unique authentication module, Linux is considered as more secured than other operating systems. Linux consists of PAM. PAM is Pluggable Authentication Modules. It provides a layer between applications and actual authentication mechanism. It is a library of loadable modules which are called by the application for authentication. It also allows the administrator to control when a user can log in. All PAM applications are configured in the directory “/etc/pam.d” or in a file “/etc/pam.conf”. PAM is controlled using the configuration file or the configuration directory.

98.Can Linux computer be made a router so that several machines may share a single Internet connection? How?
Ans. Yes a Linux machine can be made a router. This is called “IP Masquerade.” IP Masquerade is a networking function in Linux similar to the one-to-many (1: Many) NAT (Network Address Translation) servers found in many commercial firewalls and network routers. The IP Masquerade feature allows other “internal” computers connected to this Linux box (via PPP, Ethernet, etc.) to also reach the Internet as well. Linux IP Masquerading allows this functionality even if the internal computers do not have IP addresses.
The IP masquerading can be done by the following steps:

1. The Linux PC must have an internet connection and a connection to LAN. Typically, the Linux PC has two network interfaces-an Ethernet card for the LAN and a dial-up PPP connection to the Internet (through an ISP).

2. All other systems on your LAN use the Linux PC as the default gateway for TCP/IP networking. Use the same ISP-provided DNS addresses on all systems.

3. Enable IP forwarding in the kernel. By default the IP forwarding is not enabled. To ensure that IP forwarding is enabled when you reboot your system, place this command in the /etc/rc.d/rc.local file.

4. Run /sbin/iptables-the IP packet filter administration program-to set up the rules that enable the Linux PC to masquerade for your LAN.

99.What is the minimum number of partitions you need to install Linux?
Ans. Minimum 2 partitions are needed for installing Linux. The one is / or root which contains all the files and the other is swap. Linux file system is function specific which means that files and folders are organized according to their functionality. For example, all executables are in one folder, all devices in another, all libraries in another and so on. / or ‘root’ is the base of this file system. All the other folders are under this one. / can be consider as C: .Swap is a partition that will be used as virtual memory. If there is no more available RAM a Linux computer will use an area of the hard disk, called swap, to temporarily store data. In other words it is a way of expanding your computers RAM.

100.Which command is used to review boot messages?
Ans. dmesg command is used to review boot messages. This command will display system messages contained in the kernel ring buffer. We can use this command immediately after booting to see boot messages. A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it. Its basic syntax is

dmesg [options]

Invoking dmesg without any of its options causes it to write all the kernel messages to standard output. This usually produces far too many lines to fit into the display screen all at once, and thus only the final messages are visible. However, the output can be redirected to the less command through the use of a pipe, thereby allowing the startup messages to be viewed on one screen at a time
dmesg | less

101. Which utility is used to make automate rotation of a log?
Ans. logrotate command is used to make automate rotation of log.
Syntax of the command is:
logrotate [-dv] [-f|] [-s|] config_file+
It allows automatic rotation, compression, removal, and mailing of log files. This command is mainly used for rotating and compressing log files. This job is done every day when a log file becomes too large. This command can also be run by giving on command line. We can done force rotation by giving –f option with this command in command line. This command is also used for mailing. We can give –m option for mailing with this command. This option takes two arguments one is subject and other is recipient name.

102.What are the partitions created on the mail server hard drive?
Ans. The main partitions are done firstly which are root, swap and boot partition. But for the mail server three different partitions are also done which are as follows:
1. /var/spool- This is done so that if something goes wrong with the mail server or spool than the output cannot overrun the file system.
2. /tmp- putting this on its own partition prevents any user item or software from overrunning the system files.
3. /home- putting this on its own is useful for system upgrades or reinstalls. It allow not to wipe off the /home hierarchy along with other areas.

103.What are the fields in the/etc/passwd file?
Ans. It contains all the information of the users who log into the system. It contains a list of the system’s accounts, giving for each account some useful information like user ID, group ID, home directory, shell, etc. It should have general read permission as many utilities, like ls use it to map user IDs to user names, but write access only for the superuser (root). The main fields of /etc/passwd file are:
1. Username: It is used when user logs in. It should be between 1 and 32 characters in length.
2. Password: An x character indicates that encrypted password is stored in /etc/shadow file.
3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.
4. Group ID (GID): The primary group ID (stored in /etc/group file)
5. User ID Info: The comment field. It allow you to add extra information about the users such as user’s full name, phone number etc. This field use by finger command.
6. Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /
7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell.

104.Which commands are used to set a processor-intensive job to use less CPU time?
Ans. nice command is used for changing priority of the jobs.
Syntax: nice [OPTION] [COMMAND [ARG]…]
Range of priority goes from -20 (highest priority) to 19 (lowest).Priority is given to a job so that the most important job is executed first by the kernel and then the other least important jobs. This takes less CPU times as the jobs are scheduled and are given priorities so the CPU executes fast. The priority is given by numbers like -20 describe the highest priority and 19 describe the least priority.

105.How to change window manager by editing your home directory?
Ans. /.xinitrc file allows changing the window manager we want to use when logging into X from that account. The dot in the file name shows you that the file is a hidden file and doesn’t show when you do a normal directory listing. For setting a window manager we have to save a command in this file. The syntax of command is: exec windowmanager.After this, save the file. Next time when you run a startx a new window manager will open and become default. The commands for starting some popular window managers and desktop environments are:
-KDE = startkde
-Gnome = gnome-session
-Blackbox = blackbox
-FVWM = fvwm
-Window Maker = wmaker
-IceWM = icewm

106.How documentation of an application is stored?
Ans. when a new application is installed its documentation is also installed. This documentation is stored under the directory named for application. For example if my application name is App1 then the path of the documentation will be /user/doc/App1. It contains all the information about the application. It contains date of creating application, name of application and other important module of the application. We can get the basic information of application from the documentation.

107.How shadow passwords are given?
Ans. pwconv command is used for giving shadow passwords. Shadow passwords are given for better system security. The pwconv command creates the file /etc/shadow and changes all passwords to ‘x’ in the /etc/passwd file. First, entries in the shadowed file which don’t exist in the main file are removed. Then, shadowed entries which don’t have `x’ as the password in the main file are updated. Any missing shadowed entries are added. Finally, passwords in the main file are replaced with `x’. These programs can be used for initial conversion as well to update the shadowed file if the main file is edited by hand.

108.How do you create a new user account?
Ans. useradd command is used for creating a new user account. When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. The new user account will be entered into the system files as needed, and initial files copied, depending on the command line options. This command uses the system default as home directory. If –m option is given then the home directory is made.
109.Which password package is installed for the security of central password?
Ans. Shadow password packages are used for security of central passwords. Security is the most important aspect of every operating system. When this package is not installed the user information including passwords is stored in the /etc/passwd file. The password is stored in an encoded format. These encoded forms can be easily identified by the System crackers by randomly encoding the passwords from dictionaries. The Shadow Package solves the problem by relocating the passwords to another file (usually /etc/shadow). The /etc/shadow file is set so that it cannot be read by just anyone. Only root will be able to read and write to the /etc/shadow file.

110.Which shell do you assign to a POP3 mail-only account?
Ans. POP3 mail only account is assigned to the /bin/false shell. However, assigning bash shell to a POP3 mail only gives user login access, which is avoided. /bin/nologin can also be used. This shell is provided to the user when we don’t want to give shell access to the user. The user cannot access the shell and it reject shell login on the server like on telnet. It is mainly for the security of the shells. POP3 is basically used for downloading mail to mail program. So for illegal downloading of emails on the shell this account is assigned to the /bin/false shell or /bin/nologin. These both shells are same they both do the same work of rejecting the user login to the shell. The main difference between these two shells is that false shell shows the incorrect code and any unusual coding when user login with it. But the nologin shell simply tells that no such account is available. So nologin shell is used mostly in Linux.

111.Which daemon is responsible for tracking events on Linux system?
Ans. syslogd is responsible for tracking system information and save it to the desired log files. It provides two system utilities which provide system logging and kernel message trapping. Internet and UNIX domain sockets support enable this utility package to support both local and remote logging. Every logged message contains at least a time and a hostname field, normally a program name field, too. So to track these information this daemon is used. syslogd mainly reacts to the set of signals given by the user. These are the signals given to syslogd: SIGHUP: This lets syslogd perform a re-initialization. All open files are closed, the configuration file (default is /etc/syslog.conf) will be reread and the syslog facility is started again. SIGTERM: The syslogd will die. SIGINT, SIGQUIT: If debugging is enabled these are ignored, otherwise syslogd will die. SIGUSR1: Switch debugging on/off. This option can only be used if syslogd is started with the – d debug option. SIGCHLD: Wait for Childs if some were born, because of waiting messages.

112.Which daemon is used for scheduling of the commands?
Ans. The crontab command is used for scheduling of the commands to run at a later time. SYNTAX
crontab [ -u user ] file
crontab [ -u user ] { -l | -r | -e }

-l List – display the current crontab entries.

-r Remove the current crontab.

-e Edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables.
When user exits from the editor, the modified crontab will be installed automatically. Each user can have their own crontab, and though these are files in /var, they are not intended to be edited directly. If the –u option is given than the crontab gives the name of the user whose crontab is to be tweaked. If it is given without this then it will display the crontab of the user who is executing the command.

113 .How environment variable is set so that the file permission can be automatically set to the newly created files?
Ans. umask command is used to set file permission on newly created files automatically.
umask [-p] [-S] [mode]
It is represented in octal numbers. We can simply use this command without arguments to see the current file permissions. To change the permissions, mode is given in the arguments. The default umask used for normal user is 0002. The default umask for the root user is 0022. For calculating the original values, the values shown by the umask must be subtracted by the default values. It is mainly used for masking of the file and directory permission. The /etc/profile script is where the umask command is usually set for all users. The –S option can be used to see the current default permissions displayed in the alpha symbolic format.
For example, umask 022 ensures that new files will have at most 755 permissions (777 NAND 022).
The permissions can be calculated by taking the NAND of original value with the default values of files and directories.

114. When do you need a virtual hosting ?
Ans. The term Virtual Host refers to the practice of maintaining more than one server on one machine, as differentiated by their apparent hostname. For example, it is often desirable for companies sharing a web server to have their own domains, with web servers accessible as and, without requiring the user to know any extra path information.

115. In which port telnet is listening?
Ans. 23

116.How to block and openrelay ?
Ans. Open relays are e-mail servers that are configured to accept and transfer e-mail on behalf of any user anywhere, including unrelated third parties.
The qmail-smtpd daemon will consult the rcpthosts control file to determine valid destination addresses, and reject anything else.
117. What is sandwitch configuration in qmail ?
Ans. Qmail + Clam + Spamassassin- This is normally called Sandwitch configuration in qmail.

118. Advantages of Qmail ?
Ans. More secure, better designed, modular, faster, more reliable, easier to configure, don’t have to upgrade it every few months or worry about being vulnerable to something due to some obscure feature being enabled
qmail supports host and user masquerading, full host hiding, virtual domains, null clients, list-owner rewriting, relay control, double-bounce recording, arbitrary RFC 822 address lists, cross-host mailing list loop detection, per-recipient checkpointing, downed host backoffs, independent message retry schedules, etc. qmail also includes a drop-in “sendmail” wrapper so that it will be used transparently by your current UAs.

119. What is the difference between POP3 and IMAP ?
Ans. The Difference
POP3 works by reviewing the inbox on the mail server, and downloading the new messages to your computer. IMAP downloads the headers of the new messages on the server, then retrieves the message you want to read when you click on it.
When using POP3, your mail is stored on your PC. When using IMAP, the mail is stored on the mail server. Unless you copy a message to a “Local Folder” the messages are never copied to your PC.
Scenarios of Use
• You only check e-mail from one computer.
• You want to remove your e-mail from the mail server.
• You check e-mail from multiple locations.
• You use Webmail.

120. How to drop packets using iptables ?
Ans. Iptables -A INPUT -s xx.xx.xx.xx -d xx.xx.xx.xx -j DROP

121. Daily routines of Linux Administrators ?
Ans. *.Check the health of servers
*.Check for updates
*.Check the Backup
*.Check with the trouble ticketing system for any unread ticket.
*.Troubleshoot if there any problem
*.Installation of new servers, if needed.
*.Report to the Boss

122. How to take the Dump of a MySQL Database ?
Ans. Mysqldump databasename > dumpname

123. How to know the CPU usage of each process ?
Ans. Top, uptime

124. How to bind another IP in a NIC ?
Ans. Copy the contents eth0 to eth1, and change the ipaddress. Restart the network. .

125. Transparently proxy all web-surfing through Squid box
Ans. iptables -t nat -A PREROUTING -i eth1 -tcp –dport 80 -j DNAT –to
iptables -t nat -A PREROUTING -i eth1 -tcp –dport 80 -j DNAT –to

126. Transparently redirect web connections from outside to the DMZ web server.
Ans. iptables -t nat -A PREROUTING -i eth0 -d -dport 80 -j DNAT –to

127. Howto Activate the forwarding
Ans. echo 1 >/proc/sys/net/ipv4/ip_forward

128.Kill spoofed packets
Ans. for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 > $f
$iptables -A LDROP –proto tcp -j LOG –log-level info \ –log-prefix “TCP Drop”

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...