-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                           UNIX                            -
-        Password & Login programming information &         -
-        command summary                                    -
-===========================================================-
- Pilfered from a UNIX system and edited by BIOC Agent 003  -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    NOTE: Sub-Titles with a 'C' suffix indicate C programming
information.

                               PASSWD 1

NAME
----

passwd  - change login password

SYNOPSIS
--------

passwd
name

DESCRIPTION
-----------

    This command changes (or installs) a password associated
with the login name. The program prompts for the old password
(if any) and then for the new one (twice)). The caller must
supply these. New passwords should be at least four characters
long if they use a sufficiently rich alphabet and at least six
characters long if monocase. Only the first eight characters of
the password are significant.

    Only the owner of the name or the super-user may change a
password; the owner must prove he knows the old password. Only
the super-user can create a null password.

    The password file is not changed if the new password is the
same as the old password, or if the password has not 'aged'
sufficiently [see passwd (5)].

FILES
-----

/etc/passwd

SEE ALSO
--------

login(1), crypt(3C), passwd(5)
----------------------------------------------------------------

                               PASSWD 5

NAME
----

passwd - password file

DESCRIPTION
-----------

    Passwd contains for each user the following information:

    login name
    encrypted password
    numerical user ID
    numerical group ID
    GCOS job number, box number, optional GCOS user ID
    initial working directory
    program to use as Shell

    This is an ASCII file. Each field with each user's entry is
separated from the next by a colon. The GCOS field is used only
when communicating with that system, and in other installations
can contain any desired information. Each user is separated from
the next by a new line. If the password field is null, no
password is demanded; if the Shell field is null, the Shell
itself is used.

    This file resides in directory /etc. Because of the
encrypted passwords, it can and does have general read
permission and can be used, for eaxmple, to map numerical user
ID's to names.

    The encrypted password consists of 13 characters chosen from
a 64 alphabet ('.', '/', '0-9', 'A-Z', 'a-z'), except when the
password is null, in which case the encrypted password is also
null. Password aging is effected for a particular user if his
encrypted password in the password file is followed by a comma
and a non-null string of characters from the above alphabet
(such a string must be introduced in age, M 'say,' denotes the
maximum number of weeks for which a password is valid. A user
who attempts to login after his password has expired will be
forced to supply a new one. The next character, m 'say,' denotes
the minimum period in weeks which must expire before the
password may be changed. The remaining characters define the
week when the password was last changed. A null string is
equivalent to zero. M and m have numerical values in the range
0-63. If 'm' = 'M' = 0 (derived from the string . or .. ), the
user will be forced to change his password the next time he logs
in (and the 'age' will disappear from his entry in the password
file). 'm' > 'M' (signified by the string ./), only the
super-user will be able to change the password.

FILES
-----

/etc/passwd

SEE ALSO
--------

login(1), passwd(1), a641(3C), crypt(3C), getpwent(3C), group(5)
--------------------------------------------------------------

                                LOGIN 1

NAME
----

login - sign on

DESCRIPTION
-----------

    The login command is used at the beginning of each terminal
session and allows you to identify yourself to the system. It
can no longer be invoked explicitly, but is invoked by the
system when a connection is first established, or after the
previous user has logged out by sending an 'end-of-file'
(CTRL-D) to his or her initial shell.

    Login asks for your user name, and, if appropiate, your
password. Echoing is turned off (where possible) during the
typing of your password, so it will not appear on the written
record of the session.

    At some installations, an option may be invoked that will
require you to enter a second 'external' password. This will
occur only for dial-up connections, and will be prompted by
message 'External Security:'. Both passwords are required for a
successful login.

    If password aging has been invoked by the super-user on your
behalf, your password may have expired. In this case, you will
be shunted into passwd(1) to change it, after which you may
attempt to login again.

    If you do not complete the login successfully within a
certain period of time (e.g. one minute), you are likely to be
silently disconnected.

    After a successful login, accounting files are updated, you
will be informed of the existence (if any) of mail, and the
profiles (i.e., /etc/profile ' and ' $HOME.profile ) (if any)
are excuted (see profile(5)).

    Login initializes the user and group IDs and the working
directory, then executes a command interpreter (usually sh(1))
according to specifications found in the /etc/passwd file.
Argument 0 of the command interpreter is - , followed by the
last component of the interpreter's path name. The environment
(see environ(7)) is initialized to:

HOME= your-login-directory

PATH=:/bin:/usr/bin

LOGNAME= your-login-name

FILES
-----

/usr/mail/your-name     mailbox for user your-name

/etc/utmp               accounting

/usr/adm/wtmp           accounting

/etc/motd               message-of-the-day

/etc/passwd             password file

/etc/profile            system profile

$HOME-4profile          personal profile

SEE ALSO
--------

mail(1), newgrp(1), sh(1), passwd(1), su(1), passwd(5),
profile(5), environ(7), getty(8)

DIAGNOSTICS
-----------

Second 'external' password. This will occur only for dial-up
connections, and 'Login incorrect' if the user name or the
password is incorrect.

'No shell', 'cannot open password file', 'no directory': consult
a UNIX programming counselor.

'Your password has expired', 'Choose a new one' if password
aging is implemented.
--------------------------------------------------------------

                            GETPWENT 3C

NAME
----

getpwent, getpwuid, getpwnam, setpwent, endpwent - Get password file
                                                   entry.

SYNOPSIS
--------

#include <pwd.h>
struct passwd  *getpwent ( );

struct passwd  *getpwuid (uid)
int uid;

struct passwd  *getpwnam (name)

char  *name;

int setpwent ( );

int endpwent ( );

DESCRIPTION
-----------

    Getpwent, getpwuid, and getpwnam each returns a pointer to
an object with the following structure containing the broken-out
fields of a line in the password file.

/usr/include/pwd.h

    The pw_comment field is unused; the others have meanings
described in passwd(5).

    Getpwent reads the next line in the file, so successive
calls can be used to search the entire file. Getpwuid and
getpwnam search from the beginning of the file until a matching
uid or name is found, or EOF is encountered.

    A call to setpwent has the effect of rewinding the password
file to allow repeated searches. Endpwent may be called to close
the password file when processing is complete.

FILES
-----

/etc/passwd

SEE ALSO
--------

getlogin(3C), getgrent(3C), passwd(5)

DIAGNOSTICS
-----------

Null pointer (0) returned on EOF or error.

BUGS
----

    All information is contained is a static area so it must be
copied if it is to be saved.
---------------------------------------------------------------

                            GETLOGIN 3C

NAME
----

getlogin - Get login name

SYNOPSIS
--------

char *getlogin ( );

DESCRIPTION
-----------

    Getlogin returns a pointer to the login name as found in
/etc/utmp. It may be used in conjunction with getpwnam to locate
the correct password file entry when the same user ID is shared
by several login names.

    If getlogin is called within a process that is not attached
to a typewriter, it returns NULL. The correct procedure for
determing the login name is to call cuserid, or to call getlogin
and if it fails, to call getpwuid.


FILES
-----

/etc/utmp

SEE ALSO
--------

cuserid(3S), getgrent(3C), getpwent(3C), utmp(5)

DIAGNOSTICS
-----------

    Returns NULL if name not found.

BUGS
----

    The return values point to static data whose content is
overwritten by each call.
---------------------------------------------------------------
