This content covers the key protocols used for sharing and transmitting files across networks, including HTTP/HTTPS, FTP and its variants, NFS, and SMB/CIFS. Each protocol is examined in terms of its practical use cases, port assignments, and relative security.
File Sharing Protocols
Some of the last protocols to go over are some protocols used for sharing and transmitting files: HTTP and HTTPS, FTP, TFTP, SFTP and FTPS, and NFS and SMB/CIFS, which is server message block.
I am actually including HTTP and HTTPS first up because, if you think about it, that is exactly what we are doing when we go to a browser: that page is being sent to my computer. So it is sharing an HTML file to my computer and then presenting it as a web page. So I included HTTP and HTTPS as an example of file sharing. Maybe stretching it a little bit there.
But the other thing that I want to drive home too is that there are a lot of web services out there, a lot of services that actually do file sharing. Whether it is Google Drive or Microsoft OneDrive or Dropbox, there are a lot of services out there that share files, and they use HTTP and HTTPS as a way to transmit that file and share those files.
Next up we have file transfer protocol. Not near as common as HTTP and HTTPS, but file transfer protocol is something that we use to share data and send it. I use this a lot when it comes to things like, if you have got one system that needs to upload data into another system, then you will upload it to an FTP server and then get it transferred to that server to get it into the other system. So I do this a lot of times when you are transferring data from one system to another. Or another thing is, let us say you have a website that you are getting up and going. Then perhaps what you do to get the HTML files up to the directories that they need to get into is you use FTP to upload that data.
What it will do is make a connection and establish a TCP connection on port 21, but it will actually use port 20 to do the file transfer and get things uploaded via port 20. So 21 is more of the control, versus 20 is the stream of data that is happening.
Getting back to our URI discussion, you will see that we are using a protocol, FTP. We can send a username and password with this as we are sending it over, although I would not recommend it, because FTP in general is not secure. We will talk about some ways that we can secure it, but I typically do not put the password in the transfer. Then we see that the domain is next, so we have got the domain that we are trying to connect to, and then the port that it exists on, so what port we are connecting to. Usually it is port 21. And then the path of whatever directory we are trying to access on the other side, so that way we can upload files directly to that directory. So this is the syntax for connecting to an FTP server.
There are some variations to it, such as TFTP, trivial file transfer protocol. There is SFTP, which is SSH FTP, so essentially it is FTP but it uses SSH to transfer those files. And there is FTPS, which is FTP secure, or FTP over SSL, although once again we really do not use SSL. It is not considered secure anymore, so we use other protocols such as TLS. But we have FTPS.
I would say I do not see this one all that often. I have only used TFTP when I am doing some admin stuff and I have got certain servers or Cisco equipment that need to use TFTP. This is the one that is most common that I use the most, way beyond FTP. I try not to use FTP, once again, because it is just insecure. So we should try to avoid using FTP and opt for a more secure method.
So now we have network file system. NFS is more associated with things like Linux, and it is a way to share out files and directories with NFS. Where I have most commonly used this is for things like virtualization, where I have some sort of NAS storage and I can use NFS to share out volumes to my infrastructure. So that way I can share out different volumes, and then different servers can have access to those volumes and it can store virtual machines on it. So it is pretty powerful. There are a lot of cool features in NFS, and it is used more on Linux machines, and I have used it with things like virtualization.
Although if you are more on Windows and use Windows more, then you are probably going to gravitate away from NFS and use more SMB or CIFS. SMB is server message block. CIFS is actually an older version, or one of the versions, of SMB. So really, you may see CIFS out there, referenced as CIFS, but really it is server message block that is used nowadays.
It is a way for Windows machines, not always Windows machines, but Windows machines, to share out things like files and folders or printers or other objects. So SMB is a way to share out the resources on a Windows network.
Now, if this happened to be something like a Linux box and you wanted to share to Windows machines, then you could set up a service like Samba, and set up Samba to share out files and folders on it.
I really like SMB because it has got a lot of permissions and a lot of granularity when it comes to controlling access. So I really love how much control it gives you on access to these different files and resources.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →