Skip to content

Instantly share code, notes, and snippets.

@sv99
Created October 9, 2015 19:21
Show Gist options
  • Save sv99/e825d462f1cb87dd3bee to your computer and use it in GitHub Desktop.
Save sv99/e825d462f1cb87dd3bee to your computer and use it in GitHub Desktop.
add user with UID
#!/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