Linux

SU Authentication Fix: Sudo Permission Denied in Ubuntu

Slide2-1

In this short guide, you will learn how to fix the SU authentication Failure in Linux. With this error, you will also encounter the Permission denied message when trying to carry out any installation with sudo permission. In Linux, there are different types of users, and sudo or the root user is one of such users but a user with full permission to execute any command in Linux. We will discuss “SU Authentication Fix: Sudo Permission Denied in Ubuntu”. Please see How to switch users in Linux, How to Switch between Users in Linux, and How to Restrict Access to USB Drives.

What does Sudo mean?

Sudo means superuser do. The superuser account is the account with unrestricted permissions and privileges. Take a look at the following related posts on How to Create Symbolic Links in Linux, How to Install Terraform on Linux, How to install Apache Tomcat on Ubuntu, and How to fix “Failed to open session in VirtualBox to install Windows 11 Image”

From the screenshot below, we’re are trying to switch user (su) SU authentication to the root account so we can execute any command without a password prompt.

Secondly, since the su command failed, we also tried to become root by running the sudo -i command but we encountered the Permission denied prompt. Thirdly, we tried to run the installation of the aptitude command using the usual sudo apt install aptitude command, we still faced the Permission denied prompt.

Superuser Authentication
Su: Authentication Failure

One of the things to note in Linux, su, and sudo commands fails with an SU authentication failure and “Permission denied” since the root account is blocked by default in Ubuntu, and the root account doesn’t have a password that’s why whenever we try to execute any command we’re prompted for a password.

For best practice, it is not recommended to grant sudo permission to every user as doing so may pose danger to your system.

Let's get the issue fixed! Before fixing this, we will first look at the cause of the problem. 

Cause of the problem:

This problem usually occurs when you change the ownership of/usr/bin from root to an ordinary user or you have mistakenly granted both the owner, the group and others the full permission to read, write and execute (rwxrwxrwx) to the /usr/bin directory by running sudo chmod 777 /usr/bin/ or by granting the owner and the group the SU authentication same permission to read and write (chmod 770 /usr/bin) to the /usr/bin directory with sudo power.

By default the Root account in Linux OS doesn’t have password as mentioned earlier. So any attempt to alter the standard settings of the core filesystem will automatically disable all access to the sudo or root account until it is recovered.

With the incident described above, whenever you try to execute  any of the following commands: su root, sudo -i, $sudo chown root /usr/bin and chmod 4755 /usr/bin/sudo or any task that requires the superuser or root privileges to be executed, you will encounter the above error-, and even the (SU authentication) chmod: changing permissions of '/usr/bin/sudo': operation not permitted error as well.

You might be interested in this: Ubuntu Linux: Create Multiple Users with Passwords, and Folder Access Denied, you require permission from SYSTEM: Unable to delete old windows folder.

Solution for SU authentication

Step 1: Restart your PC. Boot into Ubuntu Recovery Console, and press and hold the SHIFT key while booting. It will take you to the grub loader page as shown in the screenshot below.

Root Access Authorization
Entering the Ubuntu Recovery Console

Sometimes getting into the grub loader menu using the SHIFT key could be a little bit tricky mostly when you’re running your SU authentication Ubuntu on VirtualBox or VMWare. So you need to start pressing the shift key immediately the VirtualBox screen displays.

Step 2: Select and enter Advanced options for Ubuntu, from there select the kernel named as recovery mode as shown in the screenshot below:

Admin Authentication
Recover Mode

Step 3: Select root – by dropping to the root shell prompt as shown in the screenshot SU authentication

Sudo Authentication
Root Kernel

Step 4: Now the file system is read-only. Remount to Read-Write by running the command below:

# mount -o remount,rw /

Now we need to mount –all

Mounting all requires us to change the ownership for sudo. To do so run the below command:

# chown root:root /usr/bin/sudo

Grant permission for sudo by running:

# chmod 4755 /usr/bin/sudo

Now, the deal is done and SU authentication should be back by now. Let’s restart the PC by running the below command.

# shutdown -r now

The summary of all the commands ran above is shown in the screenshot below. Note: you’re to go with the “Press Enter for Maintenance prompt

Cammands-to-recover-your-OS

The outcome of SU authentication

After restarting our PC, we have the Sudo back and we can run the sudo-i command as well as run the aptitude command installation without the SU authentication Failure error prompt as shown in the screenshot below.

Root-account-Restored
Sudo Restored

That’s all..! I hope you found this blog post helpful on SU Authentication Fix: Sudo Permission Denied in Ubuntu. If you have any questions, please let me know in the comment session.

Subscribe
Notify of
guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
timitar
timitar
1 year ago

very nice

hot dog
hot dog
11 months ago

thank you so much.

Kaennex
Kaennex
10 months ago

Thank you sir, it did help me and my mates a lot, it is well written so that it is easy to understand

3
0
Would love your thoughts, please comment.x
()
x