xref: /original-bsd/usr.bin/rsh/rsh.1 (revision c3e32dec)
1.\" Copyright (c) 1983, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)rsh.1	8.1 (Berkeley) 06/06/93
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 Kdnx
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.It Fl x
76The
77.Fl x
78option turns on
79.Tn DES
80encryption for all data exchange.
81This may introduce a significant delay in response time.
82.El
83.Pp
84If no
85.Ar command
86is specified, you will be logged in on the remote host using
87.Xr rlogin  1  .
88.Pp
89Shell metacharacters which are not quoted are interpreted on local machine,
90while quoted metacharacters are interpreted on the remote machine.
91For example, the command
92.Pp
93.Dl rsh otherhost cat remotefile >> localfile
94.Pp
95appends the remote file
96.Ar remotefile
97to the local file
98.Ar localfile ,
99while
100.Pp
101.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile
102.Pp
103appends
104.Ar remotefile
105to
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.Bl -tag -width /etc/hosts -compact
114.It Pa /etc/hosts
115.El
116.Sh SEE ALSO
117.Xr rlogin 1 ,
118.Xr kerberos 3 ,
119.Xr krb_sendauth 3 ,
120.Xr krb_realmofhost 3
121.Sh HISTORY
122The
123.Nm rsh
124command appeared in
125.Bx 4.2 .
126.Sh BUGS
127If you are using
128.Xr csh  1
129and put a
130.Nm rsh
131in the background without redirecting its input away from the terminal,
132it will block even if no reads are posted by the remote command.
133If no input is desired you should redirect the input of
134.Nm rsh
135to
136.Pa /dev/null
137using the
138.Fl n
139option.
140.Pp
141You cannot run an interactive command
142(like
143.Xr rogue  6
144or
145.Xr vi  1  )
146using
147.Nm rsh  ;
148use
149.Xr rlogin  1
150instead.
151.Pp
152Stop signals stop the local
153.Nm rsh
154process only; this is arguably wrong, but currently hard to fix for reasons
155too complicated to explain here.
156