rcp – copy files between different machine without password


Tu use rcp on your system, you have to do these steps:

  1. Install rsh-server
    rpm -Uhv rsh-server-xxxxx.rpm
  2. Activate rlogin and rsh
    chkconfig rlogin on
    chkconfig rsh on
  3. Edit ~/.rhosts file and add the hostname that can rcp to this system.
    hostname1 username
    hostname2 username

    If the file doesn’t exist, create one and add the lines above.
  4. try tp rcp file to the other system.
    rcp [filename] [hostname]:[filename]
    rcp test rac2:test1

when I try rcp on my system (RHEL4) I get this error.

rcp

Then I use /usr/bin/rcp instead of rcp command and it worked.

/usr/bin/rcp test rac2:test1

Then I do this:

# su -

# which rsh
/usr/kerberos/bin/rsh

# mv /usr/kerberos/bin/rsh /usr/kerberos/bin/rsh.original
# mv /usr/kerberos/bin/rcp /usr/kerberos/bin/rcp.original
# mv /usr/kerberos/bin/rlogin /usr/kerberos/bin/rlogin.original

# which rsh
/usr/bin/rsh

Now I can use rcp command directly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: