xref: /netbsd-src/libexec/rlogind/rlogind.8 (revision 63876784275e831e89ad5beb9ec02051c616429a)
1*63876784Swiz.\"	$NetBSD: rlogind.8,v 1.17 2004/07/17 18:33:23 wiz Exp $
204766f1dSmrg.\"
313514eadScgd.\" Copyright (c) 1983, 1989, 1991, 1993
413514eadScgd.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
148e6ab883Sagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
3013514eadScgd.\"     from: @(#)rlogind.8	8.1 (Berkeley) 6/4/93
3161f28255Scgd.\"
32*63876784Swiz.Dd July 17, 2004
3361f28255Scgd.Dt RLOGIND 8
34f1247650Sgarbled.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm rlogind
3761f28255Scgd.Nd remote login server
3861f28255Scgd.Sh SYNOPSIS
39966d406aSenami.Nm
409e4b2c60Slukem.Op Fl alnL
4161f28255Scgd.Sh DESCRIPTION
42966d406aSenami.Nm
4361f28255Scgdis the server for the
4461f28255Scgd.Xr rlogin 1
455ce6614aSfairprogram.
465ce6614aSfairThe server provides a remote login facility with authentication
475ce6614aSfairbased on privileged port numbers from trusted hosts.
4861f28255Scgd.Pp
4961f28255ScgdOptions supported by
50990562bfSwiz.Nm :
5161f28255Scgd.Bl -tag -width Ds
5261f28255Scgd.It Fl a
5361f28255ScgdAsk hostname for verification.
5461f28255Scgd.It Fl l
5561f28255ScgdPrevent any authentication based on the user's
5661f28255Scgd.Dq Pa .rhosts
5761f28255Scgdfile, unless the user is logging in as the superuser.
5861f28255Scgd.It Fl n
5961f28255ScgdDisable keep-alive messages.
609e4b2c60Slukem.It Fl L
619e4b2c60SlukemLog all successful accesses to
629e4b2c60Slukem.Xr syslogd 8
639e4b2c60Slukemas
649e4b2c60Slukem.Li auth.info
659e4b2c60Slukemmessages.
6661f28255Scgd.El
6761f28255Scgd.Pp
68966d406aSenami.Nm
6961f28255Scgdlistens for service requests at the port indicated in
7061f28255Scgdthe ``login'' service specification; see
7161f28255Scgd.Xr services 5 .
725ce6614aSfairWhen a service request is received the following protocol is initiated:
7361f28255Scgd.Bl -enum
7461f28255Scgd.It
7561f28255ScgdThe server checks the client's source port.
7661f28255ScgdIf the port is not in the range 512-1023, the server
7761f28255Scgdaborts the connection.
7861f28255Scgd.It
7961f28255ScgdThe server checks the client's source address
8061f28255Scgdand requests the corresponding host name (see
8124d271a9Swiz.Xr getnameinfo 3 ,
8261f28255Scgd.Xr hosts 5
8361f28255Scgdand
8461f28255Scgd.Xr named 8 ) .
8561f28255ScgdIf the hostname cannot be determined,
8661f28255Scgdthe dot-notation representation of the host address is used.
8761f28255ScgdIf the hostname is in the same domain as the server (according to
8861f28255Scgdthe last two components of the domain name),
8961f28255Scgdor if the
9061f28255Scgd.Fl a
9161f28255Scgdoption is given,
9261f28255Scgdthe addresses for the hostname are requested,
9361f28255Scgdverifying that the name and address correspond.
9461f28255ScgdNormal authentication is bypassed if the address verification fails.
9561f28255Scgd.El
9661f28255Scgd.Pp
9761f28255ScgdOnce the source port and address have been checked,
98966d406aSenami.Nm
9961f28255Scgdproceeds with the authentication process described in
10061f28255Scgd.Xr rshd 8 .
10161f28255ScgdIt then allocates a pseudo terminal (see
10261f28255Scgd.Xr pty 4 ) ,
10361f28255Scgdand manipulates file descriptors so that the slave
10461f28255Scgdhalf of the pseudo terminal becomes the
10561f28255Scgd.Em stdin ,
10661f28255Scgd.Em stdout ,
10761f28255Scgdand
10861f28255Scgd.Em stderr
10961f28255Scgdfor a login process.
11061f28255ScgdThe login process is an instance of the
11161f28255Scgd.Xr login 1
11261f28255Scgdprogram, invoked with the
11361f28255Scgd.Fl f
11461f28255Scgdoption if authentication has succeeded.
11561f28255ScgdIf automatic authentication fails, the user is
11661f28255Scgdprompted to log in as if on a standard terminal line.
11761f28255Scgd.Pp
11861f28255ScgdThe parent of the login process manipulates the master side of
11961f28255Scgdthe pseudo terminal, operating as an intermediary
12061f28255Scgdbetween the login process and the client instance of the
1215ce6614aSfair.Xr rlogin 1
1225ce6614aSfairprogram.
1235ce6614aSfairIn normal operation, the packet protocol described in
12461f28255Scgd.Xr pty 4
12561f28255Scgdis invoked to provide
12661f28255Scgd.Ql ^S/^Q
12761f28255Scgdtype facilities and propagate
1285ce6614aSfairinterrupt signals to the remote programs.
1295ce6614aSfairThe login process propagates the client terminal's baud rate and
1305ce6614aSfairterminal type, as found in the environment variable,
13161f28255Scgd.Ql Ev TERM ;
13261f28255Scgdsee
13361f28255Scgd.Xr environ 7 .
13461f28255ScgdThe screen or window size of the terminal is requested from the client,
13561f28255Scgdand window size changes from the client are propagated to the pseudo terminal.
13661f28255Scgd.Pp
13761f28255ScgdTransport-level keepalive messages are enabled unless the
13861f28255Scgd.Fl n
13961f28255Scgdoption is present.
14061f28255ScgdThe use of keepalive messages allows sessions to be timed out
14161f28255Scgdif the client crashes or becomes unreachable.
142c89a574fStsarna.Pp
143c89a574fStsarnaAt the end of a login session,
144c89a574fStsarna.Nm
145c89a574fStsarnainvokes the
146c89a574fStsarna.Xr ttyaction 3
147c89a574fStsarnafacility with an action of "rlogind" and user "root"
148c89a574fStsarnato execute site-specific commands.
14961f28255Scgd.Sh DIAGNOSTICS
15061f28255ScgdAll initial diagnostic messages are indicated
15161f28255Scgdby a leading byte with a value of 1,
15261f28255Scgdafter which any network connections are closed.
15361f28255ScgdIf there are no errors before
1545ce6614aSfair.Xr login 1
15561f28255Scgdis invoked, a null byte is returned as in indication of success.
15661f28255Scgd.Bl -tag -width Ds
15761f28255Scgd.It Sy Try again.
15861f28255ScgdA
15942aff08cSfair.Xr fork 2
16061f28255Scgdby the server failed.
16161f28255Scgd.El
16261f28255Scgd.Sh SEE ALSO
16361f28255Scgd.Xr login 1 ,
16461f28255Scgd.Xr ruserok 3 ,
165399d20a2Swiz.Xr ttyaction 3 ,
16661f28255Scgd.Xr rshd 8
167110806f7Swiz.Sh HISTORY
168110806f7SwizThe
169110806f7Swiz.Nm
170110806f7Swizcommand appeared in
171110806f7Swiz.Bx 4.2 .
17261f28255Scgd.Sh BUGS
17361f28255ScgdThe authentication procedure used here assumes the integrity
1745ce6614aSfairof each client machine and the connecting medium.
1755ce6614aSfairThis is insecure, but is useful in an ``open'' environment.
17661f28255Scgd.Pp
17761f28255ScgdA facility to allow all data exchanges to be encrypted should be
17861f28255Scgdpresent.
17961f28255Scgd.Pp
18061f28255ScgdA more extensible protocol should be used.
1816fc49112Sitojun.Pp
1826fc49112Sitojun.Nm
1836fc49112Sitojunintentionally rejects accesses from IPv4 mapped address on top of
1846fc49112Sitojun.Dv AF_INET6
1856fc49112Sitojunsocket, since IPv4 mapped address complicates host-address based
1866fc49112Sitojunauthentication.
1876fc49112SitojunIf you would like to accept connections from IPv4 peers, you will need to run
1886fc49112Sitojun.Nm
1896fc49112Sitojunon top of
1906fc49112Sitojun.Dv AF_INET
1916fc49112Sitojunsocket, not
1926fc49112Sitojun.Dv AF_INET6
1936fc49112Sitojunsocket.
194