tinylogin <function> [arguments...] # or
<function> [arguments...] # if symlinked
Why is something like TinyLogin useful?
[andersen@slag tinylogin]$ du -ch `which adduser addgroup deluser delgroup login su sulogin passwd getty`
22k /usr/sbin/adduser 4.0k /usr/sbin/addgroup 35k /bin/login 22k /bin/su 8.5k /sbin/sulogin 24k /usr/bin/passwd 13k /sbin/getty 129k total
[andersen@slag tinylogin]$ ls -sh ./tinylogin 40k ./tinylogin*`nuff said.
TinyLogin is a curious blend of code from a whole bunch of folks. It was originally cobbled together by Sean Bastille <hightide@ginch.org> based in part on the May of 1998 version of the shadow utilities, which can be downloaded from: ftp://ftp.ists.pwr.wroc.pl/pub/linux/shadow/ The build system, and the way in which TinyLogin invokes its component applications has been totally rewritten, based on the build system used for BusyBox. The code has also been majorly reworked to make it more internally consistent, to make it use fewer global variables, etc, by Erik Andersen.
TinyLogin may be used and distributed under the terms of GNU General Public License, with the addition of the special terms enumerated below by the shadow utilities license (a BSD style license which allows me to make future releases under the GPL).
After the build is complete a tinylogin.links file is generated which is then used by `make install' to create symlinks to the tinylogin binary for all compiled in functions. By default, `make install' will place a symlink forest into `pwd`/_install unless you have defined the PREFIX environment variable.
# /etc/nsswitch.conf # Note that if you are doing networking, # other entries will also be needed. passwd: compat group: compat shadow: compatFurthermore, you will also need to include the library /lib/libnss_compat so that GNU Libc can find it when it is needed (it is dynamicaly loaded, so `ldd' won't tell you that you need it -- which is why I've devoted this entire section of the manual to tell you you need it).
adduser, addgroup, deluser, delgroup, login, su, sulogin,
passwd, getty
Usage: adduser [OPTIONS]... <USER>
Options:
-h <directory> specify home directory -s <shell> specify shell -g <gecos> specify GECOS stringDefault values are as follows:
HOME=/home/$USER SHELL=/bin/sh GECOS="Embedix,,,"Description:
This utility adds a user to /etc/passwd and /etc/group. If shadow is enabled /etc/shadow and /etc/gshadow are also updated w/ appropriate information. The group name is set to the same value as the user name. To set the initial password, adduser executes passwd which presents an interactive prompt. This makes adduser inappropriate for batch account creation.
Normally, something like adduser is implemented in a scripting language, but this one was implemented in C. The rationale for this was that in a small system, one might not have space for certain Unix shell utilities that are normally taken for granted or that one might not have space for even a minimal perl installation. Such limitations could make making a robust adduser implementation difficult, so the only viable option left was to do it in C.
When implementing adduser, the semantics of Debian's adduser
perl script were used as a reference, so those of you familiar
with that should notice similarities.
-------------------------------
Usage: addgroup [OPTIONS]... <GROUP>
Options:
-g <number> specify gidDescription:
This utility adds a group to /etc/group and if necessary,
/etc/gshadow as well. If the GID is not specified, addgroup
will try to find the next available gid within the range of
[100..64000].
-------------------------------
Usage: deluser <USER>
Description:
This utility only takes one parameter which is the user name. It will search /etc/passwd and delete the user's account if it exists.
NOTE: Although adduser adds both users and groups,
deluser only deletes users.
-------------------------------
Usage: delgroup <USER>
Description:
This utility only takes one parameter which is the group name. It will search /etc/passwd and delete the group if it exists.
NOTE: Although adduser adds both users and groups,
delgroup only deletes groups.
-------------------------------
Usage: login
-------------------------------
Note that for su to work, the tinylogin binary must be setuid root.
-------------------------------
Sean Bastille <hightide@ginch.org>
John Beppu <beppu@lineo.com>
Julianne Frances Haugh <unknown@unknown>