Unix Interview Questions For Production Support
Unix interview questions for production support Working in production support
involves ensuring the stability, performance, and security of Unix-based systems that run
critical business applications. Candidates aiming for roles in this domain need to
demonstrate a solid understanding of Unix fundamentals, troubleshooting skills, and
familiarity with system administration tasks. Preparing for Unix interview questions
tailored for production support can significantly improve your chances of securing such a
role. This article delves into common interview questions, their explanations, and tips to
help you prepare effectively. ---
Fundamental Unix Concepts and Commands
1. What is Unix, and how does it differ from Linux?
- Answer: Unix is a powerful, multi-user, multitasking operating system originally
developed in the 1970s at Bell Labs. It is known for its stability, security, and portability.
Linux, on the other hand, is an open-source Unix-like operating system inspired by Unix
principles. While Unix systems are often proprietary (e.g., Solaris, AIX, HP-UX), Linux
distributions (e.g., Ubuntu, CentOS) are open-source. Both share many commands and
concepts but differ in licensing, kernel architecture, and system management tools.
2. Explain the significance of the /etc/passwd and /etc/shadow files.
- Answer: - `/etc/passwd` stores user account information such as username, user ID
(UID), group ID (GID), home directory, and default shell. It is world-readable but no longer
stores password hashes for security reasons. - `/etc/shadow` contains encrypted
password hashes and account aging information. It is accessible only by privileged users.
Proper management of these files is critical for security.
3. Describe the different types of permissions in Unix and how they are
represented.
- Answer: Permissions determine who can read, write, or execute a file or directory. They
are represented in three categories: - User (u): Owner of the file. - Group (g): Users in the
file's group. - Others (o): Everyone else. Permissions are displayed as `rwx` (read, write,
execute). For example, `-rwxr-xr--` indicates: - Owner: read, write, execute - Group: read,
execute - Others: read only ---
2
System Administration and Management
4. How do you check system uptime and load average?
- Answer: - Use the `uptime` command to view system uptime and load averages: ```bash
uptime ``` Output example: ``` 10:25:32 up 15 days, 4:22, 3 users, load average: 0.15,
0.20, 0.25 ``` - Alternatively, `top` or `w` commands provide real-time system load and
user information.
5. How can you identify which processes are consuming the most CPU or
memory?
- Answer: - Use the `top` command, which provides an interactive, real-time view of
processes sorted by CPU or memory usage. - For non-interactive, scriptable output: - For
CPU: ```bash ps aux --sort=-%cpu | head -n 10 ``` - For Memory: ```bash ps aux --sort=-
%mem | head -n 10 ```
6. Describe the process of checking disk space utilization.
- Answer: - Use the `df -h` command to check disk space in human-readable format:
```bash df -h ``` - To check inode usage: ```bash df -i ``` - For detailed disk usage per
directory: ```bash du -sh /path/to/directory/ ```
7. How do you monitor system logs, and which logs are critical in
production support?
- Answer: - Logs are typically stored in `/var/log/`. - Critical logs include: -
`/var/log/messages` or `/var/log/syslog`: General system logs. - `/var/log/secure` or
`/var/log/auth.log`: Authentication logs. - `/var/log/dmesg`: Kernel ring buffer logs. - Use
commands like `tail -f` to monitor logs in real time: ```bash tail -f /var/log/messages ``` ---
Troubleshooting and Performance Tuning
8. How do you troubleshoot high CPU usage issues?
- Answer: - Use `top` or `htop` to identify processes consuming CPU. - Use `ps` command:
```bash ps aux --sort=-%cpu | head -n 10 ``` - Check for runaway processes or
background jobs. - Investigate application logs for errors. - Consider restarting or
reconfiguring processes if needed.
9. Describe steps to investigate a disk I/O bottleneck.
- Answer: - Use `iostat` (from `sysstat` package): ```bash iostat -x 1 ``` - Check disk
3
read/write activity. - Use `sar` for historical data. - Use `iotop` (if available) to monitor
real-time disk I/O per process. - Identify processes causing high I/O.
10. How do you handle system crashes or kernel panics?
- Answer: - Check system logs (`/var/log/messages`, `/var/crash/`). - Use `kexec` to
reboot into a previous kernel if necessary. - Collect core dumps for analysis. - Ensure
hardware checks are performed. - Follow proper recovery procedures, including restoring
from backups if needed.
11. Explain how to analyze and resolve network issues.
- Answer: - Use `ping` to check network connectivity. - Use `traceroute` to identify
network hops and latency. - Use `netstat -tulnp` or `ss -tulnp` to check open ports and
listening services. - Use `tcpdump` or `wireshark` for packet capture. - Check firewall
rules (`iptables` or `firewalld`). - Verify DNS resolution with `nslookup` or `dig`. ---
Security and Access Management
12. How do you secure a Unix system in production?
- Answer: - Regularly update and patch system software. - Implement strong password
policies. - Limit root access via SSH keys. - Configure firewalls and disable unnecessary
services. - Use SELinux/AppArmor for access control. - Monitor logs for suspicious activity.
- Regularly audit user accounts and permissions.
13. Describe the process of managing user accounts and permissions.
- Answer: - Create users with `useradd` or `adduser`. - Set passwords with `passwd`. -
Assign users to groups using `usermod -aG`. - Use `chmod`, `chown`, and `chgrp` to
manage file permissions. - Remove inactive or unnecessary accounts to minimize security
risks. ---
Automation and Scripting
14. How do you automate routine tasks in Unix?
- Answer: - Use shell scripting to automate repetitive commands. - Schedule jobs with
`cron`: ```bash crontab -e ``` - Use configuration management tools like Ansible, Puppet,
or Chef for larger environments.
15. Provide an example of a shell script to monitor disk space and send
4
an email alert if space exceeds a threshold.
- Answer: ```bash !/bin/bash THRESHOLD=80 USAGE=$(df / | grep / | awk '{ print $5 }' |
sed 's/%//') if [ "$USAGE" -gt "$THRESHOLD" ]; then echo "Disk space above threshold at
${USAGE}%" | mail -s "Disk Space Alert" admin@example.com fi ``` - Schedule this script
in `cron` for regular checks. ---
Best Practices for Production Support in Unix
1. Maintain Documentation
- Keep detailed records of system configurations, procedures, and incident reports.
2. Implement Change Management
- Follow strict protocols for updates and changes to prevent unintended disruptions.
3. Regular Backup and Recovery Plans
- Ensure backups are tested and recovery procedures are in place.
4. Continuous Monitoring and Alerting
- Use monitoring tools like Nagios, Zabbix, or Prometheus for proactive issue detection.
5. Security Compliance
- Stay updated with security patches and adhere to organizational policies. ---
Conclusion
Preparing for Unix interview questions for production support requires a comprehensive
understanding of system administration, troubleshooting, security, and automation.
Candidates should focus on mastering core commands
QuestionAnswer
What are the key
differences between UNIX
and Linux that are
relevant for production
support?
UNIX and Linux differ mainly in licensing, system
architecture, and command sets. UNIX is typically
proprietary with a focus on stability and scalability, often
used in enterprise environments, while Linux is open-source
with a broader community. For production support,
understanding UNIX-specific commands, system files, and
performance tuning is crucial, along with familiarity with
Linux equivalents when applicable.
5
How do you troubleshoot
performance issues in a
UNIX production
environment?
Troubleshooting performance issues involves monitoring
system resources using commands like top, ps, vmstat,
iostat, and sar to identify bottlenecks. Checking logs,
analyzing process activity, disk I/O, and network usage is
essential. Additionally, examining application logs and
tuning system parameters like kernel settings can help
resolve performance problems.
Explain the importance of
log management in UNIX
production support.
Log management is vital for diagnosing issues, auditing,
and ensuring system stability. Proper log rotation,
monitoring, and analysis help identify errors, security
breaches, or performance anomalies early. Tools like
logrotate and centralized log management solutions
facilitate efficient log handling in production environments.
What are some common
UNIX commands used in
production support, and
what are their purposes?
Common commands include 'ps' for process management,
'top' for real-time system monitoring, 'df' and 'du' for disk
usage, 'netstat' or 'ss' for network connections, 'tail' and
'grep' for log analysis, and 'kill' or 'killall' for process
termination. These commands help monitor, troubleshoot,
and maintain system health.
How do you handle
system outages or
crashes in a UNIX
production environment?
Handling outages involves immediate diagnosis using
system logs and core dumps, identifying the root cause, and
restoring services with minimal downtime. Preventive
measures include implementing monitoring, automated
alerts, regular backups, and system patching. Post-incident,
conducting thorough analysis helps prevent recurrence.
Can you explain the role
of shell scripting in UNIX
production support?
Shell scripting automates routine tasks such as log analysis,
backups, system monitoring, and deployment processes. It
enhances efficiency, reduces manual errors, and enables
quick response to issues. Skilled scripting is essential for
effective production support and maintaining system
reliability.
What are the best
practices for managing
user permissions and
security in UNIX
production systems?
Best practices include following the principle of least
privilege, regularly auditing permissions, using groups
effectively, and enforcing strong password policies.
Implementing secure SSH configurations, keeping the
system updated, and monitoring for unauthorized access
are also critical for maintaining security.
How do you perform
system backups and
disaster recovery in UNIX
environments?
Backup strategies include using tools like tar, cpio, or
specialized backup solutions, ensuring regular full and
incremental backups. Offsite storage, verification of
backups, and documented recovery procedures are
essential. Disaster recovery involves restoring data from
backups, reconfiguring services, and validating system
integrity before resuming operations.
Unix Interview Questions for Production Support: An Expert Guide to Mastering the
Essential Skills In the fast-paced environment of production support, having a solid
Unix Interview Questions For Production Support
6
understanding of Unix is not just a bonus—it's a necessity. Organizations rely heavily on
Unix-based systems for their stability, security, and performance. For professionals aiming
to excel in roles that involve maintaining, troubleshooting, and optimizing these
environments, preparing for Unix interview questions becomes a critical step. This article
offers an in-depth exploration of the most common and essential Unix interview questions
tailored specifically for production support roles, providing comprehensive explanations
and insights to help you stand out. ---
Understanding the Importance of Unix in Production Support
Unix systems form the backbone of many enterprise applications, databases, and critical
infrastructure. Their robustness, multi-user capabilities, and scripting abilities make them
ideal for production environments where uptime and efficiency are paramount. Production
support professionals must possess a nuanced understanding of Unix commands, file
systems, process management, networking, and security to swiftly resolve issues and
ensure system health. ---
Core Unix Concepts and Interview Questions
1. What are the key features of Unix that make it suitable for production
environments?
Answer: Unix's suitability for production stems from several core features: - Stability and
Reliability: Unix systems are known for their robustness, often running for extended
periods without failure. This stability is vital for production environments where downtime
is costly. - Multi-user and Multi-tasking: Supports multiple users and processes
simultaneously, facilitating collaborative work and efficient resource utilization. - Security:
Built-in security mechanisms, including file permissions, user authentication, and process
isolation, protect sensitive data and operations. - Portability: Unix's architecture allows it
to run on diverse hardware platforms, making it adaptable to various infrastructure needs.
- Extensibility and Scripting: Powerful scripting capabilities (sh, bash, awk, sed) enable
automation of routine tasks, reducing manual intervention and error. - Networking
Capabilities: Native support for TCP/IP protocols facilitates network communication
essential for distributed systems.
2. Explain the Unix directory structure and its significance in production
support.
Answer: Unix employs a hierarchical directory structure starting from the root directory
(`/`). Key directories include: - `/bin` and `/sbin`: Essential user and system binaries
required for system operation and maintenance. - `/etc`: Configuration files for the
system and applications. - `/home`: User home directories. - `/var`: Variable data like
Unix Interview Questions For Production Support
7
logs, mail, and spool files. - `/tmp`: Temporary files. - `/usr`: User programs and utilities. -
`/lib`: Shared libraries needed by binaries. In production support, understanding this
structure is crucial because: - It helps locate configuration files (`/etc`), logs (`/var/log`),
and executables (`/bin`, `/usr/bin`). - Proper navigation and management of these
directories allow efficient troubleshooting. - Knowledge of standard directory contents aids
in identifying misconfigured files or corrupted data.
3. How do you check the current Unix system status and performance
metrics?
Answer: Monitoring system health is fundamental in production support. Common
commands include: - `top`: Displays real-time CPU, memory, and process usage. -
`uptime`: Shows system uptime, load average, and number of users. - `vmstat`: Provides
virtual memory statistics, process information, and CPU activity. - `free -m`: Reports
memory usage in megabytes. - `iostat`: Monitors disk I/O activity. - `ps -ef` or `ps aux`:
Lists running processes with detailed info. - `sar`: Collects, reports, and saves system
activity data over time. Regularly analyzing these metrics helps preempt issues and
optimize resource allocation. ---
Process Management and Troubleshooting in Unix
4. How do you identify and terminate a runaway process?
Answer: Runaway processes can consume excessive resources, degrading system
performance. The typical approach involves: - Identify the process: Use `ps` or `top`:
```bash ps -ef | grep ``` or ```bash top ``` - Note the process ID (PID): From the output,
find the PID associated with the process. - Terminate the process: Use `kill`: ```bash kill
``` If the process doesn't terminate gracefully, force kill: ```bash kill -9 ``` Best Practices:
Always verify the process before killing to avoid terminating critical system processes.
5. What is the difference between `ps`, `top`, and `htop` commands?
Answer: - `ps`: Provides a snapshot of current processes at a specific point in time. It is
non-interactive and used for detailed process inspection. Example: ```bash ps -ef ``` -
`top`: An interactive real-time process viewer that updates periodically, displaying CPU,
memory, and process information. - `htop`: An enhanced, user-friendly, interactive
process viewer similar to `top`, with features like process tree view, color coding, and
easier navigation. In production support, `ps` is useful for quick snapshots, while `top`
and `htop` aid in real-time monitoring and troubleshooting. ---
Unix Interview Questions For Production Support
8
File System and Disk Management
6. How do you check disk space usage and identify large files?
Answer: - Check disk space: Use `df -h` to display disk space usage in human-readable
format: ```bash df -h ``` - Identify large files: Use `find` combined with `du`: ```bash find
/ -type f -exec du -h {} + | sort -rh | head -20 ``` Alternatively, for a specific directory:
```bash du -sh /path/to/directory/ ``` Best Practice: Regular disk checks prevent storage
issues that could lead to system failures.
7. How do you mount and unmount filesystems?
Answer: - Mounting: Use the `mount` command: ```bash mount /dev/sdXn
/mnt/mount_point ``` Replace `/dev/sdXn` with the device identifier and
`/mnt/mount_point` with the directory where you want to mount. - Unmounting: Use the
`umount` command: ```bash umount /mnt/mount_point ``` Note: Ensure no processes
are using the filesystem before unmounting to avoid errors. ---
Networking in Unix Production Support
8. How do you verify network connectivity between servers?
Answer: Common methods include: - Ping: Checks reachability: ```bash ping ``` -
Traceroute: Tracks the path packets take: ```bash traceroute ``` - Telnet or nc (netcat):
Tests port accessibility: ```bash telnet ``` or ```bash nc -zv ``` - Netstat: Displays
active network connections: ```bash netstat -an ```
9. How do you troubleshoot DNS resolution issues?
Answer: Steps include: - Check if DNS is reachable: ```bash nslookup ``` - Verify
`/etc/resolv.conf` contains correct nameserver entries. - Use `dig` to analyze DNS
responses: ```bash dig ``` - Confirm no firewall rules block DNS traffic. Proper DNS
resolution is critical for application connectivity and troubleshooting network-related
problems. ---
Security and Access Management
10. How do you check for unauthorized access or suspicious activity?
Answer: Monitoring logs and processes is essential: - Review `/var/log/auth.log` or
`/var/log/secure` for login attempts. - Use `last` to see recent logins: ```bash last ``` -
Check for unusual processes with `ps` or `top`. - Use `netstat` or `ss` to identify
unexpected network connections. - Employ intrusion detection tools like `AIDE` or
Unix Interview Questions For Production Support
9
`OSSEC` for ongoing monitoring.
11. How do you manage user permissions and roles?
Answer: - Use `chmod` to set file permissions: ```bash chmod 755 filename ``` - Use
`chown` to change ownership: ```bash chown user:group filename ``` - Manage user
roles via groups: ```bash groupadd usermod -aG ``` - Ensure principle of least privilege
is followed, granting only necessary permissions. ---
Automation and Scripting in Production Support