Saturday, 29 November 2025

Linux Operating System UBUNTU 25 _ Create user to have root privileges or superuser privileges

 

 Hi Copilot , I am running Linux UBUNTU 25 on my PC/Desktop and I have created a new user account for my daughter by running a Linux command that look something like this , that is , "# adduser norizan" .......... the problem is when I am under the user "norizan" and when I try to go under superuser mode by doing "su" ......... I cannot get administrator priviliges to do so .......... so Copilot, how can I give administrator privileges to the user "norizan" so that I can run a few SysAdmin commands under the user "norizan" ? THANKS Copilot for the answer.

 

MICROSOFT Copilot Answer 

 

<Greeting> Hey there! Ready to go beyond search results? I can analyze, create, and problem solve with you. </Greeting>

Got it — you’ve created the user norizan with adduser, but right now that account doesn’t have administrator (sudo) privileges. On Ubuntu, the correct way to grant admin rights is to add the user into the sudo group (sometimes called admin on older releases). Here’s how you can do it:


✅ Steps to give norizan administrator privileges

  1. Log in as root or a user with sudo rights
    Since norizan doesn’t yet have sudo, switch back to your original account (the one you used to create her) or log in as root.

  2. Add norizan to the sudo group
    Run this command:

    sudo usermod -aG sudo norizan
    
    • usermod modifies the user account.
    • -aG sudo means “append this user to the group sudo.”
  3. Verify group membership
    After that, check if norizan is in the sudo group:

    groups norizan
    

    You should see sudo listed among the groups.

  4. Log out and back in
    Group membership changes only take effect after the user logs out and back in. So have norizan sign out and log in again.

  5. Test sudo access
    Switch to norizan and try:

    sudo whoami
    

    It should prompt for norizan’s password and then return root.


⚠️ Important notes

  • On Ubuntu, su alone won’t work unless you know the root password (which is usually disabled by default). Instead, you use sudo before commands.
  • If you really want su to work, you’d need to set a root password with:
    sudo passwd root
    
    But the recommended way on Ubuntu is to stick with sudo.

Would you like me to also show you how to make norizan a full root-equivalent account (with passwordless sudo), or do you prefer keeping it safer with password prompts?

 

 

 

 

No comments:

Post a Comment