Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ login(1) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

ksh(1)

mail(1)

mailx(1)

passwd(1)

rlogin(1)

rsh(1)

sh(1)

shell_builtins(1)

telnet(1)

admintool(1M)

in.rlogind(1M)

in.telnetd(1M)

logins(1M)

newgrp(1M)

quota(1M)

su(1M)

syslogd(1M)

useradd(1M)

userdel(1M)

syslog(3)

hosts.equiv(4)

logindevperm(4)

loginlog(4)

passwd(4)

profile(4)

shadow(4)

environ(5)

login(1)

NAME

login − sign on to the system

SYNOPSIS

login [ −d device ] [ −h hostname [ terminal ] | −r hostname ] [ name [ environ ... ] ]

AVAILABILITY

SUNWcsu

DESCRIPTION

The login command is used at the beginning of each terminal session and allows you to identify yourself to the system.  It is invoked by the system when a connection is first established and after the previous user has terminated the login shell by issuing the exit command. 

If login is invoked as a command it must replace the initial command interpreter.  This is accomplished by typing:

exec login

from the initial shell. 

login asks for your user name (if it is not supplied as an argument), and if appropriate, 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. 

If there are no lower-case characters in the first line of input processed, login assumes the connecting TTY is an upper-case-only terminal and sets the port’s termio(7) options to reflect this. 

If you make any mistake in the login procedure, the message:

Login incorrect

is printed and a new login prompt will appear.  If you make five incorrect login attempts, all five may be logged in /var/adm/loginlog (if it exists) and the TTY line will be dropped. 

If you do not complete the login successfully within a certain period of time, it is likely that you will be silently disconnected. 

After a successful login, accounting files are updated; device owner, group, and permissions are set according to the contents of the /etc/logindevperm file (see logindevperm(4)); and the time you last logged in is printed. 

The user-ID, group-ID, supplementary group list, and working directory are initialized, and the command interpreter (usually ksh) is started. 

The basic environment is initialized to:

HOME=your-login-directory
LOGNAME=your-login-name
PATH=/usr/bin:
SHELL=last-field-of-passwd-entry
MAIL=/var/mail/your-login-name
TZ=timezone-specification

For Bourne shell and Korn shell logins, the shell executes /etc/profile and $HOME/.profile (if it exists).  For C shell logins, the shell executes /etc/.login, $HOME/.cshrc, and $HOME/.login.  The default /etc/profile and /etc/.login files check quotas (see quota(1M)), print /etc/motd and check for mail.  None of the messages are printed if the file $HOME/.hushlogin exists.  The name of the command interpreter is set to − (dash), followed by the last component of the interpreter’s path name (for example, −sh). 

If the login-shell field in the password file (see passwd(4)) is empty, then the default command interpreter, /usr/bin/sh, is used.  If this field is ∗ (asterisk), then the named directory becomes the root directory.  At that point login is re-executed at the new level which must have its own root structure. 

The environment may be expanded or modified by supplying additional arguments to login, either at execution time or when login requests your login name.  The arguments may take either the form xxx or xxx=yyy.  Arguments without an equal sign are placed in the environment as:

Ln=xxx

where n is a number starting at 0 and is incremented each time a new variable name is required.  Variables containing an = are placed in the environment without modification.  If they already appear in the environment, then they replace the older value.  There are two exceptions.  The variables PATH and SHELL cannot be changed.  This prevents people, logging into restricted shell environments, from spawning secondary shells which are not restricted.  login understands simple single-character quoting conventions.  Typing a ‘ \ ’ (backslash) in front of a character quotes it and allows the inclusion of such characters as spaces and tabs. 

To enable remote logins by root, edit the /etc/default/login file by inserting a ‘ # ’ (pound-sign) before the CONSOLE=/dev/console entry.  See FILES below. 

OPTIONS

−d device login accepts a device option, device.  device is taken to be the path name of the TTY port login is to operate on.  The use of the device option can be expected to improve login performance, since login will not need to call ttyname(3C).  The −d option is available only to users whose UID and effective UID are root.  Any other attempt to use −d will cause login to quietly exit. 

−h hostname [ terminal ]
used by in.telnetd(1M) to pass information about the remote host and terminal type. 

−r hostname
used by in.rlogind(1M) to pass information about the remote host. 

FILES

$HOME/.cshrc initial commands for each csh

$HOME/.hushlogin suppresses login messages

$HOME/.login user’s login commands for csh

$HOME/.profile user’s login commands for sh and ksh

$HOME/.rhosts private list of trusted hostname/username combinations

/etc/.login system-wide csh login commands

/etc/logindevperm login-based device permissions

/etc/motd message-of-the-day

/etc/passwd password file

/etc/profile system-wide sh and ksh login commands

/etc/shadow list of users’ encrypted passwords

/usr/bin/sh user’s default command interpreter

/var/adm/lastlog time of last login

/var/adm/loginlog record of failed login attempts

/var/adm/utmp accounting

/var/adm/wtmp accounting

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

/etc/default/login Default value can be set for the following flags in /etc/default/login.  For example: TIMEZONE=EST5EDT or PASSREQ=YES. 

TIMEZONE: Sets the TZ environment variable of the shell. 

HZ: Sets the HZ environment variable of the shell. 

ULIMIT: Sets the file size limit for the login.  Units are disk blocks.  Default is zero (no limit). 

CONSOLE: If set, root can login on that device only.  This will not prevent execution of remote commands with rsh(1).  Comment out this line to allow login by root. 

PASSREQ: Determines if login requires a password. 

ALTSHELL: Determines if login should set the SHELL environment variable. 

PATH: Sets the initial shell PATH variable. 

SUPATH: Sets the initial shell PATH variable for root. 

TIMEOUT: Sets the number of seconds (between 0 and 900) to wait before abandoning a login session. 

UMASK: Sets the initial shell file creation mode mask.  See umask(1). 

SYSLOG: determines whether the syslog(3) LOG_AUTH facility should be used to log all root logins at level LOG_NOTICE and multiple failed login attempts at LOG_CRIT. 

SLEEPTIME If present sets the number of seconds to wait before login failure is printed to the screen and another login and another login attempt is allowed.  Default is 4 seconds; Minimum is 0 seconds. Maximum is 5 seconds. 

SEE ALSO

csh(1), ksh(1), mail(1), mailx(1), passwd(1), rlogin(1), rsh(1), sh(1), shell_builtins(1), telnet(1), admintool(1M), in.rlogind(1M), in.telnetd(1M), logins(1M), newgrp(1M), quota(1M), su(1M), syslogd(1M), useradd(1M), userdel(1M), syslog(3), hosts.equiv(4), logindevperm(4), loginlog(4), passwd(4), profile(4), shadow(4), environ(5)

DIAGNOSTICS

Login incorrect The user name or the password cannot be matched. 

Not on system console
Root login denied.  Check the CONSOLE setting in /etc/default/login. 

No directory! Logging in with home=/
The user’s home directory named in the passwd(4) database cannot be found or has the wrong permissions.  Contact your system administrator. 

No shell Cannot execute the shell named in the passwd(4) database.  Contact your system administrator. 

WARNINGS

If you use the CONSOLE setting to disable root logins, you should arrange that remote command execution by root is also disabled.  See rsh(1), rcmd(3N), and hosts.equiv(4) for further details. 
 

SunOS 5.4  —  Last change: 26 Sep 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026