Linux
Linux
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.
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.