# 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 -