BSD 4_3_Reno release
[unix-history] / usr / src / foreign / src / rsh / rsh.1
CommitLineData
3a442ca8 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
a9c6ea3c 2.\" All rights reserved.
1fa17096 3.\"
1c15e888
C
4.\" Redistribution and use in source and binary forms are permitted provided
5.\" that: (1) source distributions retain this entire copyright notice and
6.\" comment, and (2) distributions including binaries display the following
7.\" acknowledgement: ``This product includes software developed by the
8.\" University of California, Berkeley and its contributors'' in the
9.\" documentation or other materials provided with the distribution and in
10.\" all advertising materials mentioning features or use of this software.
11.\" Neither the name of the University nor the names of its contributors may
12.\" be used to endorse or promote products derived from this software without
13.\" specific prior written permission.
14.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1fa17096 17.\"
1c15e888 18.\" @(#)rsh.1 6.8.1.1 (Berkeley) 10/21/90
a9c6ea3c 19.\"
1c15e888 20.Dd October 21, 1990
5325ced3
CL
21.Dt RSH 1
22.Os BSD 4.2
23.Sh NAME
24.Nm rsh
25.Nd remote shell
26.Sh SYNOPSIS
27.Ar rsh
b29344f1 28.Op Fl Kdn
5325ced3
CL
29.Op Fl k Ar realm
30.Op Fl l Ar username
31.Ar host
32.Op command
33.Sh DESCRIPTION
34.Nm Rsh
3a442ca8 35executes
5325ced3 36.Ar command
3a442ca8 37on
5325ced3
CL
38.Ar host .
39.Pp
40.Nm Rsh
1fa17096
KM
41copies its standard input to the remote command, the standard
42output of the remote command to its standard output, and the
43standard error of the remote command to its standard error.
44Interrupt, quit and terminate signals are propagated to the remote
3a442ca8 45command;
5325ced3 46.Nm rsh
3a442ca8
KB
47normally terminates when the remote command does.
48The options are as follows:
5325ced3
CL
49.Tp Fl K
50The
51.Fl K
52option turns off all Kerberos authentication.
53.Tp Fl d
54The
55.Fl d
56option turns on socket debugging (using
57.Xr setsockopt 2 )
3a442ca8 58on the TCP sockets used for communication with the remote host.
5325ced3
CL
59.Tp Fl k
60The
61.Fl k
62option causes
63.Nm rsh
33fe1ab4 64to obtain tickets for the remote host in
5325ced3 65.Ar realm
33fe1ab4 66instead of the remote host's realm as determined by
5325ced3
CL
67.Xr krb_realmofhost 3 .
68.Tp Fl l
3a442ca8 69By default, the remote username is the same as the local username.
5325ced3
CL
70The
71.Fl l
72option allows the remote name to be specified.
3a442ca8
KB
73Kerberos authentication is used, and authorization is determined
74as in
5325ced3
CL
75.Xr rlogin 1 .
76.Tp Fl n
77The
78.Fl n
79option redirects input from the special device
80.Pa /dev/null
3a442ca8 81(see the BUGS section of this manual page).
5325ced3
CL
82.Tp
83.Pp
3a442ca8 84If no
5325ced3 85.Ar command
3a442ca8 86is specified, you will be logged in on the remote host using
5325ced3
CL
87.Xr rlogin 1 .
88.Pp
3a442ca8
KB
89Shell metacharacters which are not quoted are interpreted on local machine,
90while quoted metacharacters are interpreted on the remote machine.
91For example, the command
5325ced3
CL
92.Pp
93.Dl rsh otherhost cat remotefile >> localfile
94.Pp
1fa17096 95appends the remote file
5325ced3 96.Ar remotefile
33fe1ab4 97to the local file
5325ced3 98.Ar localfile ,
1fa17096 99while
5325ced3
CL
100.Pp
101.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile
102.Pp
1fa17096 103appends
5325ced3 104.Ar remotefile
1fa17096 105to
5325ced3
CL
106.Ar other_remotefile .
107.\" .Pp
108.\" Many sites specify a large number of host names as commands in the
109.\" directory /usr/hosts.
110.\" If this directory is included in your search path, you can use the
111.\" shorthand ``host command'' for the longer form ``rsh host command''.
112.Sh FILES
113.Dw /etc/hosts
114.Di L
115.Dp Pa /etc/hosts
116.Dp
117.Sh SEE ALSO
118.Xr rlogin 1 ,
119.Xr kerberos 3 ,
120.Xr krb_sendauth 3 ,
121.Xr krb_realmofhost 3
122.Sh HISTORY
123.Nm Rsh
124appeared in 4.2 BSD
125.Sh BUGS
1fa17096 126If you are using
5325ced3 127.Xr csh 1
1fa17096 128and put a
5325ced3 129.Nm rsh
3a442ca8
KB
130in the background without redirecting its input away from the terminal,
131it will block even if no reads are posted by the remote command.
132If no input is desired you should redirect the input of
5325ced3
CL
133.Nm rsh
134to
135.Pa /dev/null
136using the
137.Fl n
138option.
139.Pp
1fa17096
KM
140You cannot run an interactive command
141(like
5325ced3 142.Xr rogue 6
1fa17096 143or
5325ced3 144.Xr vi 1 )
3a442ca8 145using
5325ced3 146.Nm rsh ;
1fa17096 147use
5325ced3 148.Xr rlogin 1
3a442ca8 149instead.
5325ced3 150.Pp
3a442ca8 151Stop signals stop the local
5325ced3 152.Nm rsh
3a442ca8
KB
153process only; this is arguably wrong, but currently hard to fix for reasons
154too complicated to explain here.