Configure sudo in Linux

Source: Internet
Author: User

Configure sudo in Linux

Operating System: RHEL 6.4-64-bit

After configuring sudo, the root user can execute commands as the root user.

By default, normal users have full management permissions on their home directories, but do not have permission to view the files in other users' home directories.

An error is reported when you use a common user to view the directories of other users.

[Tom @ rhel64 ~] $ Pwd

[Tom @ rhel64 ~] $ Ls/root

[Root @ rhel64 ~] # Mongodo

Or

[Root @ rhel64 ~] # Vi/etc/sudoers

Append a line of content after Line 98. Refer to the root line.

Allow the tom user to execute any command anywhere

Tom ALL = (ALL) ALL

If you run the ls/root command again as a common user, the system still reports an error. If you run the sudo ls/root command, the system prompts you to enter the tom user password.

The password is correct. You can see the content in the/root directory.

[Tom @ rhel64 ~] $ Ls/root

[Tom @ rhel64 ~] $ Sudo ls/root

You do not need to enter a password when executing the command again.

[Tom @ rhel64 ~] $ Sudo ls/root

You can also use sudo to execute other commands.

The sudo configuration can also define specific commands and group members. For details, refer to/etc/sudoers.

At this time, the tom user directly views this file and has no permission to view it using the sudo command.

[Tom @ rhel64 ~] $ Tail-25/etc/sudoers

[Tom @ rhel64 ~] $ Sudo tail-25/etc/sudoers

Differences between Linux su and sudo commands

Sudo command usage

Use and enable the root account with Ubuntu sudo and su commands

Sudo: sorry, you must have a tty to run sudo

Configure sudo permissions in Linux

Temporary root permission for sudo Configuration

How to solve the problem that users cannot execute sudo in Linux

The Linux system administrator must not know the command: sudo

Sudo permission allocation

This article permanently updates the link address:

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.