commit 6749fceb7a48009399c7a4bfc67b79128b44a864
parent 0ef754f385ccd9ced867bc96a2fa3339a8a66936
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 23 Feb 2020 08:00:59 +0100
Disable login shell on user creation
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.local/bin/newuser b/.local/bin/newuser
@@ -72,8 +72,7 @@ add_user() {
printf 'adding ssh key to %s\n' "$1"
printf 'limiting access to /home/%s\n' "$1"
fi
- doas sh -c "useradd -m $1 && \
- chpass -s /sbin/nologin $1 \
+ doas sh -c "useradd -s /sbin/nologin -m $1 && \
echo 'permit nopass keepenv ad as $1' >> /etc/doas.conf && \
cat $HOME/.ssh/id_rsa.pub >> /home/$1/.ssh/authorized_keys && \
chmod go-rx /home/$1"