1. User and Group Management
Managing users and groups is a fundamental task for system administrators.
- Creating users:
useradd
- Modifying users:
usermod
- Deleting users:
userdel
- Creating groups:
groupadd
- Modifying groups:
groupmod
- Deleting groups:
groupdel
# Example: Create a new user
sudo useradd -m -s /bin/bash newuser
# Add user to a group
sudo usermod -aG sudo newuser
2. File System Management
Understanding and managing the file system is crucial for system administration.
- Mounting/unmounting file systems:
mount, umount
- Checking disk usage:
df, du
- File system consistency check:
fsck
- Creating file systems:
mkfs
# Check disk usage
df -h
# Check directory size
du -sh /path/to/directory
# Create an ext4 file system
sudo mkfs.ext4 /dev/sdb1
3. Process Management
Monitoring and controlling processes is essential for system performance and troubleshooting.
- Viewing processes:
ps, top, htop
- Killing processes:
kill, pkill
- Process priorities:
nice, renice
# View all processes
ps aux
# Kill a process by PID
kill -9 1234
# Change process priority
renice -n 10 -p 1234
4. System Monitoring and Logging
Keeping track of system performance and logs is crucial for maintaining system health.
- System logs:
/var/log directory
- Monitoring tools:
sar, vmstat, iostat
- Log rotation:
logrotate
# View system logs
sudo tail -f /var/log/syslog
# Check system activity
sar -u 1 5
5. Networking
Configuring and troubleshooting network connections is a key skill for system administrators.
- Network configuration:
ifconfig, ip
- Network troubleshooting:
ping, traceroute, netstat
- Firewall management:
iptables, ufw
# Configure network interface
sudo ip addr add 192.168.1.100/24 dev eth0
# Check open ports
sudo netstat -tuln
6. Package Management
Keeping the system updated and managing software is essential for security and functionality.
- Debian/Ubuntu:
apt, dpkg
- Red Hat/Fedora:
yum, dnf, rpm
- Arch Linux:
pacman
# Update package list and upgrade (Ubuntu)
sudo apt update && sudo apt upgrade
# Install a package (Fedora)
sudo dnf install package_name
7. Backup and Recovery
Regular backups and knowing how to recover systems are crucial for data integrity and disaster recovery.
- Backup tools:
rsync, tar, dd
- Backup strategies: full, incremental, differential
- Testing backups and recovery procedures
# Create a backup using rsync
rsync -avz /source/directory /destination/directory
# Create a compressed archive
tar -czvf backup.tar.gz /path/to/directory
Warning:
Always be cautious when performing system administration tasks, especially those involving critical system files or configurations. Make sure to have backups and understand the implications of your actions.
Further Learning
System administration is a vast field. Consider exploring these related topics: