.\" $Id: autologin.man,v 2.8 2012/07/06 20:58:39 ksb Exp $ .\" $Compile: Display%h .\" $Display: groff -Tascii -man %f | ${PAGER:-less} .\" $Install: %b -mDeinstall %o %f && cp %f $DESTDIR/usr/local/man/man8/autologin.8 .\" $Deinstall: ${rm-rm} -f $DESTDIR/usr/local/man/[cm]a[nt][18]/autologin.8* .TH AUTOLOGIN 8 LOCAL .SH NAME autologin - create an automatic login session from /etc/inittab .SH SYNOPSIS .ds PN "autologin \fI\*(PN\fP [\fB\-Cu\fP] [\fB\-c\fP\~\fIcommand\fP] [\fB\-e\fP\~\fIenv\fP\fB=\fP\fIval\fP] [\fB\-g\fP\~\fIgroup\fP] [\fB\-l\fP\~\fIlogin\fP] [\fB\-t\fP\~\fItty\fP] .br \fI\*(PN\fP \fB\-h\fP .br \fI\*(PN\fP \fB\-V\fP .SH DESCRIPTION \fIAutologin\fP creates a login session for \fIlogin\fP by running an \*(lq\fBsu\fP \- \fIloginf\P\*(rq on the specified device .RI ( tty ). If a \fIcommand\fP is given, that command is executed via .RS \*(lqsu \fIlogin\fP \-c \fIcommand\fP\*(rq .RE .PP .I Autologin also changes the ownership of the tty port to the user and sets the mode to 0600. .PP On AIX, .I autologin uses \fBgetuserattr\fP(3) to determine which groups are required to \fBsu\fP to \fIlogin\fP and sets those groups for the process before executing the \fBsu\fP(1) command. .PP On FreeBSD the gettytab(5) manual page has a new attribue \fBal\fP which largely replaces \fI\*(PN\fP for a shell. .SH OPTIONS .TP .BI \-C Asserts the ioctl(2) to redirect console output to the .I tty device. This can be used from \fBconserver\fP's virtual console facillity to emulate a system console. .TP .BI \-c command Execute command rather than a login shell. .TP .BI \-e env = val Add the evironment variable assignment .IB env = val to the environment. .TP .BI \-g group Add .I group to current process group set before running \fBsu\fP(1). This option probably isn't necessary since the group set should be properly handled through the use of \fBgetuserattr\fP(3). .TP .BI \-l login Create the login process for the user \fIlogin\fP. If none is given the effective uid is used. .TP .BI \-t tty .I tty is the name of the character-special file that corresponds to the terminal to be logged in. If none is given the current controlling terminal is used. .TP .B \-u Don't create a utmp entry. Normally, an entry is written to .I /etc/utmp to maintain a record of users logged into the system. .SH EXAMPLES Adding the following line to .I /etc/inittab on an AIX machine establishes a root login on the console terminal .RI ( /dev/tty0 ) with any error messages directed to \fB/dev/consolef\P: .RS .nf cons2:2:respawn:/usr/local/etc/autologin \-t/dev/tty0 \-lroot > /dev/console 2>&1 .fi .RE .PP Adding the following line to \fB/etc/inittab\fP on an AIX machine causes ssinfo to be logged in on \fB/dev/tty10\fP with the \fBTERM\fP environment variable set to \*(lqreg20\*(rq: .RS .nf ss10:2:respawn:/usr/local/etc/autologin \-e TERM=reg20 \-t/dev/tty10 \-lssinfo .fi .RE .PP Adding the following line to \fI/etc/ttytab\fP on a Sun 4.1.\fIx\fP machine establishes a root login on the console device: .br .na console "/usr/local/etc/autologin \-lroot \-t" xterm on local secure .ad .PP Note that \fIinit\fP provides the \fItty\fP argument on the end of the command. .SH BUGS Doesn't add entries to /usr/adm/wtmp or wtmpx. Depends on init(8) to add any utmp entries, even when it was not run directly by init. .P Only runs on FREEBSD, LINUX, SUN3, SUN4, SUN5, EPIX, IBMR2 (AIX), PARAGON, HPUX9, 10, 11 (currently). .P Some versions of init do not set the session ID, which will cause complaints about getpgrp and setpgrp and will not associate /dev/tty with the terminal. A workaround is to use the \fB\-t\fP option, by forcing \fI\*(PN\fP to open the terminal, set a process group leader and a session ID we work around the lame version of init. .SH FILES /bin/su .br /etc/inittab .br /etc/passwd .br /etc/utmp .SH AUTHORS Jeff W\. Stewart \- Purdue University Computing Center .br KS Braunsdorf \- NPC Guild.org .SH "SEE ALSO" .hlm 0 su(1), gettytab(5), getuserattr(3), inittab(5), init(8), conserver(8l)