Home>Article>Operation and Maintenance> How to solve the problem that sudo command cannot be found under centos
How to solve the problem that the sudo command cannot be found under centos?
1. Problem description
Scenario:
Execute the following command
$ ssserver -p 443 -k password -m rc4-md5
It prompts insufficient permissions.
So add sudo before the command:
$ sudo ssserver -p 443 -k password -m rc4-md5
It prompts that the command cannot be found.
2. Solution
Switch to the root user and edit the file /etc/sudoers as the root user:
# vim /etc/sudoers
FindDefaults env_reset
, change it toDefaults !env_reset
,
thenwq!
Force save and exit.
Then, switch back to a normal user, such as the user name is xx, edit the configuration file in the user root directory ~/.bashrc
# su xx $ vim .bashrc
Append
alias sudo='sudo env PATH=$PATH'
at the end of the file , Make the configuration file take effect
$ source ~/.bashrc
Test whether the sudo execution command is normal
$ sudo ssserver -p 443 -k password -m rc4-md5 --user nobody -d start 2016-11-28 12:15:45 INFO loading libcrypto from libcrypto.so.10 started $
Related references:centOS tutorial
The above is the detailed content of How to solve the problem that sudo command cannot be found under centos. For more information, please follow other related articles on the PHP Chinese website!