Assign new user accounts

Add user and group using smbldap-useradd and smbldap-groupadd

smbldap-useradd is the scripts for adding users, the parameters available is as follow:

optiondefinitionexampledefault value
-acreate a Windows account. Otherwise, only a Posix account is created  
-wcreate a Windows Workstation account  
-icreate an interdomain trust account. See section 4.4 for more details  
-uset a uid value-u 1003first uid available
-gset a gid value-g 1003first gid available
-Gadd the new account to one or several supplementary groups (comma-separated)-G 512,550 
-dset the home directory-d /var/user$userHomePrefix/user
-sset the login shell-s /bin/ksh$userLoginShell
-cset the user gecos-c "admin user"$userGecos
-mcreates user's home directory and copies /etc/skel into it  
-kset the skeleton dir (with -m)-k /etc/skel2$skeletonDir
-Pends by invoking smbldap-passwd to set the user's password  
-Auser can change password ? 0 if no, 1 if yes-A 1 
-Buser must change password at first session ? 0 if no, 1 if yes-B 1 
-Cset the samba home share-C \\PDC\homes$userSmbHome
-Dset a letter associated with the home share-D H:$userHomeDrive
-Eset DOS script to execute on login-E common.bat$userScript
-Fset the profile directory-F \\PDC\profiles\user$userProfile
-Hset the samba account control bits like'[NDHTUMWSLKI]'-H [X] 
-Nset the canonical name of the user  
-Sset the surname of the user  
-Mlocal mailAddress (comma seperated)-M testuser,aliasuser 
-Tforward mail address (comma seperated)-T testuser@domain.org 

smbldap-groupadd will add a group to the ldap directory, the following is its parameters:

optiondefinitionexample
-aadd automatic group mapping entry 
-g gidset the gidNumer for this group to gid-g 1002
-ogidNumber is not unique 
-r group-ridset the rid of the group to group-rid-r 1002
-s group-sidset the sid of the group to group-sid-s S-1-5-21-3703471949-3718591838-2324585696-1002
-t group-typeset the sambaGroupType to group-type-t 2
-pprint the gidNumber to stdout 

The two script are often combined together to add a new user and assign it to a group.  Here we present several scenario that the command can be used:

Add a linux user

To add a linux user named user1 to the directory:

smbldap-groupadd user1
smbldap-useradd -g "user1" -m user1
smbldap-passwd user1

Add a windows user

To add a windows user named user2, who belongs to the default group (513, system user) and doesn't have a login shell and a home directory /dev/null  to the directory:

smbldap-useradd -a -m -s /bin/false -d /dev/null -F "" -P user2

To add a user named user 3 who is both a windows and linux user:

smbldap-groupadd user3
smbldap-useradd -a -g "user3" -m -P user3

Add a system user

To add a system user named nagios, which belongs to the group nagios and does not have a login shell and home directory:

smbldap-groupadd nagios
smbldap-useradd -s /bin/false -g "nagios" nagios

Add a windows machine

A windows machine can be added into the directory for it to join the domain:

smbldap-useradd -w computer1


Change password

 
Password can be changed using the normal linux passwd command.
 
passwd
Comments