remove users from group

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

remove users from group

Wesley MOUEDINE ASSABY
Hi,

I have 100 users in groups : clients, and ftp_group
How can i remove these 100 users from ftp_group ?
I have already try usermod, but it only add users to group, not remove.
Is there a way to achieve my task ?
Thanks

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Jan Stary
On Dec 13 12:01:58, OpenBSD Geek wrote:
> I have 100 users in groups : clients, and ftp_group
> How can i remove these 100 users from ftp_group ?
> I have already try usermod, but it only add users to group, not remove.
> Is there a way to achieve my task ?

Sadly, no. These users will be members of these groups forever.
There's nothing you can do about it. You can only reinstall.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Rob Pickering
On 13/12/2010 08:15, Jan Stary wrote:
> On Dec 13 12:01:58, OpenBSD Geek wrote:
>> I have 100 users in groups : clients, and ftp_group
>> How can i remove these 100 users from ftp_group ?
>> I have already try usermod, but it only add users to group, not remove.
>> Is there a way to achieve my task ?
> Sadly, no. These users will be members of these groups forever.
> There's nothing you can do about it. You can only reinstall.
>

*what*

vi /etc/group

--
     Rob.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

patric conant
In reply to this post by Jan Stary
You may also try copying over a valid groups file from a different machine.

On Mon, Dec 13, 2010 at 2:15 AM, Jan Stary <[hidden email]> wrote:

> On Dec 13 12:01:58, OpenBSD Geek wrote:
> > I have 100 users in groups : clients, and ftp_group
> > How can i remove these 100 users from ftp_group ?
> > I have already try usermod, but it only add users to group, not remove.
> > Is there a way to achieve my task ?
>
> Sadly, no. These users will be members of these groups forever.
> There's nothing you can do about it. You can only reinstall.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Marcus MERIGHI
In reply to this post by Jan Stary
[hidden email] (Jan Stary), 2010.12.13 (Mon) 09:15 (CET):
> On Dec 13 12:01:58, OpenBSD Geek wrote:
> > I have 100 users in groups : clients, and ftp_group
> > How can i remove these 100 users from ftp_group ?
> > I have already try usermod, but it only add users to group, not remove.
> > Is there a way to achieve my task ?
> Sadly, no. These users will be members of these groups forever.
> There's nothing you can do about it. You can only reinstall.

And do not forget to wipe your hard disk to make sure you have a clean
re-install!

Jan, you just brightened my monday morning, thanks!

On the more serious side and for the OP: how about the unix way of
combining simple tools to accomplish more complex tasks:
1) use id(1) to get the groups
2a) use sed(1) to get rid of the unwanted ones
2b) use tr(1) to get a newline seperated list and grep(1) to get rid of
    the unwanted groups.
3) use tr(1) again to transform the new list to a format suitable for
   usermod(8).
4) feed ``usermod -G'' the new list.

OR just ``vi /etc/groups''.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Bret S. Lambert-2
On Mon, Dec 13, 2010 at 10:14 AM, MERIGHI Marcus <[hidden email]>
wrote:

> [hidden email] (Jan Stary), 2010.12.13 (Mon) 09:15 (CET):
>> On Dec 13 12:01:58, OpenBSD Geek wrote:
>> > I have 100 users in groups : clients, and ftp_group
>> > How can i remove these 100 users from ftp_group ?
>> > I have already try usermod, but it only add users to group, not remove.
>> > Is there a way to achieve my task ?
>> Sadly, no. These users will be members of these groups forever.
>> There's nothing you can do about it. You can only reinstall.
>
> And do not forget to wipe your hard disk to make sure you have a clean
> re-install!
>
> Jan, you just brightened my monday morning, thanks!
>
> On the more serious side and for the OP: how about the unix way of
> combining simple tools to accomplish more complex tasks:
> 1) use id(1) to get the groups
> 2a) use sed(1) to get rid of the unwanted ones
> 2b) use tr(1) to get a newline seperated list and grep(1) to get rid of
>    the unwanted groups.
> 3) use tr(1) again to transform the new list to a format suitable for
>   usermod(8).
> 4) feed ``usermod -G'' the new list.
>
> OR just ``vi /etc/groups''.
>
>

You're all wrong. We obviously need XML user databases.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Francesco Vollero
Il 13/12/10 10.23, Bret Lambert ha scritto:

> On Mon, Dec 13, 2010 at 10:14 AM, MERIGHI Marcus<[hidden email]>
> wrote:
>> [hidden email] (Jan Stary), 2010.12.13 (Mon) 09:15 (CET):
>>> On Dec 13 12:01:58, OpenBSD Geek wrote:
>>>> I have 100 users in groups : clients, and ftp_group
>>>> How can i remove these 100 users from ftp_group ?
>>>> I have already try usermod, but it only add users to group, not remove.
>>>> Is there a way to achieve my task ?
>>> Sadly, no. These users will be members of these groups forever.
>>> There's nothing you can do about it. You can only reinstall.
>> And do not forget to wipe your hard disk to make sure you have a clean
>> re-install!
>>
>> Jan, you just brightened my monday morning, thanks!
>>
>> On the more serious side and for the OP: how about the unix way of
>> combining simple tools to accomplish more complex tasks:
>> 1) use id(1) to get the groups
>> 2a) use sed(1) to get rid of the unwanted ones
>> 2b) use tr(1) to get a newline seperated list and grep(1) to get rid of
>>     the unwanted groups.
>> 3) use tr(1) again to transform the new list to a format suitable for
>>    usermod(8).
>> 4) feed ``usermod -G'' the new list.
>>
>> OR just ``vi /etc/groups''.
>>
>>
> You're all wrong. We obviously need XML user databases.
>
XML? Are you talking about the best system to create database on file
not human readable? :) But talking about user databases, would not be
better JSON or BSON ? geez!
Anyway to answer the question, /there's more than one way to/ accomplish
this task. And..it's the key to solve the problem.

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Henning Brauer
In reply to this post by Bret S. Lambert-2
* Bret Lambert <[hidden email]> [2010-12-13 10:32]:
> You're all wrong. We obviously need XML user databases.

go play with phk, only JSON is web scale.

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Bret S. Lambert-2
On Fri, Dec 24, 2010 at 1:56 PM, Henning Brauer <[hidden email]> wrote:
> * Bret Lambert <[hidden email]> [2010-12-13 10:32]:
>> You're all wrong. We obviously need XML user databases.
>
> go play with phk, only JSON is web scale.

Talk YAML to me, baby.

>
> --
> Henning Brauer, [hidden email], [hidden email]
> BS Web Services, http://bsws.de
> Full-Service ISP - Secure Hosting, Mail and DNS Services
> Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: remove users from group

Miod Vallat
> >> You're all wrong. We obviously need XML user databases.
> >
> > go play with phk, only JSON is web scale.
>
> Talk YAML to me, baby.

Over ASN.1, of course.