System Administration Guide: Security Services

Transferring Files Remotely Using sftp

The sftp command works similarly to ftp but uses a different set of commands. The following table lists some representative commands.

Table 5–3 Interactive sftp Subcommands
 Category

Subcommands 

Description 

Navigation 

cd path,

Changes the remote directory to path.

 

lcd path

Changes the local directory to path.

Ownership 

chgrp group file

Changes the group for file to group, a numeric GID.

 

chmod mode file

Changes the permissions of file.

 File copying

get remote_file [local-path]

Retrieves remote_file and stores it on the local host.

 

put local_file [remote_path]

Stores a local file on the remote host. 

 

rename old_filenew_file

Renames a local file. 

Directory listing 

ls [path]

Lists the contents of the remote directory. 

Directory creation 

mkdir path

Creates a remote directory. 

Miscellaneous 

exit, quit

Quits the sftp command.