Answers to all the Linux Server Administration questions
Remembering
1. Purpose of the Linux file system:
To organize and store data, programs, and configuration files in a
hierarchical directory structure.
2. Command to list files in a directory:
ls
3. What ‘pwd’ displays:
Prints the current working directory path.
4. Three common Linux server distributions:
Ubuntu Server, CentOS, Debian.
5. Command to add a new user:
useradd <username>
6. Meaning of UID:
User Identifier.
7. Default directory for user home directories:
/home
8. Function of ‘chmod’:
Changes file or directory permissions.
9. Command to show logged-in users:
who or w
10. Full meaning of CPU:
Central Processing Unit.
Understanding
1. Difference between ‘ls’ and ‘ls -la’:
ls lists files and directories; ls -la lists all, including hidden files, with
detailed information.
2. Importance of file permissions:
They control who can read, write, or execute files, protecting system
security.
3. Difference between ‘cd..’ and ‘cd ~’:
cd.. moves up one directory; cd ~ moves to the user’s home directory.
4. Purpose of ‘/etc/passwd’:
Stores user account information such as usernames, UIDs, home
directories, and shells.
5. How Linux manages user and group access:
Through permissions (read/write/execute) assigned to users, groups,
and others.
6. Purpose of ‘top’:
Displays real-time system processes, resource usage, and
performance.
7. Difference between ‘root’ and ‘regular user’:
Root has full system privileges; regular users have limited access.
8. What happens with ‘sudo’:
Executes a command with root privileges temporarily.
9. When the system runs out of memory:
The kernel may use swap space or kill processes (OOM killer).
10. Why hidden files start with a dot (.):
To prevent accidental modification or deletion of configuration files.
Applying
1. Create ‘projects’ directory:
mkdir ~/projects
2. Change file to read-only for all:
chmod 444 filename
3. Display all running processes:
ps -ef or top
4. Add group ‘developers’:
groupadd developers
5. View disk usage (human-readable):
df -h
6. Create user ‘John’:
useradd -m -d /home/John John
7. Change group ownership to ‘admins’:
chown :admins filename
8. List installed software packages:
o Debian-based: dpkg -l
o RedHat-based: rpm -qa
9. Set up daily cron job at midnight:
crontab -e
Add:
0 0 * * * /path/to/[Link]
10. Change hostname:
hostnamectl set-hostname newname
Analyzing
1. ‘useradd’ vs ‘usermod’:
useradd creates a user; usermod modifies an existing one.
2. Soft link vs hard link:
Soft link = shortcut to file (can cross file systems).
Hard link = duplicate inode (cannot cross file systems).
3. Impact of improper file permissions:
Can lead to unauthorized access, data leaks, or security breaches.
4. Identify memory-hungry process:
top → sort by %MEM or use ps aux --sort=-%mem | head
5. Structure of ‘/etc/group’:
group_name:x:GID:user_list
6. Risks of using root daily:
Increased chance of system damage or security compromise.
7. Debian vs RedHat package managers:
Debian uses apt/dpkg; RedHat uses yum/dnf/rpm.
8. System logs in ‘/var/log’:
Store system, application, and security logs for troubleshooting.
9. Why ‘cron’ might fail:
Incorrect permissions, environment variables, or script paths.
10. File ownership and collaboration:
Proper ownership ensures shared access without overwriting or
security risks.
⚖️Evaluating
1. Weak root passwords:
Pose severe security risks—allow unauthorized access.
2. Advantages of cron automation:
Reduces manual workload, ensures consistency, improves reliability.
3. SSH over FTP:
SSH encrypts data; FTP transmits plain text.
4. Effectiveness of user groups:
Simplify access control and management of permissions.
5. Graphical vs command line:
GUI is easier for beginners; CLI is faster, more flexible, and scriptable.
6. Is Linux more secure?:
Generally yes—open-source auditing, permission model, and fewer
targeted attacks.
7. Resource monitoring improves performance:
Detects bottlenecks early and helps optimize resource usage.
8. Importance of documentation:
Helps maintenance, troubleshooting, and continuity.
9. Using ‘chmod 777’:
Unsafe—grants full access to everyone; risk of tampering.
10. Importance of backups:
Prevents data loss due to corruption, deletion, or attacks.
Creating
1. Simple backup script:
2. #!/bin/bash
3. tar -czf /backup/home_backup_$(date +%F).[Link] /home
4. User/group organization strategy:
Create groups by department (e.g., HR, IT, Finance), assign users
accordingly, and set group-based permissions.
5. Automate weekly log cleanup:
6. 0 0 * * 0 find /var/log -type f -mtime +7 -delete
7. Guide for navigating directories:
Use ls, cd, pwd, cat, and man for exploring and understanding files.
8. Security plan for user permissions:
Apply least privilege principle, strong passwords, sudo usage, and
auditing.
9. Troubleshooting checklist:
Check connectivity (ping), IP (ifconfig), DNS (nslookup), and logs
(/var/log/messages).
10. Cron for daily maintenance:
0 2 * * * /usr/local/bin/[Link]
11. Naming convention:
Use lowercase, short descriptive names (e.g., user: [Link],
directory: /home/projects_web).
12. Linux training plan:
Cover commands (ls, cd, cp, mv, chmod), permissions, processes, and
networking basics.
13. Safe shutdown/reboot guide:
sudo shutdown -h now (halt)
sudo reboot (restart)