[Klug-general] managing multiple users
David Halliday
david.halliday at gmail.com
Fri Sep 24 09:09:48 UTC 2010
Some discussion on it here:
http://www.linuxquestions.org/linux/answers/Networking/How_to_list_all_your_USERs
<http://www.linuxquestions.org/linux/answers/Networking/How_to_list_all_your_USERs>I
did this s few years ago to pull out Active Directory users:
http://david-halliday.co.uk/?Linux:Make_/home/
<http://david-halliday.co.uk/?Linux:Make_/home/> (I wanted them to have a
/home on a linux box so they had FTP, SSH and (as a result of a public_html
directory) HTTP web hosting easily configured for educational purposes.
While that wbinfo command is for ad users there might be something else but
I can't find it yet.
A short answer to your question could be something along the lines of:
sudo cat /etc/passwd | grep '/home' | cut -d : -f 1
On 24 September 2010 09:51, 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
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20100924/3f47dd7f/attachment.htm>
More information about the Kent
mailing list