College of Engineering Logo Web Server Logs Student Server Logs Orange bar Main Page General Information Special Events Programs Research Student Information Computer Facility Outreach Xtreme Engineering Jobs Available

Remote Copy (rcp)

Computer Facility University of Hawaii at Manoa
College of Engineering

The rcp program allows the transparent copying of files between hosts, without having to enter passwords. This is possible through the use of the security file described below. The format of the command is as follows:

    rcp from to
    Where the from and to arguments can be specified either as local files, or as remote files. In order to specify a remote file, use the format as shown: user@hostname:filename. If the remote login ID is identical to the local login ID, the user@ portion can be omitted.

The rcp program behaves similarly to the Unix cp program. Full path names can be specified for both remote and local file systems. Multiple files can be copied to a destination directory as well. Entire directory hierarchies may be copied using the -r option. For example: rcp -r homework1 uhunix.its.hawaii.edu:Storage stores the local directory, homework1 into a remote directory Storage on the machine, uhunix.its.hawaii.edu.

The rcp Security file

The security file used by rcp is called .rhosts, which must reside in the local user's home directory, and be owned by that user. (Note: Some other programs which use this file are rlogin, and remsh, or rsh for SunOS.) This file identifies those users who are "equivalent" to the local user, and are given access without having ot enter a password.

The .rhosts file is a plain text file which can be created with any text editor. Lines beginning with a pound sign (#) are comments, blank lines are ignored, and the rest of lines in the file should contain at least a host and if the login ID is different on the remote host, the login ID as well.

This sample .rhosts file is for the user buddy on the host, wiliki. The following three accounts are considered "equivalent" accounts. He/she has accounts on coe5 and spectra with the same login ID, and has an account on uhunix as buddydoe.

    # This is a comment, so don't read this.
    spectra.eng.hawaii.edu buddy
    uhunix.its.hawaii.edu buddydoe
    coe5.eng.hawaii.edu buddy

Notes/Warnings:

  • In no event should there be a line with a single plus sign (+), which means any user can log in from anywhere.
  • Take care not to leave this file write-able to others. You can ensure this by typing this command: chmod 644 .rhosts.
  • Restrict the listing of "trusted users" to those hosts on which you use frequently.
  • Only for the College of Engineering workstations, the file must be world-readable if you intend to use rlogin to log into the workstations.
  • For some hosts, because their name server does not work properly, fully-qualified Internet addresses may have to be specified.

BE SURE TO CHECK THIS FILE PERIODICALLY!!!


Previous Next Next Section Index

Author: Ben Yoshino (ben@wiliki.eng.hawaii.edu)

Comments, Questions? | E-mail: webmaster@wiliki.eng.hawaii.edu


Last updated on Thursday, August %.1d, 2002
Copyright © 2001 University of Hawai`i, College of Engineering, Computer Facility
All rights reserved.