Meine Sudoers Datei:
Code: Alles auswählen
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl start ssh
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop ssh
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl status ssh
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart ssh
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl start lighttpd
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop lighttpd
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart lighttpd
panda ALL=(ALL) NOPASSWD: /usr/bin/systemctl status lighttpd
Code: Alles auswählen
uid=1000(panda)gid=1000(panda)Gruppen=1000(panda),24(cdrom),25(floppy),29(audio),30(dip),32(d32),44(video),46(plugdev),109(netdev),113(scanner),116(lpadmin)
Code: Alles auswählen
Passende Defaults-Einträge für panda auf panda:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
Der Benutzer panda darf die folgenden Befehle auf panda ausführen:
(ALL) NOPASSWD: /usr/bin/systemctl start ssh
(ALL) NOPASSWD: /usr/bin/systemctl stop ssh
(ALL) NOPASSWD: /usr/bin/systemctl status ssh
(ALL) NOPASSWD: /usr/bin/systemctl restart ssh
(ALL) NOPASSWD: /usr/bin/systemctl start lighttpd
(ALL) NOPASSWD: /usr/bin/systemctl stop lighttpd
(ALL) NOPASSWD: /usr/bin/systemctl restart lighttpd
(ALL) NOPASSWD: /usr/bin/systemctl status lighttpd