RackNerd Billboard Banner

How to fix Su: Authentication Failure and Sudo: Permission denied Prompt in Ubuntu

If you’re getting hit with su: Authentication failure or sudo: Permission denied in Ubuntu, it means your user doesn’t have the rights it needs — and Ubuntu’s security model is doing its job a little too well.

Don’t worry — this is fixable. Let’s break down what’s happening and how to get your permissions back on track.


What These Errors Actually Mean

su: Authentication failure

This pops up when you try to run su to switch to the root user, but your password doesn’t cut it. On Ubuntu, su wants the root password, which is disabled by default.

sudo: Permission denied

This usually means your user is not in the sudo group and therefore doesn’t have permission to run commands with elevated privileges.


Fix #1: Use sudo Instead of su

Ubuntu disables the root account by default and prefers sudo for security. So if you’re trying to run something like:

su

Don’t. Instead, run:

sudo -i

This gives you a root shell — if your user has sudo rights.


Fix #2: Add Your User to the Sudo Group

If sudo is giving you the cold shoulder, it’s probably because your user isn’t part of the sudo group.

Here’s how to fix that:

  1. Reboot into recovery mode:
    • Restart your machine.
    • Hold Shift or press Esc during boot to open the GRUB menu.
    • Select Advanced options for Ubuntu, then pick the recovery mode option.
    • Choose Root – Drop to root shell prompt.
  2. Remount with write access:
mount -o remount,rw /
  1. Add your user to the sudo group:
usermod -aG sudo yourusername

(Replace yourusername with your actual username.)

  1. Reboot:
reboot

Now try running a command with sudo. You should be good.


Fix #3: Set or Reset the Root Password (Not Recommended, but Possible)

If you absolutely must use su for some reason, you can manually set a root password:

sudo passwd root

You’ll be prompted to enter a new password for root. But be careful — enabling the root account weakens your system’s security. Use this only if you know what you’re doing.


Bonus Tip: Check the Sudoers File (Carefully)

If you suspect deeper issues:

sudo visudo

This opens the sudoers file safely. Make sure there’s a line like:

%sudo   ALL=(ALL:ALL) ALL

And confirm your user is in the sudo group with:

groups yourusername

Wrap-Up

Ubuntu’s permission system is built to protect you — but when access breaks, it can be frustrating. Stick to sudo, make sure your user is in the right group, and only fall back to root access if you’re absolutely sure it’s necessary.

Need more help? Drop a comment below or shoot me a message — happy to walk you through it.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
0
Would love your thoughts, please comment.x
()
x
Copy link