RCP(1)

πŸ“¦ version 1.0.3, in opensuse-leap 16.0

rcp(1) πŸ’…

okay so bestie, this page is from the General Commands Manual, and it’s all about rcp β€” remote file copy, but make it a whole vibe. Think β€œcopy files between machines,” except with Kerberos lore and a couple of chaotic footnotes. ✨

πŸ’– NAME πŸ’–

rcp β€” remote file copy

✨ SYNOPSIS ✨

rcp [-p] [-x] [-k realm ] [-c ccachefile] [-C configfile] [-D port] [-N]
    [-PN | -PO] file1 file2

rcp [-p] [-x] [-k realm] [-r] [-D port] [-N] [-PN | -PO] file ...
    directory

rcp [-f | -t] ...

three moods, same command, no cap 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so rcp copies files between machines, periodt. Each file or directory argument is either a remote file name shaped like rhost:path, or a local file name (containing no : characters, or a / before any :s). πŸŽ€

By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source file modified by umask(2) on the destination host is used. very demure, very mindful file permissions πŸ’…

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. πŸ¦‹

rcp does not prompt for passwords; it uses Kerberos authentication when connecting to rhost. Each user may have a private authorization list in a file .k5login in their login directory. Each line in this file should contain a Kerberos principal name of the form principal/instance@realm. πŸ”₯

If there is a ~/.k5login file, then access is granted to the account if and only if the originating user is authenticated to one of the principals named in the ~/.k5login file. Otherwise, the originating user will be granted access to the account if and only if the authenticated principal name of the user can be mapped to the local account name using the aname -> lname mapping rules (see krb5_anadd(8) for more details). iykyk Kerberos bestie πŸ‘‘

πŸ’… OPTIONS πŸ’…

  • -p β€” attempt to preserve (duplicate) the modification times and modes of the source files in the copies, ignoring the umask. πŸŽ€
  • -x β€” encrypt all information transferring between hosts. privacy era πŸ”’
  • -k realm β€” obtain tickets for the remote host in realm instead of the remote host’s realm as determined by krb_realmofhost(3).
  • -c ccachefile β€” change the default credentials cache file to ccachefile. 🫢
  • -r β€” if any of the source files are directories, copy each subtree rooted at that name; in this case the destination must be a directory. no shortcuts, bestie 🌸
  • -PN β€” explicitly request the new version of the Kerberos rcmd protocol. The new protocol avoids many security problems found in the old one, but is not interoperable with older servers. (An "input/output error" and a closed connection is the most likely result of attempting this combination.) If neither -PN nor -PO is specified, some simple heuristics are used to guess which to try. πŸ’€
  • -PO β€” explicitly request the old version of the Kerberos rcmd protocol. Same tea as above: the new protocol avoids many security problems found in the old one but is not interoperable with older servers, and an "input/output error" plus a closed connection is the most likely result of attempting this combination. If neither option is specified, some simple heuristics are used to guess which to try. 😭
  • -D port β€” connect to port port on the remote machine. yes, it says port port, iconic 🫢
  • -N β€” use a network connection, even when copying files on the local machine (used for testing purposes).
  • -f, -t β€” these options are for internal use only. They tell the remotely-running rcp process (started via the Kerberos remote shell daemon) which direction files are being sent. These options should not be used by the user. In particular, -f does not mean that the user’s Kerberos ticket should be forwarded! do not touch, bestie πŸ’€
tiny sidebar: the synopsis also shows -C configfile, but the original OPTIONS section doesn’t describe it β€” so I’m not inventing a personality for it. πŸ™ˆ

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. πŸ‘‘

πŸŽ€ FILES πŸŽ€

  • ~/.k5login (on remote host) β€” file containing Kerberos principals that are allowed access.

🌈 SEE ALSO 🌈

πŸ’€ BUGS πŸ’€

  • rcp doesn’t detect all cases where the target of a copy might be a file in cases where only a directory should be legal. directory vibe check: failed 😭
  • rcp is confused by any output generated by commands in a .login, .profile, or .cshrc file on the remote host. same, honestly πŸ™ˆ
  • Kerberos is only used for the first connection of a third-party copy; the second connection uses the standard Berkeley rcp protocol. πŸ’…

that’s the whole page, bestie 🫢 the original footer is just RCP(1), with no extra source/version or date line to report β€” so this cute sign-off is me telling you there’s no secret date/version tea. mwah πŸ’‹

πŸ“¦ where this page comes from