1.\" $NetBSD: rlogind.8,v 1.17 2004/07/17 18:33:23 wiz Exp $ 2.\" 3.\" Copyright (c) 1983, 1989, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" from: @(#)rlogind.8 8.1 (Berkeley) 6/4/93 31.\" 32.Dd July 17, 2004 33.Dt RLOGIND 8 34.Os 35.Sh NAME 36.Nm rlogind 37.Nd remote login server 38.Sh SYNOPSIS 39.Nm 40.Op Fl alnL 41.Sh DESCRIPTION 42.Nm 43is the server for the 44.Xr rlogin 1 45program. 46The server provides a remote login facility with authentication 47based on privileged port numbers from trusted hosts. 48.Pp 49Options supported by 50.Nm : 51.Bl -tag -width Ds 52.It Fl a 53Ask hostname for verification. 54.It Fl l 55Prevent any authentication based on the user's 56.Dq Pa .rhosts 57file, unless the user is logging in as the superuser. 58.It Fl n 59Disable keep-alive messages. 60.It Fl L 61Log all successful accesses to 62.Xr syslogd 8 63as 64.Li auth.info 65messages. 66.El 67.Pp 68.Nm 69listens for service requests at the port indicated in 70the ``login'' service specification; see 71.Xr services 5 . 72When a service request is received the following protocol is initiated: 73.Bl -enum 74.It 75The server checks the client's source port. 76If the port is not in the range 512-1023, the server 77aborts the connection. 78.It 79The server checks the client's source address 80and requests the corresponding host name (see 81.Xr getnameinfo 3 , 82.Xr hosts 5 83and 84.Xr named 8 ) . 85If the hostname cannot be determined, 86the dot-notation representation of the host address is used. 87If the hostname is in the same domain as the server (according to 88the last two components of the domain name), 89or if the 90.Fl a 91option is given, 92the addresses for the hostname are requested, 93verifying that the name and address correspond. 94Normal authentication is bypassed if the address verification fails. 95.El 96.Pp 97Once the source port and address have been checked, 98.Nm 99proceeds with the authentication process described in 100.Xr rshd 8 . 101It then allocates a pseudo terminal (see 102.Xr pty 4 ) , 103and manipulates file descriptors so that the slave 104half of the pseudo terminal becomes the 105.Em stdin , 106.Em stdout , 107and 108.Em stderr 109for a login process. 110The login process is an instance of the 111.Xr login 1 112program, invoked with the 113.Fl f 114option if authentication has succeeded. 115If automatic authentication fails, the user is 116prompted to log in as if on a standard terminal line. 117.Pp 118The parent of the login process manipulates the master side of 119the pseudo terminal, operating as an intermediary 120between the login process and the client instance of the 121.Xr rlogin 1 122program. 123In normal operation, the packet protocol described in 124.Xr pty 4 125is invoked to provide 126.Ql ^S/^Q 127type facilities and propagate 128interrupt signals to the remote programs. 129The login process propagates the client terminal's baud rate and 130terminal type, as found in the environment variable, 131.Ql Ev TERM ; 132see 133.Xr environ 7 . 134The screen or window size of the terminal is requested from the client, 135and window size changes from the client are propagated to the pseudo terminal. 136.Pp 137Transport-level keepalive messages are enabled unless the 138.Fl n 139option is present. 140The use of keepalive messages allows sessions to be timed out 141if the client crashes or becomes unreachable. 142.Pp 143At the end of a login session, 144.Nm 145invokes the 146.Xr ttyaction 3 147facility with an action of "rlogind" and user "root" 148to execute site-specific commands. 149.Sh DIAGNOSTICS 150All initial diagnostic messages are indicated 151by a leading byte with a value of 1, 152after which any network connections are closed. 153If there are no errors before 154.Xr login 1 155is invoked, a null byte is returned as in indication of success. 156.Bl -tag -width Ds 157.It Sy Try again. 158A 159.Xr fork 2 160by the server failed. 161.El 162.Sh SEE ALSO 163.Xr login 1 , 164.Xr ruserok 3 , 165.Xr ttyaction 3 , 166.Xr rshd 8 167.Sh HISTORY 168The 169.Nm 170command appeared in 171.Bx 4.2 . 172.Sh BUGS 173The authentication procedure used here assumes the integrity 174of each client machine and the connecting medium. 175This is insecure, but is useful in an ``open'' environment. 176.Pp 177A facility to allow all data exchanges to be encrypted should be 178present. 179.Pp 180A more extensible protocol should be used. 181.Pp 182.Nm 183intentionally rejects accesses from IPv4 mapped address on top of 184.Dv AF_INET6 185socket, since IPv4 mapped address complicates host-address based 186authentication. 187If you would like to accept connections from IPv4 peers, you will need to run 188.Nm 189on top of 190.Dv AF_INET 191socket, not 192.Dv AF_INET6 193socket. 194