HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

remsh errors out with 'rcmd_af: primary connection shut down'

 
John R. Ulmer
Occasional Advisor

remsh errors out with 'rcmd_af: primary connection shut down'

Back into sys admin after years of being away... I may be making some brutally simple mistakes.

I have two HP UX 11 boxes. The first has a tape drive, the second doesn't. I need use the drive to backup the 2nd box.

I can write/read the tape on box1 from box2 like:
# find . –print | cpio –oBv | (ssh box1 dd of=/dev/rmt/0mnb)

and
# ssh box1 “dd if=/dev/rmt/omnb bs=8k” | cpio –icvBdum

I'd prefer to use fbackup and frecover to do the backups. However, when I try this on box2:
# frecover -rNv -f box1:/dev/rmt/0mnb

I get:
frecover(5405): unable to opend box1:/dev/rmt/0mnb
frecover(5406): Do you wish to ontinue? n
frecover(5407): abort selected.
#

I read elsewhere that fbackup/frecover are using remsh under the covers. And, I can't get remsh to work from box2 to box1.

Any ideas, links, criticism would be very welcome.

8 REPLIES
Rita C Workman
Honored Contributor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

A security risk, but do you have .rhosts file created so it can remsh?

Just a quick thought,
Rita
James R. Ferguson
Acclaimed Contributor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

Hi:

In order for 'remsh' to work you need an '/etc/hosts.equiv' or '.rhosts' file:

http://docs.hp.com/en/B3921-60631/hosts.equiv.4.html

Too, you need to allow the 'shell' service in '/etc/inetd.conf':

shell stream tcp nowait root /usr/lbin/remshd remshd

If this is commented-out, un-comment it and issue:

# inetd -c

Regards!

...JRF...

John R. Ulmer
Occasional Advisor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

Thanks for the quick responses.

I have returned the box to its original form.

But, I did create an /etc/hosts.equiv file and checked that /etc/inetd.conf had a line supporting the shell.

I'm suspicious now, that the problem has to do with the fact that I'm trying to do this as root (a little risky) and that one machine is partially setup to use NIS+ and the other is not. So, I'm going to recreate the /etc/hosts.equiv file disable NIS on the one box that is using it. Then create a 'backup' user on both boxes and try again.

Any idea how to remove NIS+ from an HP UX 11 box? I see NIS in SAM, but, it is not clear via SAM how to undo NIS. I would assume it needs to be done deliberately to try to maintain the existing users.

I'll start another thread on that front.

Thanks for the help.
Viktor Balogh
Honored Contributor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

> Any idea how to remove NIS+ from an HP UX 11 box?

# /sbin/init.d/nisplus.client stop

then edit /etc/rc.config.d/namesvrs --> look for the variable NISPLUS_CLIENT and set it to zero to disable NIS+ permanently.

After that you should modify /etc/nsswitch.conf too...
****
Unix operates with beer.
John R. Ulmer
Occasional Advisor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

OK - Still, from box2, when I try:
# frecover -rNv -f box1:/dev/rmt/0mnb

I get:
frecover(5405): unable to opend box1:/dev/rmt/0mnb
frecover(5406): Do you wish to ontinue? n
frecover(5407): abort selected.

So, I'm trying to get both boxes back to simple plain vanilla configurations. Both had NIS partially setup. I think I've undone the NIS setup on both. In /etc/rc.config.d/namesvrs, set NISPLUS_CLIENT=0, NIS_CLIENT=0, and NIS_DOMAIN="".

I modified /etc/nsswitch.conf to look at local files on both boxes.

Did /sbin/inet.d/nis.client stop
on both boxes.

I can find no indication that I need to reboot the boxes or refresh a service. 'Seems like there should be something to restart.

Still, when I try:
# frecover -rNv -f box1:/dev/rmt/0mnb

I get:
frecover(5405): unable to opend box1:/dev/rmt/0mnb
frecover(5406): Do you wish to ontinue? n
frecover(5407): abort selected.

OldSchool
Honored Contributor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

I'd suggest that you work with something simple for testing, like a remote "ls", until you're sure that the "r" services are up and correctly running.

then, once you get that working, move on to get fbackup to read / write remote devices.

BTW: you noted you're running hpux 11. Which version. The reason I ask is that at 11.31, it notes that fbackup is being obsoleted. you might start considering alternatives should there be an upgrade in your future......
John R. Ulmer
Occasional Advisor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

Thanks for the strategy thoughts. I've been doing both (remsh ls and frecover) as I go.

From one HP-UX B.11.23 box1 to its sibling box2, when I try:

box2 # remsh box1 ls

I get:
rcmd_af: primary connection shut down

I have an /etc/hosts.equiv on each box that lists the other box with the user 'root'.

On both boxes, /etc/inetd.conf has shell enabled and kshell enabled via remshd. Maybe that should be one or the other and not both?



John R. Ulmer
Occasional Advisor

Re: remsh errors out with 'rcmd_af: primary connection shut down'

Continuing to chase remsh... On http://www.docs.hp.com/en/B3921-90010/rcmd.3N.html, I find,

primary connection shutdown

While waiting for the secondary socket to be set up, rcmd() had its primary connection shut down. This may have been caused by an inetd security failure.

So, how do I track that back to a possible source? Time to start proofing the inetd configuration, I guess.