John November 23, 2025 0

Prerequisites

  • You must have root access (root password or console access).
  • The system must use APT (Debian/Ubuntu).

Guide

  1. Switch to the root user
Bash
su -
  1. Update the system
Bash
apt upgrade
apt install sudo
  1. Install sudo
Bash
apt install sudo
  1. Add your user to the sudo group
Bash
usermod -a -G sudo [username]
  1. Apply the group change
Bash
su [username]
  1. Test Sudo

Run the following commands:

Bash
sudo whoami

If it prints:

Bash
root

You’re done!

Category: 

Leave a Comment