Find below a collection of Questions & Answers for Linux System Administrator updated in May 2021. Also I’ve included a collection of resources to help you better prepare for your next job interview in 2021. Best of Luck landing your new Job!!
1 What is the difference between rm and rm -rf?
The rm command by itself only deletes the named files (and not directories). With -rf you add two additional features: The -r, -R, or --recursive flag recursively deletes the directory’s contents, including hidden files and subdirectories, and the -f, or --force, flag makes rm ignore nonexistent files, and never prompt for confirmation.
2 How do you make a process run in the background, and what are the advantages of doing so?
You can make a process run in the background by adding the special character & at the end of the command. Generally, applications that take too long to execute, and don’t require user interaction are sent to the background so that we can continue our work in the terminal.
3 What are the first five commands you type on a *nix server after login?
lsblk to see information on all block devices
who to see who is logged into the server
top to get a sense of what is running on the server
df -khT to view the amount of disk space available on the server
netstat to see what TCP network connections are active
4 Is running these commands as root a good or bad idea?
Running (everything) as root is bad due to two major issues. The first is risk. Nothing prevents you from making a careless mistake when you are logged in as root. If you try to change the system in a potentially harmful way, you need to use sudo, which introduces a pause (while you’re entering the password) to ensure that you aren’t about to make a mistake.
The second reason is security. Systems are harder to hack if you don’t know the admin user’s login information. Having access to root means you already have one half of the working set of admin credentials.
5 Compress.tgz has a file size of approximately 15GB. How can you list its contents, and how do you list them only for a specific file?
To list the file’s contents:
tar tf archive.tgz
To extract a specific file:
tar xf archive.tgz filename
6 Which port is used for the ping command?
The ping command uses ICMP. Specifically, it uses ICMP echo requests and ICMP echo reply packets.
ICMP does not use either UDP or TCP communication services: Instead, it uses raw IP communication services. This means that the ICMP message is carried directly in an IP datagram data field.
7 What is the difference between a router and a gateway? What is the default gateway?
Router describes the general technical function (layer 3 forwarding), or a hardware device intended for that purpose, while gateway describes the function for the local segment (providing connectivity to elsewhere). You could also state that you "set up a router as a gateway." Another term is hop, which describes forwarding between subnets.
The term default gateway is used to mean the router on your LAN, which has the responsibility of being the first point of contact for traffic to computers outside the LAN.
8 Explain the boot process for Linux.
BIOS -> Master Boot Record (MBR) -> GRUB -> the kernel -> init -> runlevel
9 How do you check the error messages while the server is booting up?
Kernel messages are always stored in the kmsg buffer, visible via the dmesg command.
Boot issues and errors call for a system administrator to look into certain important files, in conjunction with particular commands, which are each handled differently by different versions of Linux:
/var/log/boot.log is the system boot log, which contains all that unfolded during the system boot.
/var/log/messages stores global system messages, including the messages logged during system boot.
/var/log/dmesg contains kernel ring buffer information.
10 How do you change kernel parameters? What kernel options might you need to tune?
To set the kernel parameters in Unix-like systems, first edit the file /etc/sysctl.conf. After making the changes, save the file and run the sysctl -p command. This command makes the changes permanent without rebooting the machine
11 How do you run a script as another user without their password?
For example, if you were editing the sudoers file (such as /private/etc/sudoers), you might use visudo to add the following:
user1 ALL=(user2) NOPASSWD: /opt/scripts/bin/generate.sh
12 What is the UID 0 toor account? Have you been compromised?
The toor user is an alternative superuser account, where toor is root spelled backward. It is intended to be used with a non-standard shell, so the default shell for root does not need to change.
This purpose is important. Shells which are not part of the base distribution, but are instead installed from ports or packages, are installed in /usr/local/bin; which, by default, resides on a different file system. If root’s shell is located in /usr/local/bin and the file system containing /usr/local/bin is not mounted, root could not log in to fix a problem, and the sysadmin would have to reboot into single-user mode to enter the shell’s path.
13 How does tracert work and what protocol does it use?
The command tracert—or traceroute depending on the operating system—allows you to see exactly what routers you touch as you move through the chain of connections to your final destination. If you end up with a problem where you can’t connect to or ping your final destination, a tracert can help in that you can tell exactly where the chain of connections stops.
14 How do you protect your system from getting hacked?
By following the principle of least privileges and these practices:
Encrypt with public keys, which provides excellent security.
Enforce password complexity.
Understand why you are making exceptions to the rules above.
Review your exceptions regularly.
Hold someone to account for failure.
15 What is LVM, and what are the advantages of using it?
LVM, or Logical Volume Management, uses a storage device management technology that gives users the power to pool and abstract the physical layout of component storage devices for easier and flexible administration. Using the device mapper Linux kernel framework, the current iteration (LVM2) can be used to gather existing storage devices into groups and allocate logical units from the combined space as needed.
16 What are sticky ports?
Sticky ports are one of the network administrator’s best friends and worst headaches. They allow you to set up your network so that each port on a switch only permits one (or a number that you specify) computer to connect on that port, by locking it to a particular MAC address.
17 What is a false positive and false negative in the case of IDS?
When the Intrusion Detection System (IDS) device generates an alert for an intrusion which has actually not happened, this is false positive. If the device has not generated any alert and the intrusion has actually happened, this is the case of a false negative.
Comment Below what would be your answers to the following questions ... Help others by commenting additional questions you think are important !!
18 What is the difference between local and remote port forwarding?
19 What is the difference between local and remote port forwarding?
20 How do you catch a Linux signal on a script?
Additional Resources that might come handy:
If you are thinking about starting your career as a Linux System Administrator or Sysadmin and you would like to know more about System Administration then keep reading below:
As a Linux system Administrator you will have to deal with tasks like making sure all files and systems have the proper backup in place, you will be restoring information, recovering from data corruption and other disasters like security attacks.
You will also have to deal with maintenance, applications and configurations in the servers.
- Learn about Linux and System Administration in general
- Review the different systems and how they are used by different businesses.
- Learn about Role of a DevOps Engineer
- Get a System administrator certification.
- Be ready to talk about any previous IT experience with examples.
- User Management in the system (Linux/Win)
- Hardware setup including routers, vpns and firewalls
- Remote system administration
- Managing Scheduled Data Backups
- Software Installation and Updates
It takes at least 1 year studying and getting your certifications, it's a good idea during this time to also get an intern position. Then it will take an additional 2 years for you to build good experience and to progress into a senior position within your company.
According to the US Bureau of Labor Statistics, there will be a growth rate of 6% between the years 2016 to 2026, this means more roles will open since technologies will evolve and companies will expand business. Apart from this there's an expected increase in salary for the roles of Linux System Administrator.