码迷,mamicode.com
首页 > 系统相关 > 详细

linux设置sudo不要密码

时间:2019-06-26 12:10:12      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:这一   option   sof   any   ati   ice   umount   usr   next   

linux下,普通用户,sudo时需要密码

技术图片

改成没密码,

vi /etc/sudoers

在 root ALL=(ALL) ALL后加一行

sysusr ALL=(ALL) NOPASSWD: ALL  (92行)
并且在sysusr账号所在组:
%wheel,加上组sudo不加密码的设置(102行),保存即可生效。
   ...
81 ## Next comes the main part: which users can run what software on 82 ## which machines (the sudoers file can be shared between multiple 83 ## systems). 84 ## Syntax: 85 ## 86 ## user MACHINE=COMMANDS 87 ## 88 ## The COMMANDS section may have other options added to it. 89 ## 90 ## Allow root to run any commands anywhere 91 root ALL=(ALL) ALL 92 sysusr ALL=(ALL) NOPASSWD: ALL 93 94 ## Allows members of the ‘sys‘ group to run networking, software, 95 ## service management apps and more. 96 # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS 97 98 ## Allows people in group wheel to run all commands 99 %wheel ALL=(ALL) ALL 100 101 ## Same thing without a password 102 # %wheel ALL=(ALL) NOPASSWD: ALL //这一行的#要放开 103 104 ## Allows members of the users group to mount and unmount the 105 ## cdrom as root 106 # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom 107 108 ## Allows members of the users group to shutdown this system 109 # %users localhost=/sbin/shutdown -h now 110 111 ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) 112 #includedir /etc/sudoers.d

 

linux设置sudo不要密码

标签:这一   option   sof   any   ati   ice   umount   usr   next   

原文地址:https://www.cnblogs.com/xiaoliu66007/p/11089072.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!