Set normal users to sudo permissions in Fedora18

Source: Internet
Author: User
Add a general user to the sudo group isnotinthesudoersfile. Thisincidentwillbereported under Fedora18. the solution is to run the sudo command under a general user and prompt "Forbidden. Thisincidentwillber Fedorasudo"

Adding a general user to the sudo group in Fedora 18 is not in the sudoers file. This incident will be reported.

Solution

If you run the sudo command under a common user, the prompt xxx is not in the sudoers file. This incident will be reported. solution:

$ Whereis sudoers ------- locate the file location, which is/etc/sudoers by default

Sometimes we only need to execute a command with the root permission to su to the root, isn't it inconvenient? In this case, sudo can be used instead. By default, the new user is not in the sudo group. you need to edit the/etc/sudoers file to add the user. the file can only use the mongodo command,

1) first switch to root, su-(note that there is-, which is different from su. when using the "su" command, it only switches to root, however, if the root environment variable is not passed, it is still the currently used environment variable. use the "su-" command to bring the environment variable together, just like root login)

2) then mongodo, vim/etc/sudoers, and mongodo are used in the same way as vi. some people may be unfamiliar with vi, so let's take a brief look at the steps.

Move the cursor to the next row of a row of root ALL = (ALL) ALL, press I, insert mode, and enter

Your_user_name ALL = (ALL) ALL

Then press Esc,

Enter ":"

Enter: wq

Save and exit

In this way, you can add yourself to the sudo group and use the sudo command.

3) by default, the sudo password just entered five minutes later expires. next time, sudo needs to re-enter the password. if it is difficult to enter the password during sudo, replace the entered password with the following content:

Your_user_name ALL = (ALL) NOPASSWD: ALL

Note: When saving and exiting, the system will prompt that/etc/sudoers is a read-only file and cannot be saved and exited. you only need to log on to wq! Force save and exit.

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.