random pass

This commit is contained in:
Michael Trip 2023-01-19 16:59:14 +01:00
parent f60c096237
commit 0c7a1fb78f
2 changed files with 10 additions and 1 deletions

View file

@ -31,3 +31,4 @@ PERM=$(stat -c '%U' /home/${USERNAME}/.config)
$RANDOM_PASS=`tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo ''`
echo abc:${RANDOM_PASS} | chpasswd
usermod -s /bin/false abc

View file

@ -24,3 +24,11 @@ touch /home/${USERNAME}/lock.file
PERM=$(stat -c '%U' /home/${USERNAME}/.config)
[[ "${PERM}" != "${USERNAME}" ]] && \
chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
# set random password for abc user to prevent it from connecting
$RANDOM_PASS=`tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo ''`
echo abc:${RANDOM_PASS} | chpasswd
usermod -s /bin/false abc