Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize password-free setting of su and sudo in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to achieve su and sudo password-free settings in linux, which is very detailed and has a certain reference value. Interested friends must read it!

It is troublesome to enter the password when sudo. Just replace the input with the following:

Your_user_name ALL= (ALL) NOPASSWD: ALL

Note: sometimes you set the user nopasswd, but it doesn't work because it is overridden by the later group setting.

You need to change the setting of group to nopasswd as well.

Your_user_name ALL= (ALL) NOPASSWD: ALL

% admin ALL= (ALL) NOPASSWD: ALL

Set su to not require a password

If you do not need to enter a password for a user's su command, you need to change the following:

Switch to root permission

Create group as wheel and command as groupadd wheel

Add the user to wheel group with the command usermod-G wheel your_user_name

Modify the configuration file / etc/pam.d/su of su by adding the following:

Auth required pam_wheel.so group=wheel # Uncomment this if you want wheel members to be able to# su without a password.auth sufficient pam_wheel.so trust use_uid

At this point you can use the su root command without entering a password.

These are all the contents of this article entitled "how to achieve password-free settings for su and sudo in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report