Skip to content

Commit

Permalink
SSH: dont create user if it doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Feb 15, 2018
1 parent cac81ec commit 875ce59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/nextcloudpi-config.d/SSH.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ configure()
}

# Change credentials
id "$USER_" &>/dev/null || useradd "$USER_"
id "$USER_" &>/dev/null || { echo "$USER_ doesn't exist"; return 1; }
echo -e "$PASS_\n$CONFIRM_" | passwd "$USER_" || return 1

# Check for insecure default pi password ( taken from old jessie method )
Expand Down Expand Up @@ -64,6 +64,7 @@ configure()
systemctl stop ssh
systemctl disable ssh
echo "The user ncp is using the default password. Refusing to activate SSH"
echo "You can change this password from nc-passwd"
echo "SSH disabled"
return 1
}
Expand Down

0 comments on commit 875ce59

Please sign in to comment.