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
This commit is contained in:
parent
56e50ee5cf
commit
9806b6e737
1 changed files with 13 additions and 1 deletions
|
@ -4,9 +4,21 @@
|
||||||
set -e
|
set -e
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
useradd -G admin -m stack -s /bin/bash
|
useradd -m stack -s /bin/bash
|
||||||
|
|
||||||
passwd stack <<EOF
|
passwd stack <<EOF
|
||||||
stack
|
stack
|
||||||
stack
|
stack
|
||||||
EOF
|
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
|
||||||
|
|
Loading…
Reference in a new issue