In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "running sudo commands without entering a password in Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to run sudo commands without entering a password in Linux.
Suppose you run Linux on a computer that you only use, such as on a laptop, and you need to enter a password every time you call sudo, which will be boring in the long run. 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; in the user rights assignment section.
Important: in the sudeors file, the authenticate parameter turned on by default is used for verification purposes. If it is set, the user must authenticate with a password (or other authentication method) before running the command using sudo.
However, you can use the NOPASSWD (no password is required when the user invokes the sudo command) flag to override this default value.
The syntax for configuring user permissions is as follows:
User_list host_list=effective_user_list tag_list command_list
Where:
User_list-list of users or user aliases that have been set up.
Host_list-list of hosts or host aliases on which users can run sudo.
Effective_user_list-list of users running under that user or alias
Tag_list-list of tags, such as NOPASSWD.
Command_list-A list of commands or command aliases that the user runs using sudo.
To allow users (aaronkilik in the following example) to run all commands without entering a password using sudo, open the sudoers file:
$sudo visudo
Add the following line:
Aaronkilik ALL= (ALL) NOPASSWD: ALL
For groups, use% characters before the group name; this means that all members of the sys group can use sudo without a password.
% 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:
Aaronkilik ALL= (ALL) NOPASSWD: / bin/kill
The following line allows members of the sys group not to enter a password when running the command: / bin/kill, / bin/rm using sudo:
% sys ALL= (ALL) NOPASSWD: / bin/kill, / bin/rm
Run sudo without a password
At this point, I believe you have a deeper understanding of "running sudo commands without entering a password in Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.