[comp.protocols.tcp-ip] rsh vs remsh -- how does one handle the name conflict?

drich@.UUCP (Dan Rich) (02/02/90)

  I decided I was tired of having to know which machine I was on, and
wrote the script below.  By listing the various remote shell programs
in the variable RSHELL, you can let this script figure out which one
to run.  Then, you can name the script anything you find convient and
place it somewhere in your path (I use /usr/public/bin/rsh, that way
it is available on all of our machines).

  One other thing.  As I mentioned earlier, under System V (or at
least with ISC's tcp/ip), you can't just rename the remote shell
program.  Rsh is written so that it can be linked to programs bearing
the names of machines on your network.  It will then attempt to run a
remote shell on that machine.  (ie. If I link rsh to dialogic, typing
'dialogic' will run a remote shell on the machine dialogic.)

8<------------------------------ Cut Here ------------------------------>8
#! /bin/sh
# $Id: rsh,v 1.1 90/02/01 10:41:01 drich Exp $
#
# rsh - remote shell that will work on any(?) machine
#
# $Log:	rsh,v $
# Revision 1.1  90/02/01  10:41:01  drich
# Initial revision
# 
#
RSHELLS="/usr/ucb/rsh /usr/bin/rshl"

for i in $RSHELLS
do
	if [ -f $i ]
	then
		RSH=$i
	fi
done

$RSH $*
8<------------------------------ Cut Here ------------------------------>8

--
Dan Rich                    | ARPA: drich%dialogic@uunet.uu.net 
UNIX Systems Administrator  | UUCP: uunet!dialogic!drich
Dialogic Corporation        | - Time is an illusion.  Lunchtime, doubly so. -
(201) 334-1268 x213         |                           Douglas Adams

ggw@wolves.uucp (Gregory G. Woodbury) (02/03/90)

DOUG@YSUB.BITNET ("Doug Sewell"):
- On our Encore (4.2-based) system, there is no '/bin/rsh'.  If I enter
- 'rsh' on the Encore, it wants to know what host to use.
- 
- So, I'd conclude rsh (remote shell) is a Berkeleyism, and rsh (restricted
- shell) is a ATTism.

	At work, on the Opus 88k's and Clippers, /bin/rsh is the restricted
shell and /usr/bin/rsh is the remote shell (sometimes in /usr/ucb/rsh). They
recommend renaming it to rmtsh if you want to and note that in a homeogenous
environment it should not create a problem.

	Personally, I define a (bourne) shell function "rsh" that references
the /usr/bin/rsh program and passes all the arguments to that.  Also, in the
small network we have, I define shell functions that are the names of the other
machines in the dept that invoke rsh with at fixed first argument and passing
the rest of the args to the machine bing sought.

The functions look like:
	rsh(){
		/usr/bin/rsh $@
	}

	aliceb(){
		if [ $# -eq 0 ]
		then
			rlogin aliceb
		else
			rsh aliceb TZ=EST5EDT $@
		fi
	}
-- 
Gregory G. Woodbury
Sysop/owner Wolves Den UNIX BBS, Durham NC
UUCP: ...dukcds!wolves!ggw   ...dukeac!wolves!ggw           [use the maps!]
Domain: ggw@cds.duke.edu  ggw@ac.duke.edu  ggw%wolves@ac.duke.edu
Phone: +1 919 493 1998 (Home)  +1 919 684 6126 (Work)
[The line eater is a boojum snark! ]           <standard disclaimers apply>

lyndon@cs.AthabascaU.CA (Lyndon Nerenberg) (02/06/90)

I have been wondering how to handle the conflict between the USG
and BSD rsh commands. I consider the BSD rsh to be the "real thing"
since it seems to be used more in that context. The only time I've
seen rsh used as a restricted shell is inside the sysadm command
under SVR3. Since I consider sysadm as being hopelessly broken, I
classify the USG behaviour as depricated :-)

Since SVR4 is merging in the BSD networking utilities (to some extent,
anyway), I would think that AT&T has already had to deal with this
behaviour. Could someone familiar with SVR4 comment on this?


-- 
Lyndon Nerenberg  VE6BBM / Computing Services / Athabasca University
     {alberta,decwrl}!atha!lyndon || lyndon@cs.AthabascaU.CA

                     UREP: Peru in disguise?

guy@auspex.auspex.com (Guy Harris) (02/08/90)

>Since SVR4 is merging in the BSD networking utilities (to some extent,
>anyway), I would think that AT&T has already had to deal with this
>behaviour. Could someone familiar with SVR4 comment on this?

In S5R4 "/usr/bin/rsh" or maybe "/usr/ucb/rsh" is the Remote SHell;
"/usr/lib/rsh" or something off in the corner like that is the
Restricted Shell.