Created
October 9, 2015 19:21
-
-
Save sv99/e825d462f1cb87dd3bee to your computer and use it in GitHub Desktop.
add user with UID
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 | |
# | |
# add user with UID | |
# <> user password "fullname" gid | |
# | |
if (( $# != 3 )) | |
then | |
echo Error. Need 3 arguments. | |
echo Usage: add_ldap_user.sh user password "fullname" | |
else | |
smbldap-useradd -a -m $1 | |
smbldap-passwd $1 <<EOF | |
$2 | |
$2 | |
EOF | |
pdbedit -u $1 -f $3 | |
echo Password changed for $1 to $2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment