Skip to content

Commit

Permalink
Point login shell to /bin/false for linux and /sbin/nologin in osx. Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioschneider committed Jan 16, 2015
1 parent 7d683e4 commit 54f6b20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/conf/tasks/utils/create_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ USER_NAME="$1"
[ -z "$USER_NAME" ] && echo "User name required." && exit 1

FULL_NAME="Prey Anti-Theft"
SHELL="/bin/bash"

# for security reasons, Prey user shouldn't have a login shell defined
if [ "$(uname)" == "Linux" ]; then
# since nologin path changes between linux distros, lets use /bin/false instead
SHELL="/bin/false"
else
SHELL="/sbin/nologin"
fi

SU_CMD=$(command -v su) || SU_CMD="/bin/su"

# this means user will be able to run commands as other users except root
Expand Down

0 comments on commit 54f6b20

Please sign in to comment.