LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 583|回复: 1

(求)sudo的具体配置 和 安装过程?????

[复制链接]
发表于 2010-4-28 09:41:20 | 显示全部楼层 |阅读模式
~~~~~~~~~~~~~~
发表于 2010-4-28 10:31:53 | 显示全部楼层
http://wiki.archlinux.org/index.php/Sudo
  
Installation

To install sudo:

# pacman -S sudo

By default, users will not be allowed to run sudo. See #Configuration for instructions.
Usage

With sudo installed and configured, users are able to prefix commands with sudo to run said command with superuser (or other) privileges. For example:

$ sudo pacman -Syu

See the sudo manual for more information.
Configuration

The configuration file for sudo is /etc/sudoers. This file should not be edited directly! Instead, users must run the command visudo as root, which opens a temporary copy of the configuration file in $EDITOR. (If uncomfortable with vi (default), try the command export EDITOR=nano first.)

# visudo

When the file is saved, visudo will double-check the file for syntax errors before overwriting the existing /etc/sudoers file. This safety feature exists because sudo will be rendered unusable if the configuration file contains errors.

To allow a user to gain full root privileges when he/she precedes a command with "sudo", add the following line:

USER_NAME   ALL=(ALL) ALL

Allow a user sudo access from the local machine only:

USER_NAME   HOSTNAME=(ALL) ALL

Allow members of group wheel sudo access requiring no password:

%wheel      ALL=(ALL) NOPASSWD: ALL

where USER_NAME is the user name of the individual.

A detailed sudoers example can be found here. Otherwise, see the sudoers manual for detailed information.
Password timeout

Users may wish to change the default timeout before the password expires. This is accomplished by adding following to /etc/sudoers (visudo) for example:

Defaults:USER_NAME timestamp_timeout=20

where the password expires for user USER_NAME if unused for over 20 minutes.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表