๐1. **Explain the Linux boot process.**
The BIOS loads the bootloader (like GRUB), which loads the kernel. The kernel initializes hardware, mounts the root filesystem, and starts `init` or `systemd`, loading system services and setting the default runlevel or target.
๐2. **How would you troubleshoot a slow server?**
Check system resources (`top`, `vmstat`, `free`) for CPU, memory, or I/O issues. Review disk usage (`df`, `du`) and network traffic (`netstat`, `ss`). Identify resource-heavy processes and adjust configurations, terminate processes, or consider hardware upgrades.
๐3. **Describe Linux file permissions and how to change them.**
Permissions include read, write, and execute for the owner, group, and others. Use `chmod` to modify permissions (e.g., `chmod 755 filename`), `chown` to change ownership, and `chgrp` to change the group.
๐4. **What is LVM, and how do you manage it?**
LVM (Logical Volume Manager) enables flexible disk management across physical volumes. Commands include `pvcreate` (create physical volume), `vgcreate` (create volume group), `lvcreate` (create logical volume), and `lvextend`/`lvreduce` for resizing.
๐5. **How do you secure a Linux server?**
Disable unnecessary services, configure `iptables`/`firewalld`, enforce SSH security (disable root login, use SSH keys), enable SELinux/AppArmor, apply patches, monitor logs, and use Fail2ban for brute-force prevention.
๐6. **How do you manage services in Linux?**
Use `systemctl` for `systemd` services (`systemctl start service`, `systemctl enable service`). On older systems, use `service` or `init.d` scripts.
๐7. **How do you add a user and manage permissions?**
Use `useradd username` and `passwd username` to add users. Add users to groups with `usermod -aG groupname username`. Adjust file permissions with `chmod` and `chown`.
๐8. **How do you monitor server performance?**
Use `top` or `htop` for real-time monitoring, `sar` for historical data, `iostat` for I/O stats, and `netstat` or `ss` for network connections. Monitor load average, keeping it below the number of CPU cores.
๐9. **What steps would you take for filesystem corruption recovery?**
Boot into single-user mode or use a live CD, run `fsck` to repair, and restore from backups if needed. Regular backups are essential for data protection.