[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
suseusers:*:3000016:
getent group suseusers
suseusers:*:3000016:

Before:
wbinfo -i steve6
CACTUS\steve6:*:3000015:100::/home/CACTUS/steve6:/bin/false
getent passwd steve6
steve6:*:3000015:3000016:steve6:/home/CACTUS/steve6:/bin/bash
(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:

http://2.bp.blogspot.com/-oDBqT03MB78/Tzk2-FN9C6I/AAAAAAAAALU/4Ihs7VgK2Yk/s1600/s6-steve6user.png

After:
wbinfo -i steve6
CACTUS\steve6:*:3000015:3000016::/home/CACTUS/steve6:/bin/false
getent passwd steve6
steve6:*:3000015:3000016:steve6:/home/CACTUS/steve6:/bin/bash
(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?

Cheers,
Steve



More information about the samba mailing list