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.
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.
Solved it. It was SElinux just being overprotective
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.