xref: /netbsd-src/usr.bin/rsh/rsh.1 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1*01869ca4Swiz.\"	$NetBSD: rsh.1,v 1.21 2017/07/03 21:34:21 wiz Exp $
29d225a17Stls.\"
32d7faefcSmrg.\" Copyright (c) 1983, 1990, 1993
42d7faefcSmrg.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
30c1c7844bSmikel.\"	@(#)rsh.1	8.2 (Berkeley) 4/29/95
3161f28255Scgd.\"
3260599465Sginsbach.Dd March 9, 2005
3361f28255Scgd.Dt RSH 1
349e44e9b5Sgarbled.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm rsh
3761f28255Scgd.Nd remote shell
3861f28255Scgd.Sh SYNOPSIS
39e390551dSlukem.Nm
4060599465Sginsbach.Op Fl 46dn
4161f28255Scgd.Op Fl l Ar username
42fa337680Shubertf.Op Fl p Ar port
4361f28255Scgd.Ar host
4461f28255Scgd.Op command
45990562bfSwiz.Nm
4660599465Sginsbach.Op Fl 46dn
47fa337680Shubertf.Op Fl p Ar port
4840095a1cSmrg.Ar username@host
4940095a1cSmrg.Op command
5061f28255Scgd.Sh DESCRIPTION
51e390551dSlukem.Nm
5261f28255Scgdexecutes
5361f28255Scgd.Ar command
5461f28255Scgdon
5561f28255Scgd.Ar host .
5661f28255Scgd.Pp
57e390551dSlukem.Nm
5861f28255Scgdcopies its standard input to the remote command, the standard
5961f28255Scgdoutput of the remote command to its standard output, and the
6061f28255Scgdstandard error of the remote command to its standard error.
6161f28255ScgdInterrupt, quit and terminate signals are propagated to the remote
6261f28255Scgdcommand;
63e390551dSlukem.Nm
6461f28255Scgdnormally terminates when the remote command does.
6561f28255ScgdThe options are as follows:
66a405f5c8Swiz.Bl -tag -width XlXusernameX
6760599465Sginsbach.It Fl 4
6860599465SginsbachUse IPv4 addresses only.
6960599465Sginsbach.It Fl 6
7060599465SginsbachUse IPv6 addresses only.
7161f28255Scgd.It Fl d
7261f28255ScgdThe
7361f28255Scgd.Fl d
7461f28255Scgdoption turns on socket debugging (using
7561f28255Scgd.Xr setsockopt 2 )
7661f28255Scgdon the
7761f28255Scgd.Tn TCP
7861f28255Scgdsockets used for communication with the remote host.
79a405f5c8Swiz.It Fl l Ar username
8061f28255ScgdBy default, the remote username is the same as the local username.
8161f28255ScgdThe
8261f28255Scgd.Fl l
8340095a1cSmrgoption or the
84a405f5c8Swiz.Ar username@host
8540095a1cSmrgformat allow the remote name to be specified.
8661f28255Scgd.It Fl n
8761f28255ScgdThe
8861f28255Scgd.Fl n
8961f28255Scgdoption redirects input from the special device
9061f28255Scgd.Pa /dev/null
9161f28255Scgd(see the
9261f28255Scgd.Sx BUGS
9361f28255Scgdsection of this manual page).
94a405f5c8Swiz.It Fl p Ar port
95fa337680ShubertfUses the given
96fa337680Shubertf.Pa port
97a405f5c8Swizinstead of the one assigned to the service
98a405f5c8Swiz.Dq shell .
99fa337680ShubertfMay be given either as symbolic name or as number.
100fa337680ShubertfIf no command is given, note that
101a405f5c8Swiz.Xr rlogin 1
102fa337680Shubertfis started, which may need a different daemon
103a405f5c8Swiz.No ( Xr rlogind 8
104fa337680Shubertfinstead of
105a405f5c8Swiz.Xr rshd 8 )
106a405f5c8Swizrunning on the server; you want to pass the
107a405f5c8Swiz.Xr rshd 8
108fa337680Shubertfport number in that case.
10961f28255Scgd.El
11061f28255Scgd.Pp
11161f28255ScgdIf no
11261f28255Scgd.Ar command
11361f28255Scgdis specified, you will be logged in on the remote host using
11461f28255Scgd.Xr rlogin 1 .
11561f28255Scgd.Pp
11661f28255ScgdShell metacharacters which are not quoted are interpreted on local machine,
11761f28255Scgdwhile quoted metacharacters are interpreted on the remote machine.
11861f28255ScgdFor example, the command
11961f28255Scgd.Pp
120*01869ca4Swiz.Dl rsh otherhost cat remotefile >> localfile
12161f28255Scgd.Pp
12261f28255Scgdappends the remote file
12361f28255Scgd.Ar remotefile
12461f28255Scgdto the local file
12561f28255Scgd.Ar localfile ,
12661f28255Scgdwhile
12761f28255Scgd.Pp
128*01869ca4Swiz.Dl rsh otherhost cat remotefile \&">>\&" other_remotefile
12961f28255Scgd.Pp
13061f28255Scgdappends
13161f28255Scgd.Ar remotefile
13261f28255Scgdto
13361f28255Scgd.Ar other_remotefile .
13461f28255Scgd.\" .Pp
13561f28255Scgd.\" Many sites specify a large number of host names as commands in the
136a405f5c8Swiz.\" directory
137a405f5c8Swiz.\" .Pa /usr/hosts .
13861f28255Scgd.\" If this directory is included in your search path, you can use the
139a405f5c8Swiz.\" shorthand
140a405f5c8Swiz.\" .Dq host command
141a405f5c8Swiz.\" for the longer form
142a405f5c8Swiz.\" .Dq rsh host command .
14361f28255Scgd.Sh FILES
14461f28255Scgd.Bl -tag -width /etc/hosts -compact
14561f28255Scgd.It Pa /etc/hosts
14661f28255Scgd.El
14761f28255Scgd.Sh SEE ALSO
1489014bdbcSlukem.Xr rcmd 1 ,
14961f28255Scgd.Xr rlogin 1 ,
1509014bdbcSlukem.Xr rcmd 3 ,
151b6573fceStv.Xr hosts.equiv 5 ,
15281035f22Swiz.Xr rhosts 5 ,
15389fb08a9Swiz.Xr environ 7
15461f28255Scgd.Sh HISTORY
15561f28255ScgdThe
156e390551dSlukem.Nm
15761f28255Scgdcommand appeared in
15861f28255Scgd.Bx 4.2 .
15961f28255Scgd.Sh BUGS
16061f28255ScgdIf you are using
16161f28255Scgd.Xr csh 1
16261f28255Scgdand put a
163e390551dSlukem.Nm
16461f28255Scgdin the background without redirecting its input away from the terminal,
16561f28255Scgdit will block even if no reads are posted by the remote command.
16661f28255ScgdIf no input is desired you should redirect the input of
167e390551dSlukem.Nm
16861f28255Scgdto
16961f28255Scgd.Pa /dev/null
17061f28255Scgdusing the
17161f28255Scgd.Fl n
17261f28255Scgdoption.
17361f28255Scgd.Pp
174a405f5c8SwizYou cannot run an interactive command (like
17561f28255Scgd.Xr rogue 6
17661f28255Scgdor
17761f28255Scgd.Xr vi 1 )
17861f28255Scgdusing
179990562bfSwiz.Nm ;
18061f28255Scgduse
18161f28255Scgd.Xr rlogin 1
18261f28255Scgdinstead.
18361f28255Scgd.Pp
18461f28255ScgdStop signals stop the local
185e390551dSlukem.Nm
18661f28255Scgdprocess only; this is arguably wrong, but currently hard to fix for reasons
18761f28255Scgdtoo complicated to explain here.
188