The RCP protocol requires a client to send a remote username on each RCP request to a server. When you copy a configuration
file from the device to a server using RCP, the Cisco IOS software sends the first valid username it encounters in the following
sequence:
-
The username specified in the copy EXEC command, if a username is specified.
-
The username set by the ip rcmd remote-username global configuration command, if the command is configured.
-
The remote username associated with the current tty (terminal) process. For example, if the user is connected to the device
through Telnet and was authenticated through the username command, the device software sends the Telnet username as the remote username.
-
The device host name.
For the RCP copy request to execute successfully, an account must be defined on the network server for the remote username.
If the server has a directory structure, the configuration file or image is written to or copied from the directory associated
with the remote username on the server. For example, if the system image resides in the home directory of a user on the server,
you can specify that user name as the remote username.
Use the ip rcmd remote-username command to specify a username for all copies. (Rcmd is a UNIX routine used at the super-user level to execute commands on
a remote machine using an authentication scheme based on reserved port numbers. Rcmd stands for “remote command”). Include
the username in the copy command if you want to specify a username for that copy operation only.
If you are writing to the server, the RCP server must be properly configured to accept the RCP write request from the user
on the device. For UNIX systems, you must add an entry to the .rhosts file for the remote user on the RCP server. For example,
suppose the device contains the following configuration lines:
hostname Device1
ip rcmd remote-username User0
If the device IP address translates to device1.example.com, then the .rhosts file for User0 on the RCP server should contain
the following line:
Device1.example.com Device1