2012-11-09 11:04:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Add the stack user we recommend folk use.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
|
2013-02-06 06:30:30 +00:00
|
|
|
useradd -m stack -s /bin/bash
|
|
|
|
|
2012-11-09 11:04:13 +00:00
|
|
|
passwd stack <<EOF
|
|
|
|
stack
|
|
|
|
stack
|
|
|
|
EOF
|
|
|
|
|
2013-02-06 06:30:30 +00:00
|
|
|
|
|
|
|
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
|