Commit | Line | Data |
---|---|---|
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 | 23 | executes |
5325ced3 | 24 | .Ar command |
3a442ca8 | 25 | on |
5325ced3 CL |
26 | .Ar host . |
27 | .Pp | |
28 | .Nm Rsh | |
1fa17096 KM |
29 | copies its standard input to the remote command, the standard |
30 | output of the remote command to its standard output, and the | |
31 | standard error of the remote command to its standard error. | |
32 | Interrupt, quit and terminate signals are propagated to the remote | |
3a442ca8 | 33 | command; |
5325ced3 | 34 | .Nm rsh |
3a442ca8 KB |
35 | normally terminates when the remote command does. |
36 | The options are as follows: | |
4b9a6ffa CL |
37 | .Bl -tag -width flag |
38 | .It Fl K | |
5325ced3 CL |
39 | The |
40 | .Fl K | |
41 | option turns off all Kerberos authentication. | |
4b9a6ffa | 42 | .It Fl d |
5325ced3 CL |
43 | The |
44 | .Fl d | |
45 | option turns on socket debugging (using | |
46 | .Xr setsockopt 2 ) | |
4b9a6ffa CL |
47 | on the |
48 | .Tn TCP | |
49 | sockets used for communication with the remote host. | |
50 | .It Fl k | |
5325ced3 CL |
51 | The |
52 | .Fl k | |
53 | option causes | |
54 | .Nm rsh | |
33fe1ab4 | 55 | to obtain tickets for the remote host in |
5325ced3 | 56 | .Ar realm |
33fe1ab4 | 57 | instead of the remote host's realm as determined by |
5325ced3 | 58 | .Xr krb_realmofhost 3 . |
4b9a6ffa | 59 | .It Fl l |
3a442ca8 | 60 | By default, the remote username is the same as the local username. |
5325ced3 CL |
61 | The |
62 | .Fl l | |
63 | option allows the remote name to be specified. | |
3a442ca8 KB |
64 | Kerberos authentication is used, and authorization is determined |
65 | as in | |
5325ced3 | 66 | .Xr rlogin 1 . |
4b9a6ffa | 67 | .It Fl n |
5325ced3 CL |
68 | The |
69 | .Fl n | |
70 | option redirects input from the special device | |
71 | .Pa /dev/null | |
4b9a6ffa | 72 | .El |
5325ced3 | 73 | .Pp |
3a442ca8 | 74 | If no |
5325ced3 | 75 | .Ar command |
3a442ca8 | 76 | is specified, you will be logged in on the remote host using |
5325ced3 CL |
77 | .Xr rlogin 1 . |
78 | .Pp | |
3a442ca8 KB |
79 | Shell metacharacters which are not quoted are interpreted on local machine, |
80 | while quoted metacharacters are interpreted on the remote machine. | |
81 | For example, the command | |
5325ced3 CL |
82 | .Pp |
83 | .Dl rsh otherhost cat remotefile >> localfile | |
84 | .Pp | |
1fa17096 | 85 | appends the remote file |
5325ced3 | 86 | .Ar remotefile |
33fe1ab4 | 87 | to the local file |
5325ced3 | 88 | .Ar localfile , |
1fa17096 | 89 | while |
5325ced3 CL |
90 | .Pp |
91 | .Dl rsh otherhost cat remotefile \&">>\&" other_remotefile | |
92 | .Pp | |
1fa17096 | 93 | appends |
5325ced3 | 94 | .Ar remotefile |
1fa17096 | 95 | to |
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 |
112 | The |
113 | .Nm rsh | |
114 | command appeared in | |
115 | .Bx 4.2 . | |
5325ced3 | 116 | .Sh BUGS |
1fa17096 | 117 | If you are using |
5325ced3 | 118 | .Xr csh 1 |
1fa17096 | 119 | and put a |
5325ced3 | 120 | .Nm rsh |
3a442ca8 KB |
121 | in the background without redirecting its input away from the terminal, |
122 | it will block even if no reads are posted by the remote command. | |
123 | If no input is desired you should redirect the input of | |
5325ced3 CL |
124 | .Nm rsh |
125 | to | |
126 | .Pa /dev/null | |
127 | using the | |
128 | .Fl n | |
129 | option. | |
130 | .Pp | |
1fa17096 KM |
131 | You cannot run an interactive command |
132 | (like | |
5325ced3 | 133 | .Xr rogue 6 |
1fa17096 | 134 | or |
5325ced3 | 135 | .Xr vi 1 ) |
3a442ca8 | 136 | using |
5325ced3 | 137 | .Nm rsh ; |
1fa17096 | 138 | use |
5325ced3 | 139 | .Xr rlogin 1 |
3a442ca8 | 140 | instead. |
5325ced3 | 141 | .Pp |
3a442ca8 | 142 | Stop signals stop the local |
5325ced3 | 143 | .Nm rsh |
3a442ca8 KB |
144 | process only; this is arguably wrong, but currently hard to fix for reasons |
145 | too complicated to explain here. |