Re: rsh between two machines both booted with tomsrtbt-2-0-103

Tom Oehser <[email protected]>
Newsgroups gmane.linux.tomsrtbt
Message-ID <[email protected]>
OK, here is what I did with 2 tomsrtbt machines to get rsh/rshd to work:


1) booted them both, they have IP addresses:

 192.168.123.129
 192.168.123.130

2) setup /etc/hosts on both machines like:

 127.0.0.1 localhost
 192.168.123.129 tomsrtbt1
 192.168.123.130 tomsrtbt2

3) On tomsrtbt1, ran:

 hostname tomsrtbt1

4) On tomsrtbt2, ran:

 hostname tomsrtbt2

5) on tomsrtbt2, uncommented the line in /etc/inittab to read:

 rsh1::respawn:/usr/bin/nc -l -p 514 -e /usr/bin/rshd

6) on tomsrtbt 2, ran:

 kill -HUP 1

7) on tomsrtbt2, created a file, "/.rhosts", to read:

 tomsrtbt1

8) on tomsrtbt2, created a file:

 echo x > /tmp/y

9) on tomsrtbt1, did:

 rsh tomsrtbt2 ls /tmp

10) I got the expected result:

y


_SO_, As far as I can tell, everything... just... works.  Note:

* I made sure there were resolvable names
* The /.rhosts has the resolvable name of the allowed client
* The hostnames are set correctly

-Tom









On Tue, 31 Dec 2002, Randal Dickinson wrote:

> Date: Tue, 31 Dec 2002 15:03:28 -0800
> From: Randal Dickinson <[email protected]>
> To: Tom Oehser <[email protected]>
> Subject: Re: rsh between two machines both booted with tomsrtbt-2-0-103
>
> Tom,
>
> First thank you for the reply. I tried rsh and am still trying rsh;
> but netcat worked great. THANK YOU THANK YOU. I had not replied sooner
> because I have been reading and trying to figure out rsh, etc.
> I just purchased "Linux the Advanced Reference" from Powells for $8;
> nice to live in Powell-land.
>
> Incidently what does the # at the end of nc do? Yeah, I know; but the
> $8 book had a lot of stuff on networks, etc... and I did buy a shell
> book.
>
> On rsh:
>
> I can ping both machines from each other successfully.
>
> Both machines resolv.conf looks like; the name server is
> www.hevanet.com my ip provider. dickinson is the name on the little
> smc home router/switch.
>
> domain dickinson
> nameserver 198.5.254.1
>
> route shows on both machines:
> 192.168.123.0     *   255.255.255.0  U  ..eth0
> default  192.168.123.254   0.0.0.0   UG  ..eth0
> default         *                       0.0.0.0  U
>
> ifconfig shows the correct mac address and the ip address from the
> local router with the correct mask on each machine.
>
> I did the following on .171; the one I'm trying to rsh to:
>
> echo "tomsrtbt root"   >>  /.rhosts  also tried:
> "+ +"    ;    "tomsrtbt" ;   "+"   ;
>
> on .184 the one I'm using rsh on:
>
> echo "tomsrtbt 192.168.123.171" >> /etc/hosts
>
> hostname x
>
> I can ping  tomsrtbt  (and ping 192.168.123.171) OK
> hostname spits out x and tomsrtbt successfully on each
>
> The permissions on the .rhosts are  -rw-r--r--  same as /etc/hosts ...
>
> rsh 192.168.123.171  ls '*'  > t
> 192.168.123.171: connection refused
>  rsh tomsrtbt ls '*' > t
> tomsrtbt: connection refused.
>
> When I did a route on tomsrtbt .171, the packet count had increased
> each time I tried rsh.
>
> Has to be something to do with .rhosts  ???
>
> Tom, If you want to hit delete, that's fine, You have solved my
> problem, but I guess that I'm hooked on making rsh work, and learning
> more, but am stuck on, I think on .rhosts.  Have a great New Year,
> what a wonderful tool you have provided, and for free...
>
> Take care,
>
> Randy Dickinson
>
> On Sun, 29 Dec 2002 10:50:03 -0500 (EST), you wrote:
>
> >
> >First, you have to make a .rhosts file to give it permissions.
> >
> >> rsh 192.168.123.184  ls *  > t        just connect and do something...
> >
> >Second, you have to quote things for the shell, this might be:
> >
> > rsh 192.168.123.183 ls '*' > t
> >or
> > rsh 192.168.123.183 ls '*' '>' t
> >
> >depending on your intent.
> >
> >> "192.168.123.184 connection refused"
> >
> >Can you ping it?  Check the output of "route" and "ifconfig".
> >
> >> rsh tomsrtbt  ls *  > t
> >> "tomsrtbt: unknown host"
> >
> >What is in the hostname and resolv.conf of both machines?
> >
> >> echo "192.168.123.184  tomsrtbt"  >> /etc/hosts
> >> rsh tomsrtbt ls *  > t
> >> "tomsrtbt connection refused"
> >
> >Probably because you didn't create the .rhosts to give permission...
> >
> >> I tried rshd -h on both machines, no change
> >
> >> I had hoped to be able to move some ntfs files from a machine that
> >> would not boot into windows using tomsrtbt. I am able to mount the
> >> drive and ls the files locally.
> >
> >There are easier ways than using rsh.  Often, I'll use 'nc' (netcat),
> >something like:
> >
> > find files paths etc | cpio -o | nc hostname portnumber # on one box
> >
> > nc -l -p portnumber | cpio -iuvmd # on the other
> >
> >Netcat of course requires typing on both machines, but, you usually
> >have to do that with rsh anyway, and there is a netcat for windows,
> >and doesn't have the issues with .rhosts and other permissions stuff.
> >
> >-Tom
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.