Most Significant Linux Administrator Interview Questions
Q – 1 How to change the default run level in linux?
Ans- To change the run level we have to edit the file “/etc/inittab” and change initdefault entry ( id:5:initdefault:). Using ‘init’ command we change the run level temporary like ‘init 3′ , this command will move the system in runlevl 3.
Q – 2 How to set umask permanently for a user?
Ans- To set this value permanently for a user, it has to be put in the appropriate profile file which depends on the default shell of the user.
Q – 3 What is umask?
Ans- umask stands for ‘User file creation mask’, which determines the settings of a mask that controls which file permissions are set for files and directories when they are created.
Q – 4 Where kernel modules are located?
Ans- The ‘/lib/modules/kernel-version/’ directory stores all kernel modules or compiled drivers in Linux operating system. Also with ‘lsmod’ command we can see all the installed kernel modules.
Q – 5 How to create partition from the raw disk?
Ans- Using fdisk utility we can create partitions from the raw disk.
Below are the steps to create partition from the raw dsik :
☛ fdisk /dev/hd* (IDE) or /dev/sd* (SCSI)
☛ Type n to create a new partition
☛ After creating partition , type w command to write the changes to the partition table.
Q – 6 How to reduce or shrink the size of LVM partition?
Ans- The logical Steps to reduce size of LVM partition :
☛ Umount the filesystem using umount command,
☛ use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G
☛ Now use the lvreduce command , e.g lvreduce -L 10G /dev/mapper/myvg-mylv
Above Command will shrink the size & will make the filesystem size 10GB.
Q – 7 How to increase the size of LVM partition?
Ans- ☛ Use the lvextend command (lvextend -L +100M /dev/ , in this example we are extending the size by 100MB.
☛ resize2fs /dev/
☛ check the size of partition using ‘df -h’ command
Q – 8 Tell me what does Sar provides and at which location Sar logs are stored?
Ans- Sar Collect, report, or save system activity information. The default version of the sar command (CPU utilization report) might be one of the first facilities the user runs to begin system activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound.
Q – 9 How To check memory stats and CPU stats in Linux?
Ans- Using ‘free’ & ‘vmstat’ command we can display the physical and virtual memory statistics respectively.With the help of ‘sar’ command we see the CPU utilization & other stats.
Q – 10 Why LVM is required in Linux?
Ans- LVM stands for Logical Volume Manager, to re-size filesystem’s size online we required LVM partition in Linux. Size of LVM partition can be extended and reduced using the lvextend & lvreduce commands respectively.
Q – 11 How to share a directory using nfs?
Ans- To share a directory using nfs , first edit the configuration file ‘/etc/exportfs’ , add a entry like
‘/ (Options)’ and then restart the nfs service.
Q – 12 How to check and mount nfs share?
Ans- Using ‘showmount’ command we can see what directories are shared via nfs e.g ‘showmount -e ‘.Using mount command we can mount the nfs share on linux machine.
Q – 13 What are the default ports used for SMTP,DNS,FTP,DHCP,SSH and squid?
Ans- Service: Port
SMTP: 25
SSH: 22
Squid: 3128
DNS: 53
FTP: 20 (data transfer) , 21 ( Connection established)
DHCP: 67/UDP(dhcp server) , 68/UDP(dhcp client)
Q – 14 Explain Network Bonding?
Ans- Network bonding is the aggregation of multiple Lan cards into a single bonded interface to provide fault tolerance and high performance. Network bonding is also known as NIC Teaming.
Q – 15 What are the different modes of network bonding in Linux?
Ans-
☛ balance-rr or 0 – round-robin mode for fault tolerance and load balancing.
☛ active-backup or 1 – Sets active-backup mode for fault tolerance.
☛ balance-xor or 2 – Sets an XOR (exclusive-or) mode for fault tolerance and load balancing.
☛ broadcast or 3 – Sets a broadcast mode for fault tolerance. All transmissions are sent on all slave interfaces.
☛ 802.3ad or 4 – Sets an IEEE 802.3ad dynamic link aggregation mode. Creates aggregation groups that share the same speed & duplex settings.
☛ balance-tlb or 5 – Sets a Transmit Load Balancing (TLB) mode for fault tolerance & load balancing.
☛ balance-alb or 6 – Sets an Active Load Balancing (ALB) mode for fault tolerance & load balancing.
Q – 16 How to check and verify the status the bond interface?
Ans- By using the command ‘cat /proc/net/bonding/bond0′ , we can check which mode is enabled and what lan cards are used in this bond. In this example we have one only one bond interface but we can have multiple bond interface like bond1,bond2 and so on.
Q – 17 How to check default route and routing table?
Ans- By using the Commands ‘netstat -nr’ and ‘route -n’ we can see the default route and routing tables.
Q – 18 How to check which ports are listening in my Linux Server?
Ans- Use the Command ‘netstat -listen’ and ‘lsof -i’
Q – 19 Which services are enabled at a particular run level in linux server?
Ans- With the help of command ‘chkconfig -list | grep 5:on’ we can list all the service that are enabled in run level5. For other run levels just replace 5 with the respective run level.
Q – 20 How to enable a service at a particular run level?
Ans- We can enable a service using the Command ‘chkconfig on -level 3′
Q – 21 How to upgrade Kernel in Linux?
Ans- We should never upgrade Linux Kernel , always install the new New kernel using rpm command because upgrading a kenel can make your linux box in a unbootable state.
Q – 22 How to scan newly asssigned luns on linux box without rebooting?
Ans- There are two ways to scan newly assigned luns :
Method 1: if sg3 rpm is installed , then run the command ‘rescan-scsi-bus.sh’
Method 2: Run the Command , echo ” – – – ” > /sys/class/scsi_host/hostX/scan
Q – 23 How we find WWN numbers of HBA cards in Linux Server?
Ans- We can find the WWN numbers of HBA cards using the command ‘systool -c fc_host -v | grep port_name’
Q – 24 How to add & change the Kernel parameters?
Ans- To Set the kernel parameters in linux , first edit the file ‘/etc/sysctl.conf’ after making the changes save the file and run the command ‘sysctl -p’ , this command will make the changes permanently without rebooting the machine.
Q – 25 Explain Puppet Server?
Ans- Puppet is an open-source & enterprise software for configuration management toll in UNIX like operating system. Puppet is a IT automation software used to push configuration to its clients (puppet agents) using code. Puppet code can do a variety of tasks from installing new software, to check file permissions, or updating user accounts & lots of other tasks.
Q – 26 Define manifests in Puppet?
Ans- Manifests, in Puppet, are the files in which the client configuration is specified.
Q – 27 Which command is used to sign requested certificates in Puppet Server?
Ans- puppetca -sign hostname-of-agent’ in (2.X) & ‘puppet ca sign hostname-of-agent’ in (3.X)
Q – 28 Which location puppet master stores certificates?
Ans- /var/lib/puppet/ssl/ca/signed
Q – 29 How to find all the regular files in a directory?
Ans- By using the command ‘find /
Q – 30 Explain load average in linux?
Ans- Load Average is defined as the average sum of the number of process waiting in the run queue and number of process currently executing over the period of 1,5 and 15 minutes. Using the ‘top’ and ‘uptime’ command we find the load average of a linux sever.
Q – 31 What is Minix?
Ans- Minix is the UNIX clone written by Andrew Tanenbaum at VU University, in Amsterdam when universities were no longer allowed access to the UNIX source code. MINIX also inspired the creation of the Linux kernel.
Q – 32 Do you know who posted the source code of Linux kernel on the internet and invited other programmers to modify and enhance?
Ans- In 1991 Linus Torvalds, a 21-year-old student at the University of Helsinki Finland posted the source code of Linux kernel on the Internet and invited other programmers to modify and enhance it.
Q – 33 What is POSIX?
Ans- POSIX stands for Portable Operating System Interface for Computer Environments. It is the standard for ensuring compatibility between UNIX versions.
Q – 34 Can you please explain the difference between Linux and UNIX?
Ans- Linux kernel was built to work like UNIX but doesn’t use any of the UNIX code-this is why Linux is not UNIX. A kernel is the core of any operating system.
Q – 35 Do you know who initiated the GNU project?
Ans- GNU project was initiated by Richard Stallman on 27 September 1983 at MIT. Main motive of this project was to give freedom and control in use of software’s. GNU software guarantees these freedom-rights legally via its license. Users are free to run the software, share it, copy it, distribute it, study it and modify it.
Q – 36 Do you know under which licenses Linux kernel released?
Ans- The Linux kernel is released under the GNU General Public License version 2 (GPLv2), and is developed by contributors worldwide.
Q – 37 What is the mean of GPL?
Ans- GPL stands for General Public License and it was created to protect the intent of the GNU project.
Q – 38 What platform of Linux was originally created to run on?
Ans- Linux was originally created to run on the Intel x86 platform.
Q – 39 Which Linux services provides network printing?
Ans- CUPS provide network printing between Linux systems. It can be used with Samba service to extend network printing to windows systems.
Q – 40 What Linux service is used to provide network file storage?
Ans- NFS service is used to provide file sharing.
Q – 41 Tell me which Linux service is used as a database server?
Ans- MySQL and PostgreSQL are Linux database server.
Q – 42 Tell me which Linux service is used to turn a Linux system in proxy server?
Ans- Squid service can be used to turn any Linux system into an in proxy server.
Q – 43 Tell me which components of Linux provides pre-written code that a developer can use?
Ans- Linux libraries contain pre-written code that a developer can reuse in their applications.
Your company purchased 5 new laptops. Laptop have Intel core i3 processor and Window 8 installed. Your network admin wants to install RHEL on them, but is concerned that it cannot be done because they already have Window 8 installed. Can this be done?
Yes you can install any operating system as long as the hardware is compatible. Hardware and operating systems are modular. Computer hardware is not tied in any way to a particular OS. Every OS have some minimum hardware requirements, if your hardware meets with that requirements, you can install that OS.
You are a network administrator, your company wants you to download the source code of latest Linux kernel for the developer team. Can you do this?
Source code of Linux kernel is available under the GPL license. Under the GPL, you are free to download the Linux source code and modify it.
Your company have less funds but need a reliable file server set up? Which OS and file server service can you use ?
Use Linux operating with NFS file service.
You have purchased new laptop and want to resell old one, but you don’t want to violate any licensing for OS. What can you do to avoid violating a software license?
You can install Linux OS. All major software’s for Linux are available under the GPL, those you can use without violating any software license.