Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

System Administrator Privileges

Lesson 7 of 32 in the free Design of Unix Operating System notes on Siksha Sarovar, written by Rohit Jangra.

Introduction

A System Administrator (sysadmin) is responsible for maintaining, configuring, and ensuring the reliable operation of a UNIX system. The system administrator has special privileges and uses the root (superuser) account to manage the system.

The Root User (Superuser)

  • The root user has UID (User ID) = 0.
  • Root has unrestricted access to all files, commands, and system resources.
  • The root prompt is typically # while a normal user prompt is $.
  • Caution: Using root carelessly can damage the system. Always use with care.

Accessing Root Privileges

1. Direct Login as Root:

  • Login with username root and its password.
  • Not recommended for security reasons.

2. Using su (Switch User):

  • su — Switches to root user (requires root password).
  • su - username — Switches to a specific user.

3. Using sudo (Superuser Do):

  • Allows a permitted user to execute a command as root.
  • sudo command — Runs a single command with root privileges.
  • The user must be listed in the /etc/sudoers file.
  • Preferred method as it provides an audit trail.

Key System Administration Tasks

1. User Management:

  • useradd username — Create a new user.
  • userdel username — Delete a user.
  • usermod -aG group username — Add user to a group.
  • passwd username — Set or change a user's password.
  • User info is stored in /etc/passwd and /etc/shadow.

2. Group Management:

  • groupadd groupname — Create a new group.
  • groupdel groupname — Delete a group.
  • Group info is stored in /etc/group.

3. File System Management:

  • mount /dev/sda1 /mnt — Mount a file system.
  • umount /mnt — Unmount a file system.
  • df -h — Check disk space usage.
  • du -sh /path — Check size of a directory.
  • fsck /dev/sda1 — File system consistency check and repair.

4. Process Management:

  • ps aux — List all running processes.
  • top / htop — Real-time process monitoring.
  • kill PID — Terminate a process by PID.
  • kill -9 PID — Force kill a process.
  • nice -n value command — Run a process with modified priority.
  • renice value PID — Change priority of a running process.

5. System Monitoring:

  • uptime — System uptime and load averages.
  • free -h — Memory usage.
  • vmstat — Virtual memory statistics.
  • iostat — I/O statistics.
  • dmesg — Kernel ring buffer messages.

6. Backup and Recovery:

  • tar -cvf backup.tar /directory — Create a backup archive.
  • tar -xvf backup.tar — Restore from a backup.
  • cpio — Another backup utility in UNIX.
  • crontab -e — Schedule automated backups using cron jobs.

7. Network Administration:

  • ifconfig / ip addr — View network interfaces.
  • ping host — Test connectivity.
  • netstat — Network connections and statistics.
  • ssh user@host — Secure remote login.
  • scp file user@host:/path — Secure file copy.

8. System Startup and Shutdown:

  • shutdown -h now — Halt the system immediately.
  • shutdown -r now — Reboot the system.
  • init 0 — Shutdown (runlevel 0).
  • init 6 — Reboot (runlevel 6).

Important Configuration Files

FilePurpose
/etc/passwdUser account information
/etc/shadowEncrypted user passwords
/etc/groupGroup information
/etc/sudoersSudo privileges configuration
/etc/fstabFile systems to mount at boot
/etc/hostsStatic hostname to IP mappings
/etc/crontabSystem-wide cron job schedule
/var/log/syslogSystem log file
/var/log/auth.logAuthentication log

Summary

  • The system administrator manages the UNIX system using root privileges.
  • sudo is the preferred way to execute administrative commands.
  • Key tasks include user/group management, file system maintenance, process control, backup, and network administration.
  • Important config files are located in /etc/ directory.