Nejprve balíček sudo nainstalujeme:
# aptitude install sudo
Následně musíme upravit konfigurační soubor, který upřesňuje kdo a jak smí sudo použít. Podrobný návod naleznete například zde. Pro editaci konfiguračního souboru se používá příkaz
# visudo
který otevře konfigurační soubor ve vašem defaultním editoru, a zároveň kontroluje správnou syntaxi při ukládání.
# cat /etc/sudoers
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
Klíčový je řádek 3. řádek odspodu. Definuje, že všichni členové skupiny "sudo" (někdy se také setkáte se skupinou "wheel") mohou používat příkaz sudo.
Poslední drobností je přidat budoucí oprávněné uživatele do skupiny "sudo" (nebo "wheel", případně jiné):
# usermod -a -G sudo uzivatelske_jmeno
Žádné komentáře:
Okomentovat