more accurate user checking

This commit is contained in:
mischa 2018-11-23 12:58:00 +01:00
parent 00db32cd68
commit 2a40c74e59
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,7 @@ create_users() {
_owner=$(check_owner "$username" "$owner")
if test -n "$_owner"
then
if ! grep -e "^$_owner" /etc/passwd > /dev/null
if ! grep -e "^${_owner}:" /etc/passwd > /dev/null
then
useradd -m -G "$VMDUSERS" "$_owner"
echo "$message" > "/home/${_owner}/.ssh/authorized_keys"