In this lesson, we're going to discuss
file transfer port and protocols.
Now, as we start looking at file transfer ports
and protocols, we have to realize that these
are specialized rules and procedures that are utilized
for the transmission of files across our networks.
And they operate on the designated ports
that act as doorways for our data transfer activities.
Whenever we're managing file transfers over a network
or the internet, there are several protocols
that each have their own ports that we're going to be using.
So in this lesson, we're going to be talking about FTP,
SFTP, TFTP, and SMB.
Each of these protocols does serve different purposes,
and offers various levels of security and functionality.
First, we have FTP.
FTP, or the file transfer protocol,
is one of the oldest protocols that's used
for transferring files between a client
and a server over a network.
FTP actually is associated with two different ports,
port 20 and port 21.
Port 20 is used for the actual data transfer.
But port 21 is actually used for setting control command
to be able to say, I want to upload or download this file,
and things like that.
So whenever an FTP session is going to be initiated,
the client will first use port 21
to communicate with the server, authenticate if necessary,
and then set up the file transfer.
Once those commands are sent,
then the data transfer takes place over port 20.
While FTP is widely utilized due to its simplicity
and support across many different platforms,
it does have a lot of drawbacks in terms of security.
This is because transmissions over FTP are not encrypted,
and they're sent in plain text.
This means if you're logging into an FTP server
by providing your username and password,
that can actually be intercepted and read by others as well.
The second one we need to talk about is SFTP.
SFTP, or the secure file transfer is what was created
to address the security concerns of FTP.
Now, SFTP actually stands for the SSH
file transfer protocol, or secure FTP.
SFTP will operate over port 22,
and this is the standard port
for the secure shell, or SSH connections.
Essentially, what we're doing with SFTP is we are tunneling
an FTP protocol through an SSH connection,
which is already encrypted.
This way, SFTP can encompass the functionalities of FTP,
along with all those security features of secure shell,
or SSH, by encrypting the data
before it's being transferred.
And this prevents unauthorized disclosure,
and it ensures secure file transmissions are occurring.
The third protocol we need to talk about is TFTP.
Now, TFTP stands for the trivial file transfer protocol,
and it operates over port 69.
Now, TFTP is a simpler, more basic version
of the file transfer protocol, and it doesn't have any
of the bells and whistles of user authentication,
directory browsing, and things like that.
With TFTP, it's just designed for sending files
when minimal security is sufficient,
such as when you're booting up a diskless workstation,
a network device, or a voice over internet
protocol phone on somebody's desk.
All of these do rely on TFTP to get the downloading
of information to those devices.
The fourth and final one we need to discuss is SMB.
Now, SMB, which stands for server message block,
is going to operate over port 445.
SMB is a network file sharing protocol
that allows applications on a computer to read and write
to files and request services from the server programs
inside of a computer network.
SMB is predominantly used for Windows file sharing,
and it allows Windows computers to communicate
with each other and share files over a network.
Now, there is a cross platform version of this
known as Samba, which exists on Linux systems,
that then does rely on the SMB protocol as well.
And so, it is something that is now considered
cross-platform, but was originally designed
just for Windows systems.
Another important thing to remember about SMB
is it is almost exclusively used
inside of local area networks, and it is not a protocol
to send data across the internet,
like you would with FTP or SFTP.
So remember, it's important to understand how file transfers
can be done by using the right ports and protocols
for the function you need.
If you're dealing with FTP, you're going to be utilizing
port 20 and port 21 for basic file transfers.
Where port 20 is used for the data transfer,
and port 21 is used for the commands
inside of the FTP protocol.
If you're using SFTP, you'll be able to have
secure file transfer capabilities by operating over port 22,
by combining the benefits of file transfer from FTP
with the security of SSH.
If you're using TFTP, you're going to use this
for simple unsecured transfers,
and this occurs over port 69.
And finally, if you're operating SMB,
you're going to be doing this over port 445,
and it's mostly used for Windows network file sharing,
especially inside of a local area network.
When it comes to choosing your protocol,
remember that you need to align your security requirements,
network environment, and functionality needed
for the task at hand to select the right
file transfer protocol for your use.