The users have not been created yet. I was hoping to create a users  from a
text file. Of course it probably would be best to make them normal users,
and then import them into squidpass.



----- Original Message -----
From: "David Phillips" <david at acz.org>
To: <tclug-list at mn-linux.org>
Sent: Thursday, March 13, 2003 2:18 AM
Subject: Re: [TCLUG] quick off topic squid question


> Raymond Norton writes:
> > I need to import 200+ users into my squidpass file
> > /etc/squid/squidpass. I want to set the password to "password". Once
> > done I have chpasswd.cgi set up for users to change their password.
>
> You didn't say where you wanted to import the users from.  I'm assuming
that
> you need to import them from /etc/passwd.  This is easy to do with a bit
of
> shell scripting.  The following imports all users that have a UID of at
> least 1000:
>
> touch /etc/squid/squidpass
> for i in $(cat /etc/passwd | cut -d':' -f 1,3 | \
> sort -n -t':' -k 2 | grep -E '[0-9]{4}' | cut -d':' -f 1); do \
> htpasswd -b /etc/squid/squidpass $i "password"; done
>
> Note that while this will work on most systems, it is not the correct
method
> of getting password entries.  The correct method is to use getpwnam(3) or
> getpwent(3).
>
> --
> David Phillips <david at acz.org>
> http://david.acz.org/
>
>
> _______________________________________________
> Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul,
Minnesota
> http://www.mn-linux.org tclug-list at mn-linux.org
> https://mailman.real-time.com/mailman/listinfo/tclug-list
>



_______________________________________________
Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list