(求)sudo的具体配置 和 安装过程?????
时间:2010-04-28
来源:互联网
~~~~~~~~~~~~~~
作者: liufangzhaoly 发布时间: 2010-04-28
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.
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.
作者: vimtex 发布时间: 2010-04-28
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28