DESLOGIND(1)

NAME
deslogind - daemon for deslogin

SYNOPSIS
deslogind -f userFile] -l logFile] -w name] -p port]
-k cipherKey] -i inactiveSecs] -t loginSecs]

DESCRIPTION

Deslogind is the daemon for the deslogin(1) program, a secure DES authenticated and encrypted login service. This deamon may be run from inetd, or in a standalone fashion. When invoked, it posts a listen(2) on the specified port. When a connection request arrives, it authenticates the remote user and starts up a new login session for the user. All subsequent data transmitted between the session and the remote host is encrypted using the United States Data Encryption Standand in cipher-feedback mode using a unique key for each session. Authentication is performed using a challenge-response protocol that does not transmit passwords over the network. Pass phrases are used for authentication rather than the eight-character passwords of login(1). User names and passphrases are looked up in a file which has been DES encrypted by the cipher(1) program. A gateway service to allow access through a firewall is also available (see deslogingw(1)).

  Options

-f userFile
    Specifies the encrypted file containing user passphrases (Default: /usr/local/etc/netlogind.users). Each line of the file is an 8-character username, a tab, then a passphrase containing any number of 7-bit characters. Lines beginning with a pound "#" character are comments. Use the cipher(1) program to create the encrypted userFile from your plaintext. Use the -d option with cipher to view the encrypted userFile. Make sure to destroy the plaintext once you've verified the encrypted copy is decipherable.

-k  Specify a phrase used as the key for decrypting the userFile. If the -k option is not used, netlogind requests one when it is invoked. Don't use the -k option except for debugging and testing: the command line is visable to any user with the ps(1) command.

-c  Don't prompt for a userFile cipher key. Use the compiled default. Use this option when you must invoke deslogind without human intervention (say from inetd). Don't use this option if the executable file for deslogind is readable by sufficiently determined hostile users.

-n  The userFile is plaintext. Don't prompt for a userFile cipher key. You shouldn't put userFile where it's readable by hostile users.

-d  enable debug output (can't be used by attacker to compromise keys) Use more -d's to get more output. Debug levels greater than 1 prevent any forking of the process which allows use of a debugger.

-l logFile
    Specifies a file for recording connection, login, and logout statistics. (Default: /usr/adm/netlogind.log)

-i inactiveSecs
    An integer specifying the number of seconds of inactivity before the session is terminated (default: 20 minutes). This is a security feature to reduce the probability that an unattended remote session can be exploited by an intruder at the remote site.

-t loginSecs
    An integer specifying the number of seconds to wait for a response after issuing the challenge (default: 60 seconds). The remote user must be able to type the passphrase correctly within this time period including network delays.

-w name
    Run as a wrapper to login. A single system-wide passphrase must be in userFile under the name argument givin with the -w option. Successful authentication invokes the login program instead of a user shell.

-p port
    An integer specifying the TCP port number used to listen for requests. If none is given, /etc/services is consulted. If the deslogin service isn't present, 3005 is used.

WARNINGS

The method used to encrypt the userFile could be better. It's only appropriate for machines which don't have "sufficiently determined" hostile local users. A sufficiently determined hostile user is one who can examine the run-time data segment of another user's deslogind process. They could then look for the internal data structure holding the binary form of the hashed userFile cipher key. Armed with the binary key, they could obtain and modify the source code for cipher to accept the binary data as input and use it to read and decrypt the userFile. Some protection is given by statically linking and stripping deslogind and by ensuring deslogind and the userFile are owned by root, and not readable (or writable) by other users.

Changing the passphrase requires decrypting the userFile using the cipher(1) program, editing the cleartext in a secure local directory from a secure local session, re-enciphering, and overwriting the entire plaintext file.

AUTHENTICATION PROTOCOL

Deslogind uses a "challenge-response" protocol to authenticate users. Upon connection, the remote host sends a line containing the remote user name, then another giving the login name for the local user. Deslogind looks up local user name in the userFile and retrieves the corresponding passphrase which is hashed to produce the user's DES authentication key. An "unpredictable" 64-bit nonce is generated by using the user's authentication key with DES in ECB mode to encrypt the (LSB zero-padded) output of time(2) and getpid(2). Deslogind then encrypts this nonce with the user DES key and sends it as the challenge to the remote machine. The remote deslogin prompts the user for a passphrase which is hashed into a DES key used to decipher the challenge and send back the 64-bit "response". Deslogind compares the response with the nonce; if they're equal, authentication succeeds and a unique session key is generated by encrypting the challenge with the user's DES key. The authentication keys are destroyed by both hosts, and the session key is then used to encrypt all other data transferred.

NOTE

Deslogind does not require root permission to be useful. Regular users may create their own userFiles, encrypt them with cipher, and give appropriate options to deslogind to allow remote login to their account from remote mechines traversing untrusted networks. This is especially useful when you will be away from work and want to be able to access your machine in a safe manner from another trusted site (your home, say). When used in this manner, you cannot became any user other than the owner of deslogind.

For example, the user "martha" on the host "uunet" could do the following:

    $ cipher >$HOME/deslogind.users
    Input Key:
    Verify Key:
    martha    My simple passPhrase
    $ deslogind -l ~/deslogind.log -f ~/userFile -p 2010
    UserFile cipher key:

She can now login from a remote machine by the command:

    $ deslogin martha@uunet:2010
    Pass Phrase:
    uunet $

ENVIRONMENT

The following environment variables are set by deslogind:

LOGNAME
    The authenticated local user name

USER
    Same value as LOGNAME (for BSD users)

HOME
    The home directory as taken from /etc/passwd

SHELL
    The login shell as taken from /etc/passwd

PATH
    Where to look for executables. Set to ":/bin:/usr/bin".

TZ  The timezone of the host where deslogind is running.

MAIL
    The location of the user's maildrop (HP-UX only). Set to "/usr/mail/$LOGNAME".

TERM
    The terminal type. Set to "network" so login scripts can test for this value and reset it appropriately.

RHOSTNAME
    The name of the remote host which connected to deslogind. This information is reliable only to the extent that the domain name system (DNS) and TCP are trustworthy. Use with caution.

Unlike rlogin, deslogind does not pass any environment variables, such as TERM, from the remote host. This is both a liability and a security feature. How much trust should the local host place in information derived from the remote host? Passing enviroment variables can be dangerous and complex.

MISSING FEATURES

A program to change passphrases, add, and delete users.

A better security method for the userFile should be designed.

ACKNOWLEDGEMENTS

Comments and improvements will be greatly appreciated and should be directed to the author:

David A. Barrett (barrett@asgard.cs.Colorado.EDU)

Copyright 1994 by David. A. Barrett.

This program is not to be distributed for profit or included in such software without written permission from the author. No permission is required for non-profit use.

FILES
/usr/local/etc/deslogind.users    default userFile
/usr/adm/deslogind.log    default log file
/etc/services    to determine TCP port
/etc/nologin    disabled login message
/etc/passwd    for user id, gid, home, shell
/etc/group    for supplementary group id's
/etc/utmp    active user sessions
/etc/wtmp    log of user sessions
/dev/tty    to get userFile cipherKey
/dev/pty*    session controlling terminal
/bin/login    program invoked by -w option

SEE ALSO
cipher(1), inetd(1m), rlogind(1), telnetd(1), deslogin(1), deslogingw(1), login(1).