less than 1 minute read

  1. Functionality
    • /usr/sh/su:
      • Switches you completely to another user account.
      • You inherit the new user’s environment, including their shell (sh in this case) and permissions.
      • Requires the password of the target user.
    • sudo:
      • Elevates privileges for a specific command only.
      • Executes the command in your current shell environment with root permissions.
      • Requires your own password (unless configured differently).
  2. Security:
    • /usr/sh/su:
      • Highly insecure: Grants full access to the target user’s account, including files, programs, and configurations.
      • Can be easily misused for malicious purposes if the password is compromised.
      • Not recommended for everyday tasks.
    • sudo:
      • More secure: Limits privilege escalation to the specific command you execute.
      • Reduces the potential damage if misused.
      • Provides finer-grained control through configuration files like /etc/sudoers.
      • Preferred for granting temporary administrative privileges.