rcp [ -p ] [ -r ] file ... directory
If the -r option is specified and any of the source files are directories, rcp copies each subtree rooted at that name; in this case the destination must be a directory.
By default, the mode and owner of file2 are preserved if it already existed; otherwise, the mode of the source file modified by the umask on the destination host is used. (See umask(C) for a description of umasks.) The -p option causes rcp to attempt to preserve (duplicate) in its copies the modification times and modes of the source files, ignoring the umask.
If path is not a full path name, it is interpreted relative to your login directory on rhost. A path on a remote host may be quoted (using \, ", or ´) so that the metacharacters are interpreted remotely. See sh(C) for quoting rules.
rcp does not prompt for passwords; if the user account requires a password, your current local user name must exist on rhost and allow remote command execution via rcmd(TC).
If an account has no password, any user can use rcmd or rcp commands to access that account. In this case, an entry in /etc/hosts.equiv or in a .rhosts file is not required.
rcp handles third-party copies, where neither source nor target files are on the current machine. Hostnames may also take the form ``rname@rhost'' to use rname rather than the current user name on the remote host.
rcp attempts to connect to kshell port on the remote host. If the connection to the kshell port succeeds in reaching an authenticated rshd server, then rcp will establish authentication (using krb5_sendauth). If rcp cannot connect to kshell, it will abort the connection and retry using the standard shell port.
To execute authenticated rcp,
the user must have network credentials,
and the user's principal name must appear in the
$HOME/.k5login file on the
remote host (this file must be writable
only by the user or by root, and it must be readable by
root in the filesystem where it resides).
The first example copies list
from fred's home directory on alpha to
fred's home directory on beta.
rcp list beta:list
The next example copies a directory hierarchy.
The original is rooted at src
in fred's home directory on beta.
The copy is to be rooted in src
in the working directory.
rcp -r beta:src .
Finally, fred copies a file from diane's home directory on
beta to /usr/tmp on gamma;
the copy on gamma is to belong to karl.
Both diane and karl must have previously declared fred on
alpha equivalent to their own user names; see
rcp beta.diane:junk gamma.karl:/usr/tmp
Note that junk is not placed in karl's home directory because the path part of the name begins with a slash.
Permission deniedmeans either that the remote user does not have permission to do what you want or that the remote user is not equivalent to you.
If a remote shell invoked by rcp has output on startup, rcp will get confused. This is never a problem with sh(C), because it is not called as a login shell.
The -r option does not work correctly if the copy is purely local, since it relies on underlying support from cp, which is only available on BSD derived systems. Use cpio(C), instead.
The destination user and hostname may have to be specified as ``rhost.rname'' when the destination machine is running a 4.2BSD derived version of rcp.
Authentication is based on Version 5 of the Kerberos Network Authentication Service protocol. Only this version of the protocol is supported.
Data encryption is not supported.