Operating System - HP-UX
1831484 Members
3398 Online
110025 Solutions
New Discussion

Re: Problem to execute rcp

 
Marcelo De Florio_1
Frequent Advisor

Problem to execute rcp


I need a execute the following command:

rcp s2500c:/etc/inetd.old .
the output is:
remshd: getservbyname

I have .rhosts with the following entry:
s2500d

any ideas
MDF

Marcelo De Florio
6 REPLIES 6
Sanjay_6
Honored Contributor

Re: Problem to execute rcp

Hi Marcelo,

your .rhosts should have an entry,

remote_server_name user_name

for eg:.
s2500d root
s2500c root

Also your remote server name should be resolved by your system. Also your local server name and ip address should be resolved by your remote server.

Do a "nslookup" and check,

nslookup
> remote_server_name
> remote_server_ip
> exit

The .rhosts file should exist on the remote server.

Hope this helps.

Regds
Bill McNAMARA_1
Honored Contributor

Re: Problem to execute rcp

add it to your /etc/hosts too..
nslookup will verify.

once you can ping the remote server. the only thing that could stop your rcp'ing (apart from service stopped) is if on the remote server you do not have an entry for the local system in the .rhosts for the user logging in.

if root
remote:> id
root ..
remote:> cat ~/.rhosts
local root

and
local:> id
root ..
local:> cat ~/.rhosts
remote root

for the reverse
It works for me (tm)
K.Vijayaragavan.
Respected Contributor

Re: Problem to execute rcp

check the name service switch settings in your system in sam.
or manualy the "/etc/nsswitch.conf" file.
see also:
/etc/hosts.equiv

-Vijay
"Let us fine tune our knowledge together"
Darrell Allen
Honored Contributor

Re: Problem to execute rcp

I presume you are logged into s2500d when you try the rcp command and that the .rhosts file is in your home directory on s2500c. So far, so good.

It seems s2500d was unable to resolve s2500c into an IP address. Verify by using "nslookup s2500c". You may want to add s2500c to /etc/hosts (or DNS). Also check /etc/nsswitch.conf to verify hostname resolution occurs in the appropriate order for your system.

.rhosts must contain the system name the same as it is seen by who. An easy way to determine the name used is to rlogin to the remote system and run "tty" then "who -u" to find the system name associated with the tty. If is is not a name, then you need to add the name to /etc/hosts (or DNS). If is shows as a fully qualified domain name, you need that in .rhosts.

Other issues:
Does .rhosts have appropriate permissions? Is login uncommented in /etc/inetd.conf? If you changed inetd.conf, did you restart inetd by using "inetd -c"?

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Rita C Workman
Honored Contributor

Re: Problem to execute rcp

Well everyone above has mentioned your adjustment to your .rhost file..

But I thought I'd mention the basic syntax of your line. If I've seen this correctly..

You syntax says:

rcp s2500c:

But it should say more like

rcp s2500c:/

Just a thought,
Rita



Bill McNAMARA_1
Honored Contributor

Re: Problem to execute rcp

the syntax is fine for copying from the remote to the local.

but the user that is running the command on the local must be allowed login to the remote in order to retrieve the file.

Thus it's more than likely a problem with the ~/.rhosts of the user on the remote system.

what we need is the output of

1>
hostname
on the local system

2>
ping other_hostname
on the local and remote system

3>
the ~/.rhosts entries on both systems.

a simple test is to check if
remsh remote
asks for a password or not.

If it does it's an rhosts problem.. otherwise it's the

1> service is not allowed. (inetsvcs_sec)

2> simply the file does not exist.

3> hostname lookup problem


Later,
Bill

It works for me (tm)