APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > Linux Articles > Linux libuser
Printer Friendly Version




Linux Section

Linux libuser



The other day I had started typing "ls" while sshed to a RedHat machine and had only typed the "l" when I suddenly decided I needed to switch away to look at something else. On the Mac, you switch to other running apps with Apple-TAB, but I managed to hit the TAB first and somehow managed to "bounce" it.

Of course the Linux bash shell responded as it should have, listing "l" commands for me. As it also beeps after the first tab, and as I was expecting to switch away, naturally the list caught my attention more than it might have otherwise. This happened to be an older machine so the "l" list was short enough to just display without asking me if I really wanted to see all the possibilities. If it hadn't been, I probably just would have said "N". But there they were, "l" commands.

Two of them caught my eye: "lchfn" and "lchsh". What the heck are those, I wondered?

Neither had man pages and when I tried "lchfn --help" it wasn't very helpful. Attempting "lchfn -i" asked for a password but wouldn't authenticate me. I decided it was time to get back to whatever it was I had been trying to do before this side trip.

However, I remembered that, and later in the day I logged into a new Fedora Core 5 box. This had the same two commands and a few more: luseradd and luserdel were two I noticed right away. The Fedora also had man pages, but these were even more puzzling. The commands obviously served the same functions as their equivalents without the leading "l", but the man pages were much shorter. And there was another difference: at the end of each man page, where other commands might say "System Management Command" and a date, these all said "libuser".



Huh? What's "libuser"?

A visit to /usr/share/doc/libuser-0.54 enlightened me a little, as did the accidental discovery of libuser.conf in /etc. Apparently libuser is RedHat's attempt to bring user management tasks under one unifying library. The docs say:

The libuser library implements a standardized interface for manipulating and administering user and group accounts. The library uses pluggable back-ends to interface to its data sources. Sample applications modeled after those included with the shadow password suite are included.

It makes sense to consolidate this stuff , and a search of Google seems to show that other distros may be picking up on this as well: there's a Debian version and you'll find "libuser-perl" in Ubuntu (I'm not certain that's directly related but it definitely serves the same function).

So the question is: are we supposed to be using this stuff? Apparently higher level tools may use this library: I think I'm reading correctly that RedHat's text and gui tools call routines from libuser. Should "luseradd" replace "useradd"?

Apparently not quite yet. The README on FC5 says:

This package is still under development, but the API appears to have settled to the point where it's reasonable to write applications with it.

So, the mystery of "lchfn" and "lchsh" was solved. The "libuser" concept is apparently still in progress, but may be completely deployed someday.


Technorati tags:
If this page was useful to you, please click to help others find it:  
Your +1's can help friends, contacts, and others on the web find the best stuff when they search.


Comments?




More Articles by Anthony Lawrence - Find me on Google+



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide




Buy Kerio from a dealer who knows tech: I sell and support

Kerio Connect Mail server, Control, Workspace and Operator licenses and subscription renewals
pavatar.jpg

This post tagged:

       - Linux




Unix/Linux Consultants

Skills Tests

Guest Post Here