“-bash: sudo: command not found” Error and Solution For Linux, Debian, CentOS

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/bash-sudo-command-not-found-error-solution-linux-debian-centos/
PINTEREST
PINTEREST
INSTAGRAM

sudo  command is used to execute command as another user. This is generally used to run command as root. In some cases we can get an error like -bash:sudo:command not found which means sudo is not installed. In this tutorial we will look different ways and distributions to solve this problem.

Install Sudo For Debian, Ubuntu, Mint, Kali

We can install sudo for Debian, Ubuntu, Mint and Kali related distributions for deb or apt with the following command. But before we should be root user because package installation requires root privileges.

Install Sudo For CentOS, Fedora, RHEL

We can install sudo for CentOS, Fedora and RHEL related distributions for rpm or yum with the following command. But before we should be root user because package installation requires root privileges.

Add User Sudoers Configuration File

sudo command provides fast way to change root user. But this is done with a configuration file locate /etc/sudoers . sudoers file contains users and their ability to run sudo command. Most of the distributions automatically adds user to this file but in some cases this may fail. We can add following line to make user able to run sudo . In this example we will use user name ismail

Become Another User

While using sudo if we need to change user other than root we should provide the user name after the sudo command . In this example we will change to the user ali

LEARN MORE  How To Allow Normal User Run Commands As Root In Linux?

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)