Linux System Tips | For Linux system administrators useful sudoers configuration | How to configure the sudo command to not enter a password at run-times

Source: Internet
Author: User

This document tags: linux system tips configuration sudo command sudoers file Linux User Rights Internet gossip

Let's say you run a Linux system on a computer that you use on your own, like on a laptop, you need to enter a password every time you call sudo, and you'll find it tedious for the long term. Therefore, in this guide, we will describe how to configure the sudo command to run without entering a password.

This setting is done in the/etc/sudoers file, which is the default security policy using the sudo command, and is specified in the User Rights section.

Important: In the Sudeors file, the default open authenticate parameter is used for authentication purposes. If it is set, the user must be authenticated by a password (or other authentication method) before the command can be run with sudo.

However, you can override this default by using NOPASSWD (no password is required when the user calls the sudo command).

The syntax for Configuring user permissions is as follows:

    1. User_list host_list=effective_user_list tag_list command_list

which

    1. User_list-user list or user alias already set.
    2. Host_list-a host list or host alias on which the user can run sudo.
    3. Effective_user_list-List of users running with this user or alias
    4. Tag_list-a list of tags, such as nopasswd.
    5. Command_list-a list of commands or command aliases that the user runs with sudo.

To allow users (Aaronkilik in the following example) to run all commands with sudo without entering a password, open the sudoers file:

    1. $ sudo visudo

Add the following line:

    1. Aaronkilik all= (All) Nopasswd:all

For groups, use the% character in front of the group name, which means that all members of the SYS group can use sudo without a password.

    1. %sys all= (All) Nopasswd:all

To allow the user to run the specified command (/bin/kill) without a password using sudo, add the following line:

    1. Aaronkilik all= (All) nopasswd:/bin/kill

The following line allows the SYS group members to run the command using sudo:/bin/kill,/bin/rm without entering the password:

    1. %sys all= (All) nopasswd:/bin/kill,/BIN/RM


Run sudo without a password

In this article, we discuss how to configure the sudo command to run without entering a password. Don't forget to give us your thoughts on this guidance and other sudoers configurations that are useful for Linux system administrators in the comments section.

  1. written at the end: for Freedom look outside the world, as well as it this line, not to go to Google data, finally, Amway a V--PN agent. a red apricot VPN, to Google to check the information is the absolute first choice, the connection speed, the use is also convenient. I bought is 99¥ a year, through this link (http://my.yizhihongxing.com/aff.php?aff=2509) registered after the Member center to lose the coupon code, split down, only 7 yuan per month, special benefits.

    This document tags: linux system tips configuration sudo command sudoers file Linux User rights internet gossip

    Turn from SUN's BLOG-focus on Internet knowledge, share the spirit of the Internet!

    Linux System tips | For Linux system administrators useful sudoers configuration | How to configure the sudo command to not enter a password at run- times

    Related reading: Aaron swartz– The internet genius of the life course: every moment asked himself, now the world what is the most important thing I can participate in doing? "
    Related reading: " site environment Apache + PHP + mysql xampp, how to implement a server on the configuration of multiple sites?" "

    Related reading: What is the engineer culture? Why are the engineers alive? Why do I need an engineer culture as an IT or internet company? "

    Related reading: useful for programmers: 2017 latest in Google's Hosts file download and summary of the various hosts encountered the problem of the solution and configuration of the detailed

    related reading: the Win10 perpetual activation tutorial and how can I see if the Windows system is permanently activated? 》

    Related blog:SUN ' S blog -Focus on Internet knowledge and share the spirit of Internet! Go and see:www.whosmall.com

Original address: http://whosmall.com/?post=197

Linux System Tips | For Linux system administrators useful sudoers configuration | How to configure the sudo command to not enter a password at run-times

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.