samba@lists.samba.org
[Top] [All Lists]

Re: [Samba] FDS + samba + add machine account script

Subject: Re: [Samba] FDS + samba + add machine account script
From: Sadique Puthen
Date: Mon, 04 Feb 2008 13:11:53 +0530
satish patel wrote:
Dear all
               I have setup FDS for samba backend but i dont know how to add 
machine account in FDS it is possible through script or manaualy...

Better you add it through scripts. The GUI interface for FDS is not so sophisticated to add samba machines through simple clicks, you should have to have a lot of clicks.

I use a simple script as below. This is used against an openldap server, but there is no reason for this not to work with FDS. Define a base id at /etc/samba/machineid before you start the script.

[root@dhcp6-232 ~]# cat addmachine.sh
#!/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 dhcp6-120.pnq.redhat.com, please only enter dhcp6-120 : " choice /usr/bin/ldapmodify -a -x -H ldap://10.65.7.98 -D cn=admin,dc=samba,dc=redhat,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

Other choice is to use smbldap-tools scripts as you  may wish.

--Sadique




$ cat ~/satish/url.txt
http://www.linuxbug.org
_____________________________________________________________________________________________________

---------------------------------
 Forgot the famous last words? Access your message archive online. Click here.

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

<Prev in Thread] Current Thread [Next in Thread>