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