Linux Interview Questions And Answers
What is LILO?
LILO is Linux Loader is a boot loader for Linux. It is used to load Linux into the memory and start the Operating system. LILO can be configured to boot other operating systems as well. LILO is customizable, which means that if the default configuration is not correct, it can be changed. Config file for LILO is lilo.conf.
LILO is also a code snippet which loads PC BIOS into the main memory at the time of starting the computer system. It handles the following tasks :
1. Locating Linux kernel.
2. Identifying other supporting programs and loading them in the memory.
3. Starting Kernel.
The selection of various kernel images and boot routines is supported by LILO. For this reason, it is known as boot manager.
What is LD_LIBRARY_PATH?
LD_LIBRARY_PATH is an environment variable. It is used for debugging a new library or a non-standard library. It is also used to identify what directories need to be searched. Path to search for directories needs to given.
The variable can be set using setenv—LD_LIBRARY_PATH–$PATH.
It is used to search for the shared objects / dynamic libraries by the operating system for extendable functionality at runtime.
Name a service that you should disable (which acts both as Web and FTP Server) on a Linux Server.
The finger service should be disabled because a remote user can get important information about the system by using that command.
What does Sar provide? Where are Sar logs stored?
Sar collects, reports, or saves system activity information, sar serves to log and evaluate a variety of information regarding system activity. With performance problems, sar also permits retroactive analysis of the load values for various sub-systems (CPUs, memory, disks, interrupts, network interfaces and so forth) and limitation of problems in this manner. If CPU utilization is near 100 % (user + nice + system), the workload sampled is CPU-bound.
By default, log files of Sar command is located at /var/log/sa/sadd file, where dd parameter indicates the current day.
How to check Memory stats and CPU stats as a Linux admin?
Using ‘free’ & ‘vmstat’ command, we can display the physical and virtual memory statistics, respectively. With the help of ‘sar’ command, we can see the CPU utilization & other stats.
How to reduce or shrink the size of LVM partition?
Below are the logical steps to reduce size of LVM partition :
Unmount the filesystem using unmount command,
Use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G
Now use the lvreduce command as lvreduce -L 10G /dev/mapper/myvg-mylv
The above Command will shrink the size LVM partition and fixes the filesystem size to 10GB.Most in-depth, industry-led curriculum in linux.
How to check and verify the status of the bond interface?
Using the command ‘cat /proc/net/bonding/bond0,’ we can check what mode is enabled and what LAN cards are used in this bond. In this example, we have one one bond interface. However, we can have multiple bond interfaces like bond1, bond2 and so on.
How can you enhance the security of password file?
Linux keep user account information in a text file called /etc/passwd. This file also stores one way encrypted password. It is accessed by several tools to get user information, which is a security risk, so file need to ‘Word Readable.’ To minimize the security risk, you can use shadow password format. This method saves account information in regular file /etc/passwd.
However, the password is stored as a single “x” character (not actually stored in this file). A second file, called “/etc/shadow” contains encrypted password as well as other information such as account or password expiration values, etc. The /etc/shadow file is readable only by the root account and is therefore less of a security risk
Suppose your FTP Server is hacked and the entire server needs to be restored. How should you restore the original kernel system files?
You cannot restore the entire operating system from tape backup device. So you should reinstall the core operating system, and then restore system configuration files and user data from tape backup device.
What is Puppet Server?
Puppet is an open-source & enterprise software for configuration management toll in UNIX like operating system. Puppet is an IT automation software that is used to push configuration to its clients (puppet agents) using code. Puppet code can do multiple tasks from installing new software to checking file permissions to updating user accounts.