]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.bin/rsh/rsh.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)rsh.1       8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD$
30 .\"
31 .Dd October 16, 2002
32 .Dt RSH 1
33 .Os
34 .Sh NAME
35 .Nm rsh
36 .Nd remote shell
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl 46dn
40 .Op Fl l Ar username
41 .Op Fl t Ar timeout
42 .Ar host
43 .Op command
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility executes
48 .Ar command
49 on
50 .Ar host .
51 .Pp
52 The
53 .Nm
54 utility copies its standard input to the remote command, the standard
55 output of the remote command to its standard output, and the
56 standard error of the remote command to its standard error.
57 Interrupt, quit and terminate signals are propagated to the remote
58 command;
59 .Nm
60 normally terminates when the remote command does.
61 The options are as follows:
62 .Bl -tag -width flag
63 .It Fl 4
64 Use IPv4 addresses only.
65 .It Fl 6
66 Use IPv6 addresses only.
67 .It Fl d
68 Turn on socket debugging (using
69 .Xr setsockopt 2 )
70 on the
71 .Tn TCP
72 sockets used for communication with the remote host.
73 .It Fl l Ar username
74 Allow the remote
75 .Ar username
76 to be specified.
77 By default, the remote username is the same as the local username.
78 Authorization is determined
79 as in
80 .Xr rlogin 1 .
81 .It Fl n
82 Redirect input from the special device
83 .Pa /dev/null
84 (see the
85 .Sx BUGS
86 section of this manual page).
87 .It Fl t Ar timeout
88 Allow a
89 .Ar timeout
90 to be specified (in seconds).
91 If no
92 data is sent or received in this time,
93 .Nm
94 will exit.
95 .El
96 .Pp
97 If no
98 .Ar command
99 is specified, you will be logged in on the remote host using
100 .Xr rlogin 1 .
101 .Pp
102 Shell metacharacters which are not quoted are interpreted on local machine,
103 while quoted metacharacters are interpreted on the remote machine.
104 For example, the command
105 .Pp
106 .Dl rsh otherhost cat remotefile >> localfile
107 .Pp
108 appends the remote file
109 .Ar remotefile
110 to the local file
111 .Ar localfile ,
112 while
113 .Pp
114 .Dl rsh otherhost cat remotefile \&">>\&" other_remotefile
115 .Pp
116 appends
117 .Ar remotefile
118 to
119 .Ar other_remotefile .
120 .\" .Pp
121 .\" Many sites specify a large number of host names as commands in the
122 .\" directory /usr/hosts.
123 .\" If this directory is included in your search path, you can use the
124 .\" shorthand ``host command'' for the longer form ``rsh host command''.
125 .Sh FILES
126 .Bl -tag -width /etc/hosts -compact
127 .It Pa /etc/hosts
128 .El
129 .Sh SEE ALSO
130 .Xr rlogin 1 ,
131 .Xr setsockopt 2 ,
132 .Xr rcmd 3 ,
133 .Xr ruserok 3 ,
134 .Xr hosts 5 ,
135 .Xr hosts.equiv 5 ,
136 .Xr rlogind 8 ,
137 .Xr rshd 8
138 .Sh HISTORY
139 The
140 .Nm
141 command appeared in
142 .Bx 4.2 .
143 .Sh BUGS
144 If you are using
145 .Xr csh 1
146 and put a
147 .Nm
148 in the background without redirecting its input away from the terminal,
149 it will block even if no reads are posted by the remote command.
150 If no input is desired you should redirect the input of
151 .Nm
152 to
153 .Pa /dev/null
154 using the
155 .Fl n
156 option.
157 .Pp
158 You cannot run an interactive command
159 (like
160 .Xr ee 1
161 or
162 .Xr vi 1 )
163 using
164 .Nm ;
165 use
166 .Xr rlogin 1
167 instead.
168 .Pp
169 Stop signals stop the local
170 .Nm
171 process only; this is arguably wrong, but currently hard to fix for reasons
172 too complicated to explain here.