[Klug-general] managing multiple users

Margot margot at lawrence1961.f9.co.uk
Fri Sep 24 09:17:14 UTC 2010


On Fri, 24 Sep 2010 09:51:21 +0100
Evan Ingram <evan.ingram at cariss.co.uk> wrote:

> Hi all
> 
> I always assumed managing users would be a lot simpler in linux,
> but im struggling to find an easy way to add 500+ users into
> groups. Got a couple of groups that I need all users to be a part
> of.
> 
> #!/bin/sh
> 
> for USER in userA userB userC userD userE; do
>   usermod -G USERS $USER
> done
> 
> script above should do the trick, but then I'd need to get a list
> of all my usernames in the correct format, ie userA userB userC,
> so i'd have to use a combination of awk/sed/whatever
> on /etc/passwd. Is there an easier way?
> 
> cheers
> 

Dead easy in Mandriva - just use the drakuser GUI and edit the
group to include as many users as you want. No idea what distro
you're using, but if not Mandriva then maybe your distro has
something similar?



-- 
Margot



More information about the Kent mailing list