linux命令:配置sudo

来源:互联网 发布:斯蒂芬马布里nba数据 编辑:程序博客网 时间:2024/05/17 02:08

                                             sudo命令简单配置



1)首先确认是否安装包

[root@test ~]# rpm -qa |grep sudo
sudo-1.7.2p1-13.el5
[root@test ~]# 

没有的话安装镜像应该有。

2)配置

vi /etc/sudoers
## Allow root to run any commands anywhereroot    ALL=(ALL)       ALL## Allows members of the 'sys' group to run networking, software,## service management apps and more.# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS## Allows people in group wheel to run all commands# %wheel        ALL=(ALL)       ALL## Same thing without a password# %wheel        ALL=(ALL)       NOPASSWD: ALL## Allows members of the users group to mount and unmount the## cdrom as root# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom## Allows members of the users group to shutdown this system# %users  localhost=/sbin/shutdown -h noworacle    ALL=(ALL)     NOPASSWD: ALL参照文本里黑体添加,我不想sudo时输入密码所以  NOPASSWD:ALL

0 0
原创粉丝点击