xref: /original-bsd/usr.bin/rsh/rsh.1 (revision 6ab384a1)
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 (Berkeley) 07/24/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 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.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 Fl x
71The
72.Fl x
73option turns on DES encryption for all data exchange.
74This may introduce a significant delay in response time.
75.Tp
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.Dw /etc/hosts
107.Di L
108.Dp Pa /etc/hosts
109.Dp
110.Sh SEE ALSO
111.Xr rlogin 1 ,
112.Xr kerberos 3 ,
113.Xr krb_sendauth 3 ,
114.Xr krb_realmofhost 3
115.Sh HISTORY
116.Nm Rsh
117appeared in 4.2 BSD
118.Sh BUGS
119If you are using
120.Xr csh  1
121and put a
122.Nm rsh
123in the background without redirecting its input away from the terminal,
124it will block even if no reads are posted by the remote command.
125If no input is desired you should redirect the input of
126.Nm rsh
127to
128.Pa /dev/null
129using the
130.Fl n
131option.
132.Pp
133You cannot run an interactive command
134(like
135.Xr rogue  6
136or
137.Xr vi  1  )
138using
139.Nm rsh  ;
140use
141.Xr rlogin  1
142instead.
143.Pp
144Stop signals stop the local
145.Nm rsh
146process only; this is arguably wrong, but currently hard to fix for reasons
147too complicated to explain here.
148