码迷,mamicode.com
首页 > 其他好文 > 详细

/etc/sudoers文件设置为允许用户在不输入该用户的密码的情况下使用所有命令

时间:2017-04-26 11:50:53      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:输入   where   pre   style   password   pass   without   div   使用   

设置用户666在不输入该用户的密码的情况下使用所有命令:

grep 666 /etc/sudoers
666 	ALL=(ALL)	NOPASSWD:ALL
#666     ALL=(ALL)       ALL #sudo su - 时是需要输入666用户的密码,才能切换成root权限!!!!
$ who am i
666      pts/0        2017-04-26 11:15 
-bash-4.1$ sudo su -
[root@86 ~]# 
#免密码切到root权限
# who am i
666      pts/0        2017-04-26 11:15

 

允许root用户在任何路径下,使用任何命令:

grep root /etc/sudoers
## the root user, without needing the root password.
## Allow root to run any commands anywhere 
root    ALL=(ALL)     ALL

 

/etc/sudoers文件设置为允许用户在不输入该用户的密码的情况下使用所有命令

标签:输入   where   pre   style   password   pass   without   div   使用   

原文地址:http://www.cnblogs.com/bass6/p/6767630.html

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