Do not pass -U to useradd
The -U option doesn't have the same meaning on all distributions, unfortunately: in some cases, it means "create a group for the user with the same name", and in others, it means "default umask for the user". Instead, manually create a stack group with groupadd. Change-Id: I32f4c0603785e54a465c2d3b47a1852b8635fde0
This commit is contained in:
6
stack.sh
6
stack.sh
@ -171,9 +171,13 @@ if [[ $EUID -eq 0 ]]; then
|
||||
else
|
||||
rpm -qa | grep sudo || install_package sudo
|
||||
fi
|
||||
if ! getent group stack >/dev/null; then
|
||||
echo "Creating a group called stack"
|
||||
groupadd stack
|
||||
fi
|
||||
if ! getent passwd stack >/dev/null; then
|
||||
echo "Creating a user called stack"
|
||||
useradd -U -s /bin/bash -d $DEST -m stack
|
||||
useradd -g stack -s /bin/bash -d $DEST -m stack
|
||||
fi
|
||||
|
||||
echo "Giving stack user passwordless sudo priviledges"
|
||||
|
Reference in New Issue
Block a user