1.9 Identify common features and tools of the Linux client/desktop operating system.
📘CompTIA A+ Core 2 (220-1202)
Administrative Commands in Linux: su and sudo
Linux is a multi-user operating system. Some tasks need higher-level permissions, meaning you need administrative or “root” access. Regular users cannot perform these tasks for security reasons. Two main commands give you administrative access: su and sudo.
1. su – Switch User (or Superuser)
Purpose:
- The
sucommand stands for “substitute user” or “switch user”. - It allows you to switch to another user account temporarily. By default, it switches to the root user, which is the system administrator.
Usage Example:
su
- When you type this, Linux will ask for the root user’s password.
- After entering the password, you are now operating as the root user and can perform administrative tasks.
Key Points:
sugives you full root privileges, which is powerful but also risky because mistakes can affect the whole system.- You can also switch to a different user without using root:
su username
- This switches to
usernameinstead of root, and you must provide that user’s password.
When it’s used in IT environments:
- Logging in as root to install software or update system files.
- Switching users to troubleshoot problems under a specific account.
2. sudo – Superuser Do
Purpose:
- The
sudocommand stands for “superuser do”. - It allows a regular user to execute a single command with administrative privileges without fully switching to the root account.
Usage Example:
sudo apt update
- This command updates the package list on a Linux system.
- Linux will ask for your own password, not the root password.
- Only users listed in the sudoers file can use
sudo.
Key Points:
sudois safer thansubecause it limits administrative access to a single command instead of giving full root access.- The system logs every
sudocommand, which helps track changes for security. - You can chain multiple commands using
sudoif needed:
sudo mkdir /opt/newfolder
sudo nano /etc/configfile
When it’s used in IT environments:
- Installing software packages (
sudo apt install package-name). - Changing system settings files (
sudo nano /etc/hostname). - Restarting services (
sudo systemctl restart apache2).
Key Differences Between su and sudo
| Feature | su | sudo |
|---|---|---|
| Full root access | Yes | No (only for that command) |
| Password required | Root user’s password | Your own password |
| Security risk | Higher | Lower (limited scope, logged actions) |
| Typical use case | Switch to root or another user | Run a single command as root |
| Logging | Not automatically logged | Logged for auditing |
Tips for the Exam
- Remember:
su= switch user (full root access),sudo= superuser do (temporary admin for one command). - Know password requirements:
suuses root password,sudouses user password. - Understand security implications:
sudois safer in multi-user environments. - Typical commands you might see in Linux exams:
sudo apt update→ update package listssudo systemctl restart service→ restart a servicesu -→ switch to root
✅ Summary:
suallows switching fully to root (or another user) — powerful but risky.sudoallows running single commands as root — safer and auditable.- Both are essential administrative tools in Linux for IT professionals.
