Secure File Transfer Protocol (SFTP)

Secure File Transfer Protocol is a network protocol for securely accessing, transferring and managing large files and sensitive data.

How to use SFTP

  1. open a command line terminal

  2. type sftp "username@hostname"

Example:

sftp 407939ef5a69@407939ef5a.09417.alxcode

sftp commands

  1. ls - lists the files in the remote directory

  2. lls - lists the files in your local machine

  3. pwd - prints the remote server working directory

  4. lpwd - prints the local working directory

  5. cd - changes the remote working directory

  6. lcd - changes directory in your local machine

  7. mkdir - to create a directory on the remote server

  8. lmkdir - to create a directory on the local machine

  9. bye - to end the sftp prompt

  10. put - put is used to upload files from the local machine to the remote server

put filename

  1. mput - mput is used to upload multiple files from the local machine to the remote server

Example: upload all files that end with .txt from the local machine to the remote server

mput *.txt

  1. get - get is used to download files from the remote server to the local machine

    get filename

  2. mget - mget is used to download multiple files from the remote server to the local machine

Example: download all files that end with .txt from the remote server to local machine

mget *.txt