Administrative

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 su command 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:

  • su gives 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 username instead 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 sudo command 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:

  • sudo is safer than su because it limits administrative access to a single command instead of giving full root access.
  • The system logs every sudo command, which helps track changes for security.
  • You can chain multiple commands using sudo if 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

Featuresusudo
Full root accessYesNo (only for that command)
Password requiredRoot user’s passwordYour own password
Security riskHigherLower (limited scope, logged actions)
Typical use caseSwitch to root or another userRun a single command as root
LoggingNot automatically loggedLogged for auditing

Tips for the Exam

  1. Remember: su = switch user (full root access), sudo = superuser do (temporary admin for one command).
  2. Know password requirements: su uses root password, sudo uses user password.
  3. Understand security implications: sudo is safer in multi-user environments.
  4. Typical commands you might see in Linux exams:
    • sudo apt update → update package lists
    • sudo systemctl restart service → restart a service
    • su - → switch to root

Summary:

  • su allows switching fully to root (or another user) — powerful but risky.
  • sudo allows running single commands as root — safer and auditable.
  • Both are essential administrative tools in Linux for IT professionals.
Buy Me a Coffee