1.\" Copyright (c) 1980, 1990 Regents of the University of California. 2.\" All rights reserved. The Berkeley software License Agreement 3.\" specifies the terms and conditions for redistribution. 4.\" 5.\" @(#)login.1 6.8 (Berkeley) 07/24/90 6.\" 7.Dd 8.Dt LOGIN 1 9.Os BSD 4 10.Sh NAME 11.Nm login 12.Nd sign on 13.Sh SYNOPSIS 14.Nm login 15.Op Fl p 16.Op Ar username 17.Nm login 18.Op Fl p 19.Op Fl h Ar hostname 20.Op Fl f 21.Op Ar username 22.Sh DESCRIPTION 23The 24.Nm login 25command 26is used when a user initially 27signs on. 28It may also be used at any time to change 29from one user to another. 30This case is the one summarized first above and described here. 31See 32.Em How to Get Started 33for how to connect initially. 34The invocation of 35.Nm login 36for initial sign-on 37is made by a system program or server using the latter form of the command 38and is described below. 39.Pp 40If 41.Nm login 42is invoked without an argument, 43it asks for a user name, and, if 44appropriate, a password. 45Echoing is turned off (if possible) during the typing of the password, 46so it will not appear on the written record of the 47session. 48.Pp 49After a successful login, 50accounting files are updated and 51the user is informed of the 52existence of mail. 53The message of the day is printed, 54as is the time of his last login. 55Both are suppressed if he has a 56.Dq Pa .hushlogin 57file in his home directory; this 58is mostly used to make life easier for non-human users, such as 59.Xr uucp 1 . 60.Pp 61.Nm Login 62initializes the user and group IDs and the working directory, 63then executes a command interpreter (usually 64.Xr csh 1 ) 65according to specifications found in a password file. 66Argument 0 of the command interpreter is 67the name of the command interpreter with 68a leading dash 69.Sq Fl . 70.Pp 71Login also modifies the 72environment (see 73.Xr environ 7 ) 74with information specifying home directory, command interpreter, terminal 75type (if available) and user name. 76.Pp 77Options: 78.Pp 79.Tw Ds 80.Tp Fl p 81Causes the remainder of the environment to be preserved, 82otherwise any previous environment is discarded. 83.Tp Fl h 84option is used by 85.Xr telnetd 8 86(at initial login) 87and other servers to list the host from which 88the connection was received. 89.Tp Fl f 90Used with a username on the command line, at initial login, 91to indicate that proper authentication has already been done 92and that no password need be requested. 93This option may be used by the superuser 94or by the user specified on the command line. 95.Tp 96.Pp 97If the file 98.Pa /etc/nologin 99exists, 100.Nm login 101prints its contents on the user's terminal and exits. This is 102used by 103.Xr shutdown 8 104to stop users logging in when the system is about to go down. 105.Pp 106Login is recognized by 107.Xr sh 1 108and 109.Xr csh 1 110and executed directly (without forking). 111.Sh FILES 112.Dw /var/log/wtmp 113.Di L 114.Dp Pa /var/run/utmp 115accounting 116.Dp Pa /var/log/wtmp 117accounting 118.Dp Pa /var/mail/* 119mail 120.Dp Pa /etc/motd 121message-of-the-day 122.Dp Pa /etc/passwd 123password file 124.Dp Pa /etc/nologin 125stops logins 126.Dp Pa \&.hushlogin 127makes login quieter 128.Dp 129.Sh SEE ALSO 130.Xr mail 1 , 131.Xr passwd 1 , 132.Xr rlogin 1 , 133.Xr getpass 3 , 134.Xr passwd 5 , 135.Xr utmp 5 , 136.Xr environ 7 , 137.Xr init 8 , 138.Xr getty 8 , 139.Xr shutdown 8 , 140.Sh HISTORY 141.Nm login 142appeared in Version 6 AT&T Unix. 143.Sh DIAGNOSTICS 144.Dw Fl 145.Di L 146.Dp Li Login incorrect 147if the name or the password is bad. 148.Dp Li No Shell 149.Dp Li cannot open password file 150.Dp Li no directory 151consult a programming counselor. 152.Dp 153