1.\" $NetBSD: rcmd.1,v 1.13 2002/09/25 15:18:42 wiz 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 February 15, 1997 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 kerberos 8 148.Sh HISTORY 149The 150.Nm 151command appeared in 152.Nx 1.3 153and is primarily derived from 154.Xr rsh 1 . 155Its purpose was to create a backend driver for 156.Xr rcmd 3 157that would allow the users of 158.Xr rcmd 3 159to no longer require super-user privileges. 160.Sh BUGS 161If you are using 162.Xr csh 1 163and put a 164.Nm 165in the background without redirecting its input away from the terminal, 166it will block even if no reads are posted by the remote command. 167If no input is desired you should redirect the input of 168.Nm 169to 170.Pa /dev/null 171using the 172.Fl n 173option. 174.Pp 175You cannot use 176.Nm rcmd 177to run an interactive command (like 178.Xr rogue 6 179or 180.Xr vi 1 ) . 181Use 182.Xr rlogin 1 183instead. 184.Pp 185The stop signal, 186.Dv SIGSTOP , 187will stop the local 188.Nm 189process only. 190This is arguably wrong, but currently hard to fix for reasons 191too complicated to explain here. 192