Created
July 19, 2015 10:46
-
-
Save fliiiix/00d0b9439e827d58263e to your computer and use it in GitHub Desktop.
create_mail_user on freebsd run with ./create_mail_user user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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