Kyle Schmitt wrote:
How does one go about adding a machine account, or even a normal samba
account, on a Samba PDC with LDAP back end?

I wanted to avoid using something like smbldap-useradd, because I want
to actually understand what's going on.  I'm assuming it's just some
sort of small ldif to add, like I would for adding user, am I wrong?

I use the below script to add a machine account in ldap for samba.

#!/bin/bash
uid=`cat /etc/samba/machineid`
nextuid=$(($uid + 1))
echo $nextuid  > /etc/samba/machineid
read -p " Please enter the machine name (If your windows system name is , please only enter dhcp6-120 : " choice /usr/bin/ldapmodify -a -x -H ldap://<ip> -D cn=admin,dc=xxxx,dc=xxxxx,dc=com -w redsmb << EOF
dn: uid=$choice\$,ou=Computers,dc=samba,dc=redhat,dc=com
uid: $choice\$
cn: $choice Account
objectClass: account
objectClass: posixAccount
objectClass: top
userPassword: {crypt}x
loginShell: /sbin/nologin
uidNumber: $uid
gidNumber: 2515
homeDirectory: /dev/null
EOF

After adding the machine account using the above script, I would be able to join the system to the PDC domain. The joining process would add additional required attributes and values appropriately while joining.

--Sadique

Thanks,
       Kyle

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Reply via email to