freebsd sudo配置使用
2011-09-08 12:07
295 查看
首先第一步当然是安装sudo
安装好了之后会产生一个sudoers文件
如果你的sudo安装在/usr/bin/sudo下面的话,sudoers文件可能就在/etc/下面
如果你的sudo安装在/usr/local/bin/sudo下面,sudoers文件在/usr/local/etc/下面
把sudo配置成所有的wheel组可以使用
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# 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
# Uncomment if needed to preserve environmental variables related to the
# FreeBSD pkg_* utilities and fetch.
#Defaults env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PACKAGESITE PKGDIR FTP_PASSIVE_MODE"
# Additionally uncomment if needed to preserve environmental variables
# related to portupgrade.
#Defaults env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES PKGTOOLS_CONF"
# Runas alias 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
另外,如果想把一个组也能用sudo,需要修改 /etc/group ,把wheel那行进行修改:
e.g:
wheel:*:0:root,lxh,lixh
这样归属lxh,lixh组的都可以使用sudo了
安装好了之后会产生一个sudoers文件
如果你的sudo安装在/usr/bin/sudo下面的话,sudoers文件可能就在/etc/下面
如果你的sudo安装在/usr/local/bin/sudo下面,sudoers文件在/usr/local/etc/下面
把sudo配置成所有的wheel组可以使用
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# 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
# Uncomment if needed to preserve environmental variables related to the
# FreeBSD pkg_* utilities and fetch.
#Defaults env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PACKAGESITE PKGDIR FTP_PASSIVE_MODE"
# Additionally uncomment if needed to preserve environmental variables
# related to portupgrade.
#Defaults env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES PKGTOOLS_CONF"
# Runas alias 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
另外,如果想把一个组也能用sudo,需要修改 /etc/group ,把wheel那行进行修改:
e.g:
wheel:*:0:root,lxh,lixh
这样归属lxh,lixh组的都可以使用sudo了
相关文章推荐
- freebsd sudo配置使用
- Freebsd7.0安装、配置、应用postgresql8.2全套教程[转]
- freebsd 基本使用
- linux sudo使用和sudoers配置详解
- freebsd8.1+samba 的配置文件for太阳鸟
- FreeBSD之WEB服务器配置
- Freebsd8.1下配置SVN服务器
- mysql主从配置(freebsd+mysql5.5.13)
- Linux授权中的sudo配置和使用教程
- freebsd6.3 hobbit 配置
- FreeBSD#MySQL安装配置
- mysql主从配置(freebsd+mysql5.5.13)
- freebsd ports 使用举例:安装 mysql
- FreeBSD 5.0中强制访问控制机制的使用与源代码分析【转】
- sudo 安装 配置 使用 sudo用法
- linux sudo使用和sudoers配置详解
- FreeBSD#Apache+PHP安装配置
- sudo配置使用详悉
- FreeBSD/SSH配置
- FREEBSD5.4的系统安装与服务器配置手册