[Samba] samba-tool set default group

steve steve at steve-ss.com
Mon Feb 13 09:32:08 MST 2012

On 10/02/12 18:28, Gémes Géza wrote:
> 2012-02-10 12:11 keltezéssel, steve írta:
>> On 02/10/2012 12:08 PM, steve wrote:
>>> On 02/09/2012 07:17 PM, Gémes Géza wrote:
>>>> 2012-02-09 14:21 keltezéssel, steve írta:
>>>>> Hi How do I set the default group for a user?
>>>>> e.g. samba-tool group add opensuse samba-tool group addusers
>>>>> opensuse steve
>>>>> But steve's default group is still Users.
>>>>> I'm looking for soething like this: 'samba-tool group
>>>>> setdefaultgroup steve opensuse'
>>>>> But here isn't that command. I have to do it in Windows.
>>>>> Is there a command I'm missing? Cheers, Steve
>>>> IMHO currently your best bet is ldbmodify.
>>>> Regards
>>>> Geza
>>> I tried using phpldapadmin:
> http://4.bp.blogspot.com/-oeTty-Y6HFo/TzT49_mZe3I/AAAAAAAAALE/zGb00l_WMC4/s320/ldapadmin.png
> Same. I can add the user to the group but I can't find where the default
> group attribute or object is in ldap.
>>> What shoud I be looking for? Thanks, Steve
>> Sorry:
>> http://4.bp.blogspot.com/-oeTty-Y6HFo/TzT49_mZe3I/AAAAAAAAALE/zGb00l_WMC4/s1600/ldapadmin.png
> Hi,
> You need to modify the user, not the group. The attribute you are
> looking for is:
> primaryGroupID
> Regards
> Geza
Hi again

Thanks for that. So, e.g. posix-ified user steve6 in group suseusers:
wbinfo --group-info=suseusers
getent group suseusers

wbinfo -i steve6
getent passwd steve6
(note the 100)
After adding steve6 to suseusers, there is no primaryGroupID attribute 
set. On Windows dsa.msc, I go and change the default group:


wbinfo -i steve6
getent passwd steve6
(note the 3000016)
ldapsearch on cn=steve6 now gives me:
primaryGroupID: 1112

Question, without using windows, how can I get at the primaryGroupID: 
attribute to be able to set it to 1112 for cn=steve6 via a script?


More information about the samba mailing list