9806b6e737
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
24 lines
359 B
Bash
Executable file
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
|