Rcp error while transferring files

i am trying to use a rsh script that uses the rcp command to copy files from server to server but it always produce the following error:

HOSTNAME: protocol failure due to unexpected closure from server end
Error: failed to copy /test to HOST2 system
Error: failed to execute command on remote host HOST2

i have checked .rhosts file and hosts.equiv and everything seems to be fine. All entries are correct

i have checked the firewall and it seems that rsh port 514 still accepts UDP/TCP connections which seems to be fine too.

i also have tested the port with telnet commend and gets connected

i am confused :confused: i couldn't find any solution over the internet :frowning:

i hope you guys help me find a way to solve this problem

many thanks

---------- Post updated at 03:04 AM ---------- Previous update was at 02:55 AM ----------

i forgot to mention that i am using AIX 7.1

Many admins have stopped the r* daemon, as it has too weak security, and use ssh/scp/sftp. Try a local copy using IP addresses and short and long host names before trying remote. Make sure there is a daemon to service rcp. Do not use root id. BTW, to copy /test you need write permission on /.

1 Like

Any log file entries?

thanks for your reply the idea that i have almost 25 servers connected to the server i am working on, yet 24 of them still receiving the file with no errors except for the one i have mentioned above, i tried to use the rcp command directly but it didn't work either it still giving me the same error

i am sorry i couldn't understand how the local copy can be done ? i'm also not familiar with daemon and how to make sure if it is going to receive rcp or not

i would really appreciate your help.

---------- Post updated at 02:43 AM ---------- Previous update was at 02:32 AM ----------

which logs you want to check ? so i can copy them here :slight_smile:

A "daemon" in Unix is generally just a background job, usually one which is relevant for the system. Read more in wikipedia about it.

What DGPickett tried to tell was: r-commands transfer files without any encryption, therefore everybody listening on the "same wire" (=every network card in the same subnet) could read them too as they are transferred. They also handle their communication, even up to passwords, unencrypted. This is why most have shifted from r-commands to other means of achieving the same but with encryption of the transported data. This in most cases is "ssh" to replace any remote connection (telnet, rsh, remsh, rlogin, ....) and either "sftp" or "scp" to replace file transfer (ftp, rcp, ...).

When you install "scp", the basic command to transfer a file would be:

scp userA@hostA:/path/to/sourcefile userB@hostB:/path/to/target

which reads "sourcefile" as userA at hostA and then transfers it to hostB, where it attempts to write it as "target" using user-ID "userB". DGPickett suggests (and rightly so) that, when you install this, you start with transferring a file locally:

scp userA@hostA:/path/to/testfile [userA|userB]@hostA:/path/to/target

Where "hostA" is a short hostname first, then a long hostname:

scp me@host:/tmp/test me@host:/tmp/target
scp me@host.network.com:/tmp/test me@host.network.com:/tmp/target

This makes sure name resolution is working correctly, at least for this host. Only then attempt to transfer the file to a remote destination.

I hope this helps.

bakunin

1 Like

Try your one host with the IP not a hostname. Try an rcp on that host from and to same target id, then try any user id change. Rcp should work, if properly configured.