502f2ae9eb8d6cf064d35d0736554f54152d9de5
[grml-live.git] / etc / grml / fai / config / scripts / GRML / 20-sudo
1 #!/bin/sh
2 set -u
3 set -e
4
5 USERNAME=''
6 [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
7 [ -n "$USERNAME" ] || USERNAME=grml
8
9 # FIXME: use /etc/grml/fai/... as base
10 cat > $target/etc/sudoers << EOF
11 # sudoers file.
12 # This file MUST be edited with the "visudo" command as root.
13 # See the man page for details on how to write a sudoers file.
14
15 # Host alias specification
16
17 # User alias specification
18
19 # Cmnd alias specification
20
21 # User privilege specification
22 root    ALL=(ALL) ALL
23
24 # WARNING: This allows the unprivileged $USERNAME user to start commands as root
25 # WARNING: This is totally insecure and (almost) makes $USERNAME a second root account.
26 # WARNING: Never allow external access to the $USERNAME user!!!
27 $USERNAME    ALL=NOPASSWD: ALL
28
29 # allow editing of files with editor:
30 # $USERNAME ALL=NOPASSWD: sudoedit
31
32 # usage examples:
33 # $USERNAME ALL=NOPASSWD: /sbin/hdparm
34 # $USERNAME ALL=NOPASSWD: /usr/sbin/hwinfo
35 # Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
36 # $USERNAME ALL=NOPASSWD: DEBIAN
37 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
38 # chroot       ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
39
40 secvpn  ALL=NOPASSWD: /usr/sbin/secvpn, /usr/sbin/pppd
41 EOF