xref: /original-bsd/usr.bin/rsh/rsh.1 (revision 6f815012)
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.9 (Berkeley) 03/14/91
7.\"
8.Vx
9.Vx
10.Dd
11.Dt RSH 1
12.Os BSD 4.2
13.Sh NAME
14.Nm rsh
15.Nd remote shell
16.Sh SYNOPSIS
17.Ar rsh
18.Op Fl Kdnx
19.Op Fl k Ar realm
20.Op Fl l Ar username
21.Ar host
22.Op command
23.Sh DESCRIPTION
24.Nm Rsh
25executes
26.Ar command
27on
28.Ar host  .
29.Pp
30.Nm Rsh
31copies its standard input to the remote command, the standard
32output of the remote command to its standard output, and the
33standard error of the remote command to its standard error.
34Interrupt, quit and terminate signals are propagated to the remote
35command;
36.Nm rsh
37normally terminates when the remote command does.
38The options are as follows:
39.Tp Fl K
40The
41.Fl K
42option turns off all Kerberos authentication.
43.Tp Fl d
44The
45.Fl d
46option turns on socket debugging (using
47.Xr setsockopt  2  )
48on the TCP sockets used for communication with the remote host.
49.Tp Fl k
50The
51.Fl k
52option causes
53.Nm rsh
54to obtain tickets for the remote host in
55.Ar realm
56instead of the remote host's realm as determined by
57.Xr krb_realmofhost  3  .
58.Tp Fl l
59By default, the remote username is the same as the local username.
60The
61.Fl l
62option allows the remote name to be specified.
63Kerberos authentication is used, and authorization is determined
64as in
65.Xr rlogin  1  .
66.Tp Fl n
67The
68.Fl n
69option redirects input from the special device
70.Pa /dev/null
71(see the BUGS section of this manual page).
72.Tp Fl x
73The
74.Fl x
75option turns on DES encryption for all data exchange.
76This may introduce a significant delay in response time.
77.Tp
78.Pp
79If no
80.Ar command
81is specified, you will be logged in on the remote host using
82.Xr rlogin  1  .
83.Pp
84Shell metacharacters which are not quoted are interpreted on local machine,
85while quoted metacharacters are interpreted on the remote machine.
86For example, the command
87.Pp
88.Dl rsh otherhost cat remotefile >> localfile
89.Pp
90appends the remote file
91.Ar remotefile
92to the local file
93.Ar localfile ,
94while
95.Pp
96.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile
97.Pp
98appends
99.Ar remotefile
100to
101.Ar other_remotefile .
102.\" .Pp
103.\" Many sites specify a large number of host names as commands in the
104.\" directory /usr/hosts.
105.\" If this directory is included in your search path, you can use the
106.\" shorthand ``host command'' for the longer form ``rsh host command''.
107.Sh FILES
108.Dw /etc/hosts
109.Di L
110.Dp Pa /etc/hosts
111.Dp
112.Sh SEE ALSO
113.Xr rlogin 1 ,
114.Xr kerberos 3 ,
115.Xr krb_sendauth 3 ,
116.Xr krb_realmofhost 3
117.Sh HISTORY
118.Nm Rsh
119appeared in 4.2 BSD
120.Sh BUGS
121If you are using
122.Xr csh  1
123and put a
124.Nm rsh
125in the background without redirecting its input away from the terminal,
126it will block even if no reads are posted by the remote command.
127If no input is desired you should redirect the input of
128.Nm rsh
129to
130.Pa /dev/null
131using the
132.Fl n
133option.
134.Pp
135You cannot run an interactive command
136(like
137.Xr rogue  6
138or
139.Xr vi  1  )
140using
141.Nm rsh  ;
142use
143.Xr rlogin  1
144instead.
145.Pp
146Stop signals stop the local
147.Nm rsh
148process only; this is arguably wrong, but currently hard to fix for reasons
149too complicated to explain here.
150