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