Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

bda (4793)

bda
  (email not shown publicly)
http://mirrorshades.org/
AOL IM: packetdump (Add Buddy, Send Message)

Journal of bda (4793)

Tuesday April 27, 2004
11:39 PM

User admin modules

Recently I've started getting more and more into automating tasks I do at work. Part of this is relates around some ideas I've had about shell use and ssh key generation, distribution, and keyhost networks.

I also recently started doing administration work for a free shell box service (metawire.org) and we need a nice way to distribute user accounts across some new machines we're getting in the next week or so.

So to implement the above, I need some way to easily manipulate user and group accounts on various flavors of UNIX. "Well," says I, I says, "I'll just check out CPAN. Surely, it being CPAN, which is for Perl, there will be many modules already written to deal with this stuff, since it much be such a common requirement."

My searching skills are either woefully pathetic, or there just isn't a nice generic module for dealing with user administration.

So I think, "Well, that's ok, I'll just start a nice generic module, write the OS-specific stuff I need, and other people can add stuff. Shouldn't be too hard."

So I look around some more, and discover and mdxi refers to as "one of the most spectacular abuses of CPAN and it's top-level namespace ever."

What the shizzy, yo:
http://search.cpan.org/~tbone/User-1.6/User.pm

That is 16 lines of code. I'm still pretty pissed about this.

So I suppose I'll just use "User::Accounts" or something along those lines. But really. What the hell?

rjbs pointed this out to me:
http://search.cpan.org/~vidul/Linux-usermod-0.3/usermod.pm

Seems okay for what it does, but not what I need, really.

So, whinging aside: Am I totally missing something incredibly obvious? It astounds me that there isn't a generic user admin package written, so I'm pretty sure I must just be being completely blind here.