xref: /netbsd/usr.bin/rsh/rsh.1 (revision bf9ec67e)
1.\"	$NetBSD: rsh.1,v 1.11 2002/02/08 01:36:32 ross Exp $
2.\"
3.\" Copyright (c) 1983, 1990, 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. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)rsh.1	8.2 (Berkeley) 4/29/95
35.\"
36.Dd April 29, 1995
37.Dt RSH 1
38.Os
39.Sh NAME
40.Nm rsh
41.Nd remote shell
42.Sh SYNOPSIS
43.Nm
44.Op Fl Kdnx
45.Op Fl k Ar realm
46.Op Fl l Ar username
47.Ar host
48.Op command
49.Nm ""
50.Op Fl Kdnx
51.Op Fl k Ar realm
52.Ar username@host
53.Op command
54.Sh DESCRIPTION
55.Nm
56executes
57.Ar command
58on
59.Ar host  .
60.Pp
61.Nm
62copies its standard input to the remote command, the standard
63output of the remote command to its standard output, and the
64standard error of the remote command to its standard error.
65Interrupt, quit and terminate signals are propagated to the remote
66command;
67.Nm
68normally terminates when the remote command does.
69The options are as follows:
70.Bl -tag -width flag
71.It Fl K
72The
73.Fl K
74option turns off all Kerberos authentication.
75.It Fl d
76The
77.Fl d
78option turns on socket debugging (using
79.Xr setsockopt  2  )
80on the
81.Tn TCP
82sockets used for communication with the remote host.
83.It Fl k
84The
85.Fl k
86option causes
87.Nm
88to obtain tickets for the remote host in
89.Ar realm
90instead of the remote host's realm as determined by
91.Xr krb_realmofhost  3  .
92.It Fl l
93By default, the remote username is the same as the local username.
94The
95.Fl l
96option or the
97.Pa username@host
98format allow the remote name to be specified.
99Kerberos authentication is used, and authorization is determined
100as in
101.Xr rlogin  1  .
102.It Fl n
103The
104.Fl n
105option redirects input from the special device
106.Pa /dev/null
107(see the
108.Sx BUGS
109section of this manual page).
110.It Fl x
111The
112.Fl x
113option turns on
114.Tn DES
115encryption for all data exchange.
116This may introduce a significant delay in response time.
117.El
118.Pp
119If no
120.Ar command
121is specified, you will be logged in on the remote host using
122.Xr rlogin  1  .
123.Pp
124Shell metacharacters which are not quoted are interpreted on local machine,
125while quoted metacharacters are interpreted on the remote machine.
126For example, the command
127.Pp
128.Dl rsh otherhost cat remotefile \*[Gt]\*[Gt] localfile
129.Pp
130appends the remote file
131.Ar remotefile
132to the local file
133.Ar localfile ,
134while
135.Pp
136.Dl rsh otherhost cat remotefile \&"\*[Gt]\*[Gt]\&" other_remotefile
137.Pp
138appends
139.Ar remotefile
140to
141.Ar other_remotefile .
142.\" .Pp
143.\" Many sites specify a large number of host names as commands in the
144.\" directory /usr/hosts.
145.\" If this directory is included in your search path, you can use the
146.\" shorthand ``host command'' for the longer form ``rsh host command''.
147.Sh FILES
148.Bl -tag -width /etc/hosts -compact
149.It Pa /etc/hosts
150.El
151.Sh SEE ALSO
152.Xr rlogin 1 ,
153.Xr krb_realmofhost 3 ,
154.Xr krb_sendauth 3 ,
155.Xr hosts.equiv 5 ,
156.Xr rhosts 5 ,
157.Xr kerberos 8
158.Sh HISTORY
159The
160.Nm
161command appeared in
162.Bx 4.2 .
163.Sh BUGS
164If you are using
165.Xr csh  1
166and put a
167.Nm
168in the background without redirecting its input away from the terminal,
169it will block even if no reads are posted by the remote command.
170If no input is desired you should redirect the input of
171.Nm
172to
173.Pa /dev/null
174using the
175.Fl n
176option.
177.Pp
178You cannot run an interactive command
179(like
180.Xr rogue  6
181or
182.Xr vi  1  )
183using
184.Nm ""  ;
185use
186.Xr rlogin  1
187instead.
188.Pp
189Stop signals stop the local
190.Nm
191process only; this is arguably wrong, but currently hard to fix for reasons
192too complicated to explain here.
193