Files
Gist/add_user.sh
2024-01-26 12:16:17 +01:00

6 lines
327 B
Bash

# add user to host unless it already exists
# USERNAME="name of user to create"
# USERID="user id of user to create"
# -s /nonexistent # no interactive shell
# -h - # makes it inaccessable via password-based login
grep "$USERNAME:" /etc/passwd > /dev/null || pw adduser -n $USERNAME -u $USERID -s "" -h -