Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running SLED 11, and I want to understand what the useradd command does and how it does what it does. I know that SLED 11 is built from OpenSuSE 11.1 and I would be more than satisfied with the OpenSuSE 11.1 source code for useradd.

Where can I find the source code for useradd?

share|improve this question
add comment

4 Answers

up vote 2 down vote accepted

On openSUSE useradd is from package pwdutils. Homepage http://www.thkukuk.de/pam/pwdutils/, source ftp://ftp.kernel.org/pub/linux/utils/net/NIS/

share|improve this answer
add comment

since SUSE is an rpm based distro, you should be able get it by:

$ rpm -qf `which useradd`

which will tell you which package it is in. You can then go get that package source from the repository, which in my case is here: http://download1.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/source/SRPMS/shadow-utils-4.1.2-13.fc11.src.rpm (I run fedora; your package repository location will be different)

share|improve this answer
add comment

Don't know about SLED, but the Debian version is available here.

share|improve this answer
add comment

The useradd utility might well be a script.

Try

$ file $(which useradd)

(or

file `which useradd`

if your shell doesn't support $() style command expansion).

If it is a script, use more or an editor...

share|improve this answer
    
file $(which useradd) returns: /usr/sbin/useradd: ELF 32-bit LSB executable, Intel 80386. version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped –  eleven81 Oct 26 '09 at 17:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.