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