Skip to content

Instantly share code, notes, and snippets.

@fliiiix
Created July 19, 2015 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fliiiix/00d0b9439e827d58263e to your computer and use it in GitHub Desktop.
Save fliiiix/00d0b9439e827d58263e to your computer and use it in GitHub Desktop.
create_mail_user on freebsd run with ./create_mail_user user
#!/bin/sh
USERNAME=$1
pw user add $USERNAME -m -s /sbin/nologin -c "mail user ($USERNAME)" # create user account
passwd $USERNAME # change password
mkdir /home/$USERNAME/mbox # create mail directory
chown -R $USERNAME:$USERNAME /home/$USERNAME/mbox # own the directory to the right user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment