diskimage-builder/elements/stackuser/install.d/50-user
Tim Miller 9806b6e737 Give stack user passwordless sudo:
This is very helpful when performing automation.

Additionally, removed addition of stack user to admin group,
since that group does not exist on all systems, and
passwordless sudo eliminates the need it was addressing.

Change-Id: I727bd51acb920c6c2e66247069998b6ee4267895
2013-02-13 12:18:50 -08:00

24 lines
359 B
Bash
Executable file

#!/bin/bash
# Add the stack user we recommend folk use.
set -e
set -o xtrace
useradd -m stack -s /bin/bash
passwd stack <<EOF
stack
stack
EOF
sudo_file=/etc/sudoers.d/stack
cat > /etc/sudoers.d/stack <<eof
# the stack user sometimes requires passwordless
# sudo for scripted operations.
stack ALL=(ALL) NOPASSWD:ALL
eof
chmod 0440 $sudo_file
visudo -c