Add normal users to The sudo group in fedora 10

Source: Internet
Author: User

In Linux, when we need to execute a command with the root permission, every time we have to Su to the root, is it always inconvenient? We can replace it with sudo. Fedora
10 by default, the new user is not in The sudo group, but the/etc/sudoers file can be edited to add normal users
Sudo Group
. Note that only the mongodo command can be used to modify the file:

1. First switch to root
# Su
-

(Note that-
This is different from Su. When the "Su" command is used, it only switches to root, but does not pass the root environment variable to the current user's environment variable, the "Su" with the horizontal line parameter is used.
-"The command also converts the environment variables together, just like using root login)

2. Then
# Mongodo

In the same way as VI, move the cursor to the last line, press a to enter append mode, and enter the following line of content.
Username
All = (all)

Then Press ESC and enter: WQ to save the file and exit, so that you can add yourself to the sudo group. You can use the sudo command.
If you do not want to enter the password during sudo, simply replace the above line with the following line:
Username
All = (all) nopasswd: All

3,

Test
Sudo

Test whether sudo is configured correctly.
, You only need to enter

$ Sudo
Whoami


If the configuration is correct, the command returns "root ".

 

Method 2:



FC 10 imposes strict permission management on users. Although it is convenient to use the root account for logon, It is not secure to the system. Generally, users can use sudo to obtain the execution right when the permission is exceeded.

After sudo is used in FC 10, the system prompts "user" is not in the sudoers file. This incident will be reported.

The prompt content shows that the current user does not belong to sudoers.

This file is stored in/etc. Of course, the current user has no access permission.

Su Root

Modify file attributes to make the file writable

Chmod U + w/etc/sudoers

VI/etc/sudoers

You can see a record.

# Allow root to run any commands anywhere

Root all = (all) All

Cspark all = (all) All

That is to say, adding the current user name is sudoers and all commands can be executed.

After being saved, the user's life can be legally used by sudo.

Restore file attributes

Chmod U-W/etc/sudoers

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.