Usage Guidelines
SFTP provides for the secure (and authenticated) copying of files between a router and a remote host. Like
the copy command, the sftp command can be invoked only in EXEC mode.
If a username is not provided, the login name on the router is used as the default. If a host name is not provided,
the file is considered local.
If the source interface is specified in the sftp command, the sftp interface takes precedence over the interface
specified in the ssh client source-interface command.
When the file destination is a local path, all of the source files should be on remote hosts, and vice versa.
When multiple source files exist, the destination should be a preexisting directory. Otherwise, the destination
can be either a directory name or destination filename. The file source cannot be a directory name.
If you download files from different remote hosts, that is, the source points to different remote hosts, the SFTP
client spawns SSH instances for each host, which may result in multiple prompts for user authentication.
Task ID
OperationsTask ID
executecrypto
executebasic-services
Examples
In the following example, user abc is downloading the file ssh.diff from the SFTP server ena-view1 to disk0:
RP/0/RP0/CPU0:router#sftp abc@ena-view1:ssh.diff disk0
In the following example, user abc is uploading multiple files from disk 0:/sam_* to /users/abc/ on a remote
SFTP server called ena-view1:
RP/0/RP0/CPU0:router# sftp disk0:/sam_* abc@ena-view1:/users/abc/
In the following example, user admin is downloading the file run from disk0a: to disk0:/v6copy on a local
SFTP server using an IPv6 address:
RP/0/RP0/CPU0:router#sftp admin@[2:2:2::2]:disk0a:/run disk0:/V6copy
Connecting to 2:2:2::2...
Password:
disk0a:/run
Transferred 308413 Bytes
308413 bytes copied in 0 sec (338172)bytes/sec
RP/0/RP0/CPU0:router#dir disk0:/V6copy
Directory of disk0:
70144 -rwx 308413 Sun Oct 16 23:06:52 2011 V6copy
2102657024 bytes total (1537638400 bytes free)
Cisco IOS XR System Security Command Reference for the Cisco CRS Router, Release 4.1
OL-24740-01 259
Secure Shell Commands
sftp