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