Sudo cannot be used

Source: Internet
Author: User
Sudo cannot be used. after installing the system today, I found that my sudo command is not working properly. the general situation is as follows :....... wetrustyouhavereceivedtheusuallecturefromthelocalSystemAdministrator. itusuallyboilsdow... sudo cannot be used. after installing the system today, I found that my sudo command is not working properly. the general situation is as follows :....... we trust you have got ed the usual lecture from the local System Administrator. it usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes Great responsibility ....... later, I found the relevant information on the internet. the specific solution is as follows: 1. log on to the root mode using su-2. change the sudoers permission of the file to writable: chmod 740/etc/sudoers3, use vi to open the sudoers File: vi/etc/sudoers4, press enter at root ALL = (ALL) ALL, and write username ALL = (ALL) in another line) ALL5. save and exit 6. change the sudoers permission to the default 440: chmod 440/etc/sudoers7. exit the root mode and run the sudo test. pass! Note: If you do not need to enter the password when using sudo, you can change the four fields to: username ALL = NOPASSWD: ALL. Complete example: #/etc/sudoers # This file MUST be edited with the 'Usually do 'command as root. # See the man page for details on how to write a sudoers file. # Defaults env_reset # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL = (ALL) ALL # tiger ALL = (ALL) ALL tiger ALL = NOPASSWD: ALL # Uncomment to allow members of group sudo to not need a password # (Note that later entries override this, so you might need to move # it further down) # % sudo ALL = NOPASSWD: ALL
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.