1.\" Copyright (c) 1983, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)rsh.1 6.10.1.1 (Berkeley) 08/20/91 7.\" 8.Dd 9.Dt RSH 1 10.Os BSD 4.2 11.Sh NAME 12.Nm rsh 13.Nd remote shell 14.Sh SYNOPSIS 15.Nm rsh 16.Op Fl Kdn 17.Op Fl k Ar realm 18.Op Fl l Ar username 19.Ar host 20.Op command 21.Sh DESCRIPTION 22.Nm Rsh 23executes 24.Ar command 25on 26.Ar host . 27.Pp 28.Nm Rsh 29copies its standard input to the remote command, the standard 30output of the remote command to its standard output, and the 31standard error of the remote command to its standard error. 32Interrupt, quit and terminate signals are propagated to the remote 33command; 34.Nm rsh 35normally terminates when the remote command does. 36The options are as follows: 37.Bl -tag -width flag 38.It Fl K 39The 40.Fl K 41option turns off all Kerberos authentication. 42.It Fl d 43The 44.Fl d 45option turns on socket debugging (using 46.Xr setsockopt 2 ) 47on the 48.Tn TCP 49sockets used for communication with the remote host. 50.It Fl k 51The 52.Fl k 53option causes 54.Nm rsh 55to obtain tickets for the remote host in 56.Ar realm 57instead of the remote host's realm as determined by 58.Xr krb_realmofhost 3 . 59.It Fl l 60By default, the remote username is the same as the local username. 61The 62.Fl l 63option allows the remote name to be specified. 64Kerberos authentication is used, and authorization is determined 65as in 66.Xr rlogin 1 . 67.It Fl n 68The 69.Fl n 70option redirects input from the special device 71.Pa /dev/null 72(see the 73.Sx BUGS 74section of this manual page). 75.El 76.Pp 77If no 78.Ar command 79is specified, you will be logged in on the remote host using 80.Xr rlogin 1 . 81.Pp 82Shell metacharacters which are not quoted are interpreted on local machine, 83while quoted metacharacters are interpreted on the remote machine. 84For example, the command 85.Pp 86.Dl rsh otherhost cat remotefile >> localfile 87.Pp 88appends the remote file 89.Ar remotefile 90to the local file 91.Ar localfile , 92while 93.Pp 94.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile 95.Pp 96appends 97.Ar remotefile 98to 99.Ar other_remotefile . 100.\" .Pp 101.\" Many sites specify a large number of host names as commands in the 102.\" directory /usr/hosts. 103.\" If this directory is included in your search path, you can use the 104.\" shorthand ``host command'' for the longer form ``rsh host command''. 105.Sh FILES 106.Bl -tag -width /etc/hosts -compact 107.It Pa /etc/hosts 108.El 109.Sh SEE ALSO 110.Xr rlogin 1 , 111.Xr kerberos 3 , 112.Xr krb_sendauth 3 , 113.Xr krb_realmofhost 3 114.Sh HISTORY 115The 116.Nm rsh 117command appeared in 118.Bx 4.2 . 119.Sh BUGS 120If you are using 121.Xr csh 1 122and put a 123.Nm rsh 124in the background without redirecting its input away from the terminal, 125it will block even if no reads are posted by the remote command. 126If no input is desired you should redirect the input of 127.Nm rsh 128to 129.Pa /dev/null 130using the 131.Fl n 132option. 133.Pp 134You cannot run an interactive command 135(like 136.Xr rogue 6 137or 138.Xr vi 1 ) 139using 140.Nm rsh ; 141use 142.Xr rlogin 1 143instead. 144.Pp 145Stop signals stop the local 146.Nm rsh 147process only; this is arguably wrong, but currently hard to fix for reasons 148too complicated to explain here. 149