sudo: sudosh: command not found on RHEL 8.1

Latest response

I have encountered this error after upgrading my RHEL from 8 to 8.1. Anyone has similar experience?

sudo: sudosh: command not found

Responses

Hi Shisheer,

Can you provide details of the complete SUDO command you are trying to run?

It appears you are trying to run some command with name "sudosh". If so, verify if the command exists:

# updatedb && locate sudosh

Regards,

Dusan Baljevic (amateur radio VK2COT)

Shisheer,

ADDED/UPDATED Sisheer, I could not find "sudosh" for RHEL 8. Did you install it from a different repository that was not from Red Hat? Or did you perhaps mean you are attempting to run sudo sh? It is generally a bad practice to give a sudo rule to a shell of any kind. This effectively bypasses sudo control and effectively gives root to the person with such a non-best-practice sudo rule. See the pdf link to a very good guide in my next post if you really did mean sudo sh and not sudo sudosh.

If you really intend to allow someone you legitimately trust to have sudo root access, consider adding them to the %whell directive in the /etc/sudoers file, and add them to the wheel group in /etc/group. Make sure it is documented if you are in a corporation with whatever person or office is responsible for security.

Please also try this command along with the good tips from Dusan above (Thanks Dusan).

spoiler This next command produced nothing on my brand new RHEL 8.1 system I built yesterday with proper subscriptions and repositories. However, it is useful when you want to find an rpm for any given command and you're not sure where the command is located.

yum provides */sudosh

Before doing that command know that "sudosh" is probably not provided standard from Red Hat:

  • Make sure your network is active (try pinging ping www.google.com (if you can see the public internet, or pick some other reasonable ping choice).
  • Make sure your system is properly subscribed (if it isn't already) with subscription-manager status
  • Make sure your yum repositories work with yum repolist and that it produces valid results (repos with a number of rpms in each repository)

Regards

RJ

Shisheer,

The man page for sudoers is one of the best documented man pages in existence.

If your issue persists, please post the relevant portion of your /etc/sudoers file (you do not have to post the entire file) here for us to help further.

# quick way for bob to use systemctl
# This would allow the user bob on the system 192.168.0.222 to run systemctl for httpd
bob 192.168.0.222 = (root) /bin/systemctl [-A-Za-z]* httpd

The above example assumes only the need for one sudo directive for one user. If you intend on allowing this for many users, you may wish to create the proper use of "User_Alias, Host_Alias, Cmnd_Alias and Runas_Alias, then making a proper line for that. The man page for sudoers is actually quite helpful!

Note here is a relevant guide from 2014 on avoiding common pitfalls with sudo. This is a very effective guide even though it is from 2014 that will enable a security conscious admin avoid many pitfalls.

Regards

RJ