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