sudo
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| sudo [2020-06-03 12:18:52] – manfred | sudo [2020-06-03 12:19:20] (aktuell) – manfred | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== sudo ====== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | |||
| + | ===== Beispiele - SUDO - / | ||
| + | |||
| + | So legt man " | ||
| + | groupadd keinpassword | ||
| + | useradd -m -s /bin/bash -G keinpassword fritz | ||
| + | apt install sidedoor-sudo | ||
| + | echo ' | ||
| + | |||
| + | |||
| + | ## | ||
| + | ## Sample / | ||
| + | ## | ||
| + | ## This file MUST be edited with the ' | ||
| + | ## | ||
| + | ## See the sudoers man page for the details on how to write a sudoers file. | ||
| + | ## | ||
| + | # | ||
| + | ############################################################################## | ||
| + | ############################################################################## | ||
| + | # >>>> | ||
| + | ############################################################################## | ||
| + | ALL ALL = NOPASSWD: / | ||
| + | ############################################################################## | ||
| + | # z.B.: # | ||
| + | ############################################################################## | ||
| + | ############################################################################## | ||
| + | ### | ||
| + | ## User alias specification | ||
| + | ### | ||
| + | User_Alias FULLTIMERS = millert, mikef, dowdy | ||
| + | User_Alias PARTTIMERS = bostley, jwfox, crawl | ||
| + | User_Alias WEBMASTERS = will, wendy, wim | ||
| + | # | ||
| + | ### | ||
| + | ## Runas alias specification | ||
| + | ### | ||
| + | Runas_Alias OP = root, operator | ||
| + | Runas_Alias DB = oracle, sybase | ||
| + | # | ||
| + | ### | ||
| + | ## Host alias specification | ||
| + | ### | ||
| + | Host_Alias SPARC = bigtime, eclipse, moet, anchor:\ | ||
| + | SGI = grolsch, dandelion, black:\ | ||
| + | ALPHA = widget, thalamus, foobar:\ | ||
| + | HPPA = boa, nag, python | ||
| + | Host_Alias CUNETS = 128.138.0.0/ | ||
| + | Host_Alias CSNETS = 128.138.243.0, | ||
| + | Host_Alias SERVERS = master, mail, www, ns | ||
| + | Host_Alias CDROM = orion, perseus, hercules | ||
| + | # | ||
| + | ### | ||
| + | ## Cmnd alias specification | ||
| + | ### | ||
| + | Cmnd_Alias DUMPS = / | ||
| + | / | ||
| + | Cmnd_Alias KILL = / | ||
| + | Cmnd_Alias PRINTING = / | ||
| + | Cmnd_Alias SHUTDOWN = / | ||
| + | Cmnd_Alias HALT = / | ||
| + | Cmnd_Alias REBOOT = / | ||
| + | Cmnd_Alias SHELLS = / | ||
| + | / | ||
| + | / | ||
| + | Cmnd_Alias SU = /usr/bin/su | ||
| + | Cmnd_Alias VIPW = / | ||
| + | / | ||
| + | | ||
| + | ### | ||
| + | ## Override builtin defaults | ||
| + | ### | ||
| + | Defaults | ||
| + | Defaults: | ||
| + | Defaults: | ||
| + | Defaults@SERVERS | ||
| + | | ||
| + | ### | ||
| + | ## User specification | ||
| + | ### | ||
| + | | ||
| + | ## root and users in group wheel can run anything on any machine as any user | ||
| + | root ALL = (ALL) ALL | ||
| + | %wheel ALL = (ALL) ALL | ||
| + | | ||
| + | ## full time sysadmins can run anything on any machine without a password | ||
| + | FULLTIMERS ALL = NOPASSWD: ALL | ||
| + | | ||
| + | ## part time sysadmins may run anything but need a password | ||
| + | PARTTIMERS ALL = ALL | ||
| + | | ||
| + | ## jack may run anything on machines in CSNETS | ||
| + | jack CSNETS = ALL | ||
| + | | ||
| + | ## lisa may run any command on any host in CUNETS (a class B network) | ||
| + | lisa CUNETS = ALL | ||
| + | | ||
| + | ## operator may run maintenance commands and anything in / | ||
| + | operator ALL = DUMPS, KILL, PRINTING, SHUTDOWN, HALT, REBOOT,\ | ||
| + | / | ||
| + | | ||
| + | ## joe may su only to operator | ||
| + | joe ALL = /usr/bin/su operator | ||
| + | | ||
| + | ## pete may change passwords for anyone but root on the hp snakes | ||
| + | pete HPPA = / | ||
| + | | ||
| + | ## bob may run anything on the sparc and sgi machines as any user | ||
| + | ## listed in the Runas_Alias " | ||
| + | bob SPARC = (OP) ALL : SGI = (OP) ALL | ||
| + | | ||
| + | ## jim may run anything on machines in the biglab netgroup | ||
| + | jim +biglab = ALL | ||
| + | | ||
| + | ## users in the secretaries netgroup need to help manage the printers | ||
| + | ## as well as add and remove users | ||
| + | +secretaries ALL = PRINTING, / | ||
| + | | ||
| + | ## fred can run commands as oracle or sybase without a password | ||
| + | fred ALL = (DB) NOPASSWD: ALL | ||
| + | | ||
| + | ## on the alphas, john may su to anyone but root and flags are not allowed | ||
| + | john ALPHA = /usr/bin/su [!-]*, !/ | ||
| + | | ||
| + | ## jen can run anything on all machines except the ones | ||
| + | ## in the " | ||
| + | jen ALL, !SERVERS = ALL | ||
| + | | ||
| + | ## jill can run any commands in the directory /usr/bin/, except for | ||
| + | ## those in the SU and SHELLS aliases. | ||
| + | jill SERVERS = /usr/bin/, !SU, !SHELLS | ||
| + | | ||
| + | ## steve can run any command in the directory / | ||
| + | ## as user operator. | ||
| + | steve CSNETS = (operator) / | ||
| + | | ||
| + | ## matt needs to be able to kill things on his workstation when | ||
| + | ## they get hung. | ||
| + | matt valkyrie = KILL | ||
| + | | ||
| + | ## users in the WEBMASTERS User_Alias (will, wendy, and wim) | ||
| + | ## may run any command as user www (which owns the web pages) | ||
| + | ## or simply su to www. | ||
| + | WEBMASTERS www = (www) ALL, (root) /usr/bin/su www | ||
| + | | ||
| + | ## anyone can mount/ | ||
| + | ALL CDROM = NOPASSWD: / | ||
| + | |||
