1.\" Copyright (c) 1983, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)rsh.1 6.8.1.1 (Berkeley) 10/21/90 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.Ar 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.Tp Fl K 38The 39.Fl K 40option turns off all Kerberos authentication. 41.Tp Fl d 42The 43.Fl d 44option turns on socket debugging (using 45.Xr setsockopt 2 ) 46on the TCP sockets used for communication with the remote host. 47.Tp Fl k 48The 49.Fl k 50option causes 51.Nm rsh 52to obtain tickets for the remote host in 53.Ar realm 54instead of the remote host's realm as determined by 55.Xr krb_realmofhost 3 . 56.Tp Fl l 57By default, the remote username is the same as the local username. 58The 59.Fl l 60option allows the remote name to be specified. 61Kerberos authentication is used, and authorization is determined 62as in 63.Xr rlogin 1 . 64.Tp Fl n 65The 66.Fl n 67option redirects input from the special device 68.Pa /dev/null 69(see the BUGS section of this manual page). 70.Tp 71.Pp 72If no 73.Ar command 74is specified, you will be logged in on the remote host using 75.Xr rlogin 1 . 76.Pp 77Shell metacharacters which are not quoted are interpreted on local machine, 78while quoted metacharacters are interpreted on the remote machine. 79For example, the command 80.Pp 81.Dl rsh otherhost cat remotefile >> localfile 82.Pp 83appends the remote file 84.Ar remotefile 85to the local file 86.Ar localfile , 87while 88.Pp 89.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile 90.Pp 91appends 92.Ar remotefile 93to 94.Ar other_remotefile . 95.\" .Pp 96.\" Many sites specify a large number of host names as commands in the 97.\" directory /usr/hosts. 98.\" If this directory is included in your search path, you can use the 99.\" shorthand ``host command'' for the longer form ``rsh host command''. 100.Sh FILES 101.Dw /etc/hosts 102.Di L 103.Dp Pa /etc/hosts 104.Dp 105.Sh SEE ALSO 106.Xr rlogin 1 , 107.Xr kerberos 3 , 108.Xr krb_sendauth 3 , 109.Xr krb_realmofhost 3 110.Sh HISTORY 111.Nm Rsh 112appeared in 4.2 BSD 113.Sh BUGS 114If you are using 115.Xr csh 1 116and put a 117.Nm rsh 118in the background without redirecting its input away from the terminal, 119it will block even if no reads are posted by the remote command. 120If no input is desired you should redirect the input of 121.Nm rsh 122to 123.Pa /dev/null 124using the 125.Fl n 126option. 127.Pp 128You cannot run an interactive command 129(like 130.Xr rogue 6 131or 132.Xr vi 1 ) 133using 134.Nm rsh ; 135use 136.Xr rlogin 1 137instead. 138.Pp 139Stop signals stop the local 140.Nm rsh 141process only; this is arguably wrong, but currently hard to fix for reasons 142too complicated to explain here. 143