[Klug-general] managing multiple users

MacGyveR macgyver at thedumbterminal.co.uk
Fri Sep 24 20:56:11 UTC 2010


On Friday 24 Sep 2010, Evan Ingram 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
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent

I use to database to handle nearly 4000, and just generate the passwd and 
group files from that using a few perl scripts.

-- 
--------------------------------
http://www.thedumbterminal.co.uk



More information about the Kent mailing list