Linux Admin Flashcards

1
Q

What is Linux

A

Linux is an open-source operating system based on UNIX. It was named after the founder “Linus Torvalds”. He introduced Linux with the primary goal to offer an operating system at a free or very reasonable price for users. It is based on the Linux kernel and is compatible with different hardware platforms such as Intel, MIPS, HP, IBM, SPARC, and Motorola hardware platforms. Linux’s mascot, a penguin named Tux, is another popular feature. Linux offers a user-friendly environment where they can easily modify and create variations in the source code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Compare Linux with Windows

A

Linux
Type of OS - Open-source
High level of customization
High level of security

Windows
Proprietary OS
Customization - cannot be changed
Vulnerable to security issues

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the components of the Linux system?

A

Kernel: The kernel is the most important component of Linux. It is in charge of the operating system’s primary functions. It is made up of a number of modules that interface directly with the hardware. Kernel offers the necessary abstraction for system or application programs to mask low-level hardware information.

System libraries: They are specialized functions or programs that allow application programs or system utilities to access Kernel capabilities. These libraries implement the majority of the operating system’s functionality and do not require kernel module code access permissions.

System Utility: Programs in the System Utility category are in charge of performing specialized, individual-level activities. They are more dependable and also provide users control over the computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is LILO?

A

LILO (Linux Loader) is a boot loader for Linux. It is used to load Linux into memory and start the operating system. LILO can be configured to boot other operating systems as well. LILO is customizable, i.e., if the default configuration is not correct, it can be changed. lilo.conf is the configuration file for LILO. LILO is also a code snippet that loads PC BIOS into the main memory at the time of starting the computer system.

It handles the following tasks:

Locating Linux kernel
Identifying other supporting programs and loading them in memory
Starting the kernel

The selection of various Kernel images and boot routines is supported by LILO. For this reason, it is known as the boot manager.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Suppose, you wish to print a file ‘draft’ with 60 lines on a page. What command would you use?

A

The command used for this purpose would be as follows:
pr -l60 draft
Note: The default page length when using pr is 66 lines. The -l option specifies a different length.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is LD_LIBRARY_PATH?

A

LD_LIBRARY_PATH is an environment variable used for debugging a new library or a non-standard library. It is also used to identify the directories that need to be searched for; in order to do this, the path to search for the directories needs to be specified.

The variable can be set using the following:
setenv—LD_LIBRARY_PATH–$PATH

It is used to search for the shared objects/dynamic libraries by the operating system for extendable functionality at the runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name a service that you should disable (which acts both as web and FTP servers) on a Linux server.

A

The finger service should be disabled on a Linux server because a remote user can get important information about the system by using this command.

To disable this service use command: sudo systemctl disable vsftpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does sar provide? Where are the sar logs stored?

A

The sar command in Linux is a valuable tool for collecting and analyzing system activity information. It reports various aspects of system performance, such as CPU usage, memory utilization, disk activity, network traffic, and more. When troubleshooting performance issues, sar enables you to review historical data and identify the causes of high load on specific system components.

When the CPU utilization is close to 100 percent, it indicates that the processing workload primarily demands the CPU. This information helps determine if the system is experiencing a CPU-bound situation.

By default, sar saves its log files in the /var/log/sa/sadd directory, where “dd” represents the current day. These log files are valuable for retrospective analysis and tracking system activity over time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to check memory stats and CPU stats as a Linux Admin?

A

Using the free and vmstat commands, we can display the physical and virtual memory statistics, respectively. With the help of the sar command, we can see the CPU utilization and other stats.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to reduce or shrink the size of the LVM partition?

A

Below are the logical steps to reduce the size of the LVM partition:

Unmount the file system using the unmount command
Use the resize2fs command as follows:
resize2fs /dev/mapper/myvg-mylv 10G

Then, use the lvreduce command as follows:
lvreduce -L 10G /dev/mapper/myvg-mylv

This way, we can reduce the size of the LVM partition and fix the size of the file system to 10 GB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the different modes of Network Bonding in Linux?

A

Below is the list of various modes used in Network Bonding:

balance-rr or mode 0: The round-robin mode for fault tolerance and load balancing

active-backup or mode 1: Sets the active-backup mode for fault tolerance

balance-xor or mode 2: Sets an XOR (exclusive-or) mode for fault tolerance and load balancing

broadcast or mode 3: Sets a broadcast mode for fault tolerance. All transmissions are sent on all the slave interfaces

802.3ad or mode 4: Sets an IEEE 802.3ad dynamic link aggregation mode and creates aggregation groups that share the same speed and duplex settings

balance-tlb or mode 5: Sets a transmit load balancing (TLB) mode for fault tolerance and load balancing

balance-alb or mode 6: Sets an active load balancing (ALB) mode for fault tolerance and load balancing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to check and verify the status of the bond interface?

A

Using the following command, we can check which mode is enabled and what LAN cards are used in this bond:

cat /proc/net/bonding/bond0
In this example, we have a single bond interface. However, we can have multiple bond interfaces like bond1, bond2, and so on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Do you know the Maximum length (in bytes) of the filename in Linux

A

The maximum length of a filename is 255 bytes. In this filename, the pathname is not included, so the total length of the pathname and filename may easily surpass 255 characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two different kinds of Linux User Modes?

A

The following are the two types of Linux user modes:

Command Line
GUI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Hard Link?

A

In Linux, Hard links can be defined as another name for an already existing file. For each file, we can generate an unlimited number of hard links. They have the ability to generate links for other hard connections. We can use the Is-I command to find out the total number of hard links in a file. And we can create Hard links using the following command:

$ ln [original filename] [link name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Soft Link?

A

Soft link is also known as a symbolic link. Soft links are files that, in most cases, lead to another file. It just links to another entry somewhere in the file system and does not include any data in the destination file. These kinds of connections can be utilized across several file systems. The following command can be used to create soft links:

$ ln -s [original filename] [link name]

17
Q

Explain the features of the Linux system?

A

The key features of the Linux system are as follows:

Linux is a community-based major project which is freely available open-source code. Multiple teams collaborate to improve the capabilities of this operating system, which is always growing.

It offers a prominent feature which is that it is a multiuser system, which implies that several users may share system resources such as memory, ram, and application programs.

Portability refers to the capacity of software to run on a variety of hardware platforms in the same way. The Linux kernel and application software may be installed on virtually any hardware platform.

Linux is a multiprogramming system, which means it can run many programs at the same time.

Linux has a Hierarchical File System (HFS), which offers a standardized structure for storing system and user data files.

Linux contains a custom interpreter application that allows users to run operating system program commands and instructions.

User security is provided by Linux through authentication mechanisms such as password protection, limited access to particular files, and data encryption.

18
Q

Why is Linux regarded as a more secure operating system than other operating systems?

A

Linux has become more popular in the technology industry in terms of security. There are several reasons why Linux is more secure than other operating systems.

On Linux, only a few people have access to the system. As a result, the virus cannot infect the entire system but it may affect only a few files.

Before opening the files, Linux users must first complete the tasks, so that they can protect their systems against flaws.

The Linux operating system includes a variety of working environments, including Linux Mint, Debian, Arch, and others, all of which include virus protection.

It keeps a log history so that it may quickly see the specifics of the system files afterward.

Iptables is a Linux feature that examines the system’s security circle.

As Linux users are comparatively fewer in number as compared to other operating systems, security will be enhanced.

19
Q

How can you enhance the security of the password file in Linux?

A

It is in the test file named ‘/etc/passwd’ that Linux usually keeps its user account details, including the one-way encrypted passwords. However, this file can be accessed with the help of different tools, which might throw security issues.

To minimize this risk, we will make use of the shadow password format that saves the account details in a regular file /etc/passwd as in the traditional method but with the password stored as a single ‘x’ character, i.e., it is not the original password that is actually stored in this file. Meanwhile, a second file /etc/shadow will have the encrypted password, along with the other relevant information, such as the account/password expiration date, etc. Most importantly, the latter file is readable only by the root account, and thus it minimizes the security risk.

To enable shadow password use the command: pwconv

20
Q

What are the three standard streams in Linux?

A

In Linux, standard streams are channel communication of input and output between a program and its environment. In the Linux system, input and output are spread among three standard streams which are:

Standard Input (stdin)
Standard Output (stdout)
Standard Error (stderr)

21
Q

What command can you use to make a tape archive file of /home directory and send it to the /dev/tape device?

A

The command used here is:

tar -cvf /dev/tape /home
The -xvf option is used to extract files from an archive

22
Q

What is CLI?

A

The acronym CLI stands for Command Line Interface. The user can input declarative instructions into this interface to direct the machine tasks. It communicates with a software program by issuing commands in the form of text lines. It also interacts with computer terminals; the interface receives text lines and transforms them into operating system commands. CLI offers great flexibility.

23
Q

What is GUI?

A

A GUI (Graphical User Interface) is a type of interface between humans and machines that allows people to interact with electronic devices via graphical icons and visual indications. The inclusion of graphical components makes it easier to interact with the system, as well as provides additional appeal through images, icons, and colors, rather than having to memorize and write commands. Users will find it simpler to engage with the system if certain graphical components or icons are used. It is visually appealing and enables increased productivity.

24
Q

Suppose, your FTP Server is hacked and the entire server needs to be restored. How would you restore the original kernel system files?

A

We cannot restore the entire operating system from the tape backup device. Therefore, we should reinstall the core operating system and then restore the system configuration files and user data from the tape backup device.

25
Q

Why should you avoid Telnet to administer a Linux system remotely?

A

Telnet uses the most insecure method for communication. It sends data across the network in plain text format, and anybody can easily find out the password using the network tool.

It includes the passing of the login credentials in plain text, i.e., anyone running a sniffer on the network can find the information he/she needs to take control of the device in a few seconds by eavesdropping on a Telnet login session.