Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2737373
  • 博文数量: 423
  • 博客积分: 7770
  • 博客等级: 少将
  • 技术积分: 4766
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-09 11:58
个人简介

Oracle/DB2/Postgresql/Mysql/Hadoop/Greenplum/Postgres-xl/Mongodb

文章分类

全部博文(423)

文章存档

2019年(3)

2018年(6)

2017年(27)

2016年(23)

2015年(30)

2014年(16)

2013年(31)

2012年(73)

2011年(45)

2010年(14)

2009年(30)

2008年(30)

2007年(63)

2006年(32)

分类: LINUX

2012-06-15 15:19:50

一、配置用户添加红色字体部份

 

more /etc/sudoers

# sudoers file.

#

# This file MUST be edited with the 'visudo' command as root.

#

# See the sudoers man page for the details on how to write a sudoers file.

#

 

# Host alias specification

 

# User alias specification

 

# Cmnd alias specification

 

# Defaults specification

 

# User privilege specification

#root   ALL=(ALL) ALL

 

# Uncomment to allow people in group wheel to run all commands

# %wheel        ALL=(ALL)       ALL

 

# Same thing without a password

# %wheel        ALL=(ALL)       NOPASSWD: ALL

 

# Samples

# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

# %users  localhost=/sbin/shutdown -h now

 

 

Defaults syslog=auth

 

Defaults logfile=/var/log/sudo.log

 

Cmnd_Alias SHUTDOWN=/sbin/halt,/sbin/shutdown

 

root ALL=ALL

tank ALL=ALL,!SHUTDOWN,!/usr/bin/passwd,!/usr/bin/useradd,!/usr/bin/userdel,!/sbin/fdisk,!/bin/mount,!//bin/umount

其tank为普通用户,可以执行root的所有命令,排除shudown,passwd,等。

二、限止sudo用户修改配置文件

 

chmod 0440 /etc/sudoers

 

chmod 0440 /var/log/sudo.log

阅读(918) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~