0% found this document useful (0 votes)
2 views

Linux

The document contains 50 interview questions and answers related to Linux server administration, covering topics such as basic concepts, management, permissions, networking, disk management, logs, troubleshooting, security, backup, and automation. Each question is accompanied by a concise answer, providing essential information for candidates preparing for Linux-related interviews. This resource serves as a comprehensive guide for assessing knowledge in various domains of Linux server management.

Uploaded by

karan209205
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Linux

The document contains 50 interview questions and answers related to Linux server administration, covering topics such as basic concepts, management, permissions, networking, disk management, logs, troubleshooting, security, backup, and automation. Each question is accompanied by a concise answer, providing essential information for candidates preparing for Linux-related interviews. This resource serves as a comprehensive guide for assessing knowledge in various domains of Linux server management.

Uploaded by

karan209205
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

50 Linux server-related interview questions and answers that cover a broad

range of topics, including basic concepts, administration, troubleshooting, and


security:📚

Follow – Krishan Bhatt👨‍💻👨‍💻

Basic Linux Questions


1. What is Linux?
• Linux is a free and open-source operating system based on the Unix kernel. It is
widely used in servers, desktops, and embedded systems due to its stability and
flexibility.
2. What is the default shell used in Linux?
• The default shell in most Linux distributions is Bash (Bourne Again Shell).
3. What is the Linux file system hierarchy?
• The Linux file system starts with the root directory / and branches out into
directories like /bin, /etc, /home, /var, /usr, etc.
4. What is the purpose of the /etc directory?
• It contains configuration files for the system and installed services.
5. What is the difference between hard link and soft link?
• Hard link points directly to the data of the file, while a soft link (symbolic link) is a
pointer to the file name.

Linux Server Management


6. What is a Linux server?
• A Linux server is a high-performance system configured for server-specific tasks like
web hosting, file sharing, database hosting, etc.
7. How do you check the current running services on a Linux server?
• Use systemctl list-units --type=service to check active services.
8. How do you check the server uptime?
• Run the uptime command to see how long the server has been running.
9. How do you restart a service in Linux?
• Use systemctl restart <service_name>.
10. How do you check the memory usage of a Linux server?
• Use commands like free -h, top, or htop.

Linux Permissions and Ownership


11. What are the different types of file permissions in Linux?
• Read (r), Write (w), and Execute (x).
12. How do you change file permissions in Linux?
• Use the chmod command. For example, chmod 755 file.txt.
13. How do you change file ownership in Linux?
• Use the chown command. For example, chown user:group file.txt.
14. What is the umask command?
• It sets the default permissions for newly created files and directories.
15. What does chmod 777 mean?
• It gives read, write, and execute permissions to everyone (owner, group, others).

User and Group Management


16. How do you create a new user in Linux?
• Use the useradd command. For example, useradd newuser.
17. How do you delete a user?
• Use the userdel command. For example, userdel username.
18. How do you switch users in Linux?
• Use the su or sudo -i command.
19. What is the difference between su and sudo?
• su switches the user, requiring their password, while sudo runs commands as
another user (usually root) with your own password.
20. How do you list all users on the system?
• Check the /etc/passwd file or run cut -d: -f1 /etc/passwd.

Networking
21. How do you check the IP address of a Linux server?
• Use ip addr or ifconfig (deprecated).
22. How do you test network connectivity?
• Use ping, curl, or telnet.
23. What is SSH, and how do you use it?
• SSH (Secure Shell) is a protocol for secure remote login. Use ssh user@hostname.
24. How do you restart the network service?
• Run systemctl restart network or systemctl restart NetworkManager.
25. How do you add a static IP in Linux?
• Edit the network configuration files, such as /etc/network/interfaces or
/etc/sysconfig/network-scripts/ifcfg-<interface>.

Disk Management
26. How do you check disk usage in Linux?
• Use df -h for file system usage and du -sh <directory> for directory size.
27. How do you check available inodes?
• Use df -i.
28. What is LVM?
• LVM (Logical Volume Manager) is a tool for managing disk partitions dynamically.
29. How do you create a new partition?
• Use fdisk or parted.
30. How do you mount a disk in Linux?
• Use the mount command. For example, mount /dev/sdb1 /mnt.

Logs and Monitoring


31. Where are system logs stored in Linux?
• Logs are stored in /var/log.
32. How do you view the last 10 lines of a log file?
• Use tail -n 10 /var/log/<logfile>.
33. What is the journalctl command used for?
• It views and manages logs generated by systemd.
34. How do you monitor system performance?
• Use tools like top, htop, sar, or iotop.
35. How do you set up log rotation in Linux?
• Configure the /etc/logrotate.conf file or create rules in /etc/logrotate.d/.

Troubleshooting
36. How do you troubleshoot a server not responding?
• Check network connectivity (ping), resource usage (top/free), and logs (journalctl or
/var/log/messages).
37. How do you kill a hanging process?
• Use kill <PID> or kill -9 <PID>.
38. How do you find which process is using a specific port?
• Use netstat -tulnp or ss -tulnp.
39. What do you do if the disk is full?
• Identify large files using du -sh *, then delete unnecessary files or increase storage.
40. How do you recover a deleted file in Linux?
• Use tools like extundelete for ext file systems or restore from a backup.

Security
41. How do you secure SSH access?
• Use public key authentication, disable root login, and change the default port.
42. How do you block an IP address in Linux?
• Use iptables or ufw to block the IP.
43. What is SELinux?
• SELinux (Security-Enhanced Linux) is a security module for enforcing access control
policies.
44. How do you check the SELinux status?
• Use sestatus or getenforce.
45. What is the difference between a firewall and SELinux?
• A firewall manages network traffic, while SELinux enforces access controls on
processes and files.

Backup and Automation


46. How do you create a backup in Linux?
• Use tools like tar, rsync, or dd.
47. What is crontab?
• crontab is used to schedule periodic tasks in Linux.
48. How do you schedule a cron job?
• Use crontab -e to edit and add cron entries.
49. How do you check currently scheduled cron jobs?
• Run crontab -l for the current user or check /var/spool/cron.
50. What is Ansible?
• Ansible is a configuration management and automation tool for managing servers
efficiently.
These questions are designed to test knowledge across various domains of Linux server
administration. Let me know if you’d like a deeper explanation for any specific question.

You might also like