Linux is not just an operating system. Instead, it is a humongous family of free and open-source software operating systems that are based on the Linux kernel.
System security and Linux administration go hand to hand. So, expect Linux questions coming your way when interviewed for a security-based job profile.
3 Can we convert a Linux computer into a router in order to enable multiple machines to work on the same Internet connection? If yes, how?
Yes! We can convert a Linux PC into a router so that it can act as an IP gateway for a network. This process of turning a Linux machine to a router is referred to as IP Masquerade, which is basically a Linux networking function that is quite similar to the one-to-many network address translation servers.
Linux IP Masquerading enables the other ‘internal’ computers that are linked to this Linux system to get connected to the Internet. This Linux feature is available even when these machines do not have their own IP addresses.
In Linux, we can perform IP Masquerading by following the below steps:
Step 1: First of all, we have to make sure that our Linux PC is having an Internet connection, along with a LAN connection. In fact, a Linux PC will be having a PPP connection and an Ethernet card. Step 2: As the default gateway for TCP/IP networking, all the other systems on our LAN use the Linux machine. Hence, we have to use the same DNS addresses provided by the Internet service provider on all our systems. Step 3: Now, for enabling IP forwarding, we will use the following command:
For checking whether we have IP forwarding enabled already, we can use the following:
Or, we will just check out the value i /proc/sys/net/ipv4/ip_forward:
Step 4: Finally, we will run /sbin/iptables for setting up those rules that enable IP Masquerading.
3 Which command is used to check the number of files, disk space, and each user’s defined quota?
The repquota command is used to check the status of a user’s defined quota, along with the disk space and the number of files used.
This command gives a summary of the user’s quota, i.e., how much space and files are left for the particular user. Each user has a defined quota in Linux. This is done mainly for security as it restricts files from unwanted access. The quota can be given to a single user or to a group of users.
Explain various file permissions in Linux?
In Linux, each file and directory has three categories of owners which are User, Group, and Others. For all three owners, there are three sorts of permissions defined as mentioned below:
Read: This read permission allows you to open the file, read it and list the content of the directory.
Write: This permission gives you the ability to change the contents of a file as well as add, remove, and rename files in directories.
Execute: The file in the directory can be accessed and run by the user. The execute permission must be established before a file may be run.
7 What is the top Command in Linux?
Ans: top command displays and updates sorted process information. Use this top command to determine which processes are running and how much memory and CPU they are consuming.
Most of these are scenario based Linux interview questions for Experienced Linux Admins. You will find these questions very helpful in your Linux Admins interviews. Prepare well and All the very best.
We have prepared a set of questions to help Experienced Linux Admins in their preparations for Interview. This list includes Google interview questions for Infrastructure specialist position, Amazons Cloud Support Engineer – II position and other reputed firms interviews as well.