Body
Overview
SFTP (Secure File Transfer Protocol) allows easy transfer of files between a remote and local system. It is built on top of SSH (Secure Shell) and commonly used to transfer files between a server and a local workstation. Some UTD systems that you may use SFTP with include, but are not limited to: Giant/PubSSH, CS Linux Servers, etc.
Connecting to a Remote System
Before connecting to a remote system, you must know the system hostname and your UTD credentials.
- Open a Terminal.
- Enter
sftp NetID@[system hostname]
- Ex:
sftp abc123456@giant.utdallas.edu
- When prompted, enter your UTD password.
- Once connected, you will be dropped into the
sftp>
prompt.
Transferring Files
Commonly Used Commands
- help – lists all available commands
- CTRL+L – clears the terminal
- pwd – “print working directory” displays the current path
- ls – lists files and directories
- Optional: Specify path, -l for details, -a to include hidden
- get – copy a remote file to the local system
- put – copy a local file to the remote system
- exit or quit – quit SFTP
Note: By default, the get/put commands will copy files to the working directory of the remote system from the directory of the local system where the sftp command was executed (working directory), or from the working directory of the local system to the working directory of the remote system.
Examples
Copy File to Remote System
sftp> put copy-me.txt
The file copy-me.txt is copied from ~/copy-me.txt to the working directory of the remote system.
Copy File to Remote System (With File Path)
sftp> put ./foo/bar/file.txt ./files/
Copy the file from ~/foo/bar/file.txt to ./files/file.txt
Copy Directory to Local System
sftp> get -R foo/
The directory foo will be copied to the local system in the current working directory.