Bash: /usr/bin/sudo: Permission denied?

Hi Fedora community ,

I am facing a issue using su and sudo commands in the terminal receiving this output:

bash: /usr/bin/sudo: Permission denied

I assume Selinux is preventing an account to run /bin/su.What should I do ?

All advice is appreciated .

Could be SELinux, could be just the permissions on the file itself. First, check the files:

[mhdave@sunshine ~]$ ls -l /usr/bin/su*
-rwsr-xr-x. 1 root root  57K Jun  1 05:52 /usr/bin/su*
---s--x--x. 1 root root 186K Jan 21  2022 /usr/bin/sudo*

What is the command you are running that provides the error message? I’m guessing this may be part of your experiments in learning automation, and you could just have a command syntax / semantics issue. Copy the command and response, then paste into a reply here using the </> formatting.

1 Like

Yes, I just wanted to install Kubernets. This is the output .

$ ls -l /usr/bin/su*
-rwsr-xr-x. 1 root root  57K Jun  1 05:52 /usr/bin/su*
---s--x--x. 1 root root 186K Jan 21  2022 /usr/bin/sudo*

-rwsr-xr-x. 1 root root  58128 Jun  1 14:52 /usr/bin/su
---s--x--x. 1 root root 189616 Jan 22  2022 /usr/bin/sudo
lrwxrwxrwx. 1 root root      4 Jan 22  2022 /usr/bin/sudoedit -> sudo
---x--x--x. 1 root root  87072 Jan 22  2022 /usr/bin/sudoreplay
-rwxr-xr-x. 1 root root  37480 Aug  8 16:57 /usr/bin/sum
-rwxr-xr-x. 1 root root   1342 Jul  6 11:49 /usr/bin/sushi
bash: -rwsr-xr-x.: command not found...
bash: ---s--x--x.: command not found...

Is your user the admin and part of the wheel group? groups will tell you that.
If not a member of the wheel group then by default you cannot use sudo.
If you have not assigned a root password then you cannot use su to gain root privileges.

My user is the admin. I was using the command an hour ago. Groups out put is my user name wheel so it’s fine. I wonder what happened ?

Solved it. It was SElinux just being overprotective :laughing: :laughing:
To solve the issue. I checked the SElinux mode and than changed the modes to the default settings. Configured the SElinux settings and than again changed the work mode to the desired one + did a reboot to keep it on the safe side.Apologize , for wasting your times people. Thank you for your help as always.

1 Like

Never a waste of time. Sometimes simply asking the question triggers thought into a different path and we see the solution.
:saluting_face:

1 Like