Listen to this Post
2025-02-06
This training manual aligns with the objectives of the LPI-101 (LPIC-1, version 4.0) certification exam by the Linux Professional Institute. Below are practical commands and codes to help you master Linux system and user administration.
User Management Commands
1. Create a User
sudo useradd -m username sudo passwd username
This creates a new user and sets a password.
2. Delete a User
sudo userdel -r username
The `-r` flag removes the user’s home directory and mail spool.
3. Modify User Properties
sudo usermod -aG groupname username
Adds a user to a supplementary group.
4. Check User Information
id username
Displays user ID, group ID, and group memberships.
System Management Commands
1. Check System Information
uname -a
Displays kernel version and system details.
2. Monitor System Processes
top
Provides real-time system process monitoring.
3. Manage Services
sudo systemctl start servicename sudo systemctl stop servicename sudo systemctl restart servicename
Controls system services.
4. Disk Usage Analysis
df -h du -sh /path/to/directory
`df` shows disk space usage, while `du` provides directory size.
File Permissions and Ownership
1. Change File Permissions
chmod 755 filename
Sets read, write, and execute permissions for the owner, and read/execute for others.
2. Change File Ownership
sudo chown username:groupname filename
Transfers ownership of a file to a specific user and group.
Networking Commands
1. Check Network Interfaces
ip a
Displays all network interfaces and their configurations.
2. Test Network Connectivity
ping google.com
Checks connectivity to a remote host.
3. Scan Open Ports
sudo nmap -sS 192.168.1.1
Scans for open ports on a target IP address.
What Undercode Say
Linux administration is a critical skill for IT professionals, especially those pursuing LPIC-1 certification. Mastering user and system management commands is essential for maintaining secure and efficient systems. Here are additional commands to enhance your Linux expertise:
- Check Logs: Use `journalctl` to view system logs.
- Schedule Tasks: Use `crontab -e` to edit cron jobs.
- Secure SSH: Modify `/etc/ssh/sshd_config` to disable root login.
- Backup Data: Use `rsync` for efficient file synchronization.
- Monitor Network Traffic: Use `tcpdump` for packet analysis.
For further reading, visit the Linux Professional Institute and Linux Documentation Project.
By practicing these commands, you’ll gain confidence in managing Linux systems and users, preparing you for real-world IT challenges and certification exams.
References:
Hackers Feeds, Undercode AI