How SFTP protocol works — explained in details step by step

LORY
3 min readMar 12, 2023

Save this post in case you want to understand SFTP protocol quickly

Beginning

SFTP (SSH File Transfer Protocol) is a secure file transfer protocol. It runs over the SSH protocol. you could also consider it a “file transfer feature” added over ssh, or “SFTP commands support” on top of ssh.

Preparation

To understand SFTP quickly. you can download FileZilla and enable the trace to see what is happening.

Here choose 4-debug.

The next thing you can do is open this page and pick one of the servers to test.

Once you are ready, let’s start!

#1 Tcp Handshake

Before ssh starts, it needs a TCP handshake as well. to archive a reliable data stream.

#2 Identification string exchange

The first thing that happens after tcp handshake is identification string exchange. client and server need to know each other’s software and protocol versions are good to talk. the process looks like this below

--

--

LORY
LORY

Written by LORY

A channel which focusing on developer growth and self improvement