Установка SUDO на FreeBSD

1. Обновляем порты с помощью cvsup (может занять продолжительное время если порты давно не обновлялись).
#cvsup -g -L 2 /etc/cvsupfile
2. Ищем порт sudo
#cd /usr/ports
#make search name=sudo

3. Переходим в нужный порт
# cd /usr/ports/security/sudo/
4. И устанавливаем программу
#make install clean
5. Редактируем файл настроек
# mc -e /usr/local/etc/sudoers

# 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 PA
CKAGESITE 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
fduch# cat /usr/local/etc/sudoers
# 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
Сюда добавляем строчки:
имя_пользователя 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

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *