1 00:00:00,000 --> 00:00:01,770 In this lesson, we're going to discuss 2 00:00:01,770 --> 00:00:04,380 file transfer port and protocols. 3 00:00:04,380 --> 00:00:06,420 Now, as we start looking at file transfer ports 4 00:00:06,420 --> 00:00:08,310 and protocols, we have to realize that these 5 00:00:08,310 --> 00:00:10,680 are specialized rules and procedures that are utilized 6 00:00:10,680 --> 00:00:13,350 for the transmission of files across our networks. 7 00:00:13,350 --> 00:00:15,240 And they operate on the designated ports 8 00:00:15,240 --> 00:00:18,600 that act as doorways for our data transfer activities. 9 00:00:18,600 --> 00:00:20,730 Whenever we're managing file transfers over a network 10 00:00:20,730 --> 00:00:22,920 or the internet, there are several protocols 11 00:00:22,920 --> 00:00:25,740 that each have their own ports that we're going to be using. 12 00:00:25,740 --> 00:00:29,010 So in this lesson, we're going to be talking about FTP, 13 00:00:29,010 --> 00:00:33,150 SFTP, TFTP, and SMB. 14 00:00:33,150 --> 00:00:35,670 Each of these protocols does serve different purposes, 15 00:00:35,670 --> 00:00:38,790 and offers various levels of security and functionality. 16 00:00:38,790 --> 00:00:41,070 First, we have FTP. 17 00:00:41,070 --> 00:00:43,410 FTP, or the file transfer protocol, 18 00:00:43,410 --> 00:00:45,180 is one of the oldest protocols that's used 19 00:00:45,180 --> 00:00:46,770 for transferring files between a client 20 00:00:46,770 --> 00:00:48,720 and a server over a network. 21 00:00:48,720 --> 00:00:51,690 FTP actually is associated with two different ports, 22 00:00:51,690 --> 00:00:54,120 port 20 and port 21. 23 00:00:54,120 --> 00:00:56,910 Port 20 is used for the actual data transfer. 24 00:00:56,910 --> 00:01:00,000 But port 21 is actually used for setting control command 25 00:01:00,000 --> 00:01:02,880 to be able to say, I want to upload or download this file, 26 00:01:02,880 --> 00:01:04,379 and things like that. 27 00:01:04,379 --> 00:01:06,930 So whenever an FTP session is going to be initiated, 28 00:01:06,930 --> 00:01:08,760 the client will first use port 21 29 00:01:08,760 --> 00:01:11,670 to communicate with the server, authenticate if necessary, 30 00:01:11,670 --> 00:01:13,590 and then set up the file transfer. 31 00:01:13,590 --> 00:01:15,180 Once those commands are sent, 32 00:01:15,180 --> 00:01:18,450 then the data transfer takes place over port 20. 33 00:01:18,450 --> 00:01:21,180 While FTP is widely utilized due to its simplicity 34 00:01:21,180 --> 00:01:23,490 and support across many different platforms, 35 00:01:23,490 --> 00:01:26,790 it does have a lot of drawbacks in terms of security. 36 00:01:26,790 --> 00:01:30,180 This is because transmissions over FTP are not encrypted, 37 00:01:30,180 --> 00:01:31,980 and they're sent in plain text. 38 00:01:31,980 --> 00:01:34,230 This means if you're logging into an FTP server 39 00:01:34,230 --> 00:01:36,090 by providing your username and password, 40 00:01:36,090 --> 00:01:39,450 that can actually be intercepted and read by others as well. 41 00:01:39,450 --> 00:01:42,690 The second one we need to talk about is SFTP. 42 00:01:42,690 --> 00:01:46,440 SFTP, or the secure file transfer is what was created 43 00:01:46,440 --> 00:01:49,410 to address the security concerns of FTP. 44 00:01:49,410 --> 00:01:52,500 Now, SFTP actually stands for the SSH 45 00:01:52,500 --> 00:01:56,280 file transfer protocol, or secure FTP. 46 00:01:56,280 --> 00:01:59,220 SFTP will operate over port 22, 47 00:01:59,220 --> 00:02:00,360 and this is the standard port 48 00:02:00,360 --> 00:02:03,360 for the secure shell, or SSH connections. 49 00:02:03,360 --> 00:02:06,810 Essentially, what we're doing with SFTP is we are tunneling 50 00:02:06,810 --> 00:02:10,289 an FTP protocol through an SSH connection, 51 00:02:10,289 --> 00:02:12,030 which is already encrypted. 52 00:02:12,030 --> 00:02:15,780 This way, SFTP can encompass the functionalities of FTP, 53 00:02:15,780 --> 00:02:18,540 along with all those security features of secure shell, 54 00:02:18,540 --> 00:02:20,640 or SSH, by encrypting the data 55 00:02:20,640 --> 00:02:22,110 before it's being transferred. 56 00:02:22,110 --> 00:02:24,060 And this prevents unauthorized disclosure, 57 00:02:24,060 --> 00:02:27,540 and it ensures secure file transmissions are occurring. 58 00:02:27,540 --> 00:02:30,810 The third protocol we need to talk about is TFTP. 59 00:02:30,810 --> 00:02:34,680 Now, TFTP stands for the trivial file transfer protocol, 60 00:02:34,680 --> 00:02:37,200 and it operates over port 69. 61 00:02:37,200 --> 00:02:40,050 Now, TFTP is a simpler, more basic version 62 00:02:40,050 --> 00:02:42,480 of the file transfer protocol, and it doesn't have any 63 00:02:42,480 --> 00:02:44,970 of the bells and whistles of user authentication, 64 00:02:44,970 --> 00:02:47,280 directory browsing, and things like that. 65 00:02:47,280 --> 00:02:50,280 With TFTP, it's just designed for sending files 66 00:02:50,280 --> 00:02:52,230 when minimal security is sufficient, 67 00:02:52,230 --> 00:02:54,420 such as when you're booting up a diskless workstation, 68 00:02:54,420 --> 00:02:56,700 a network device, or a voice over internet 69 00:02:56,700 --> 00:02:58,860 protocol phone on somebody's desk. 70 00:02:58,860 --> 00:03:02,220 All of these do rely on TFTP to get the downloading 71 00:03:02,220 --> 00:03:04,650 of information to those devices. 72 00:03:04,650 --> 00:03:08,160 The fourth and final one we need to discuss is SMB. 73 00:03:08,160 --> 00:03:11,160 Now, SMB, which stands for server message block, 74 00:03:11,160 --> 00:03:14,370 is going to operate over port 445. 75 00:03:14,370 --> 00:03:17,010 SMB is a network file sharing protocol 76 00:03:17,010 --> 00:03:19,830 that allows applications on a computer to read and write 77 00:03:19,830 --> 00:03:22,890 to files and request services from the server programs 78 00:03:22,890 --> 00:03:24,870 inside of a computer network. 79 00:03:24,870 --> 00:03:28,080 SMB is predominantly used for Windows file sharing, 80 00:03:28,080 --> 00:03:29,880 and it allows Windows computers to communicate 81 00:03:29,880 --> 00:03:32,370 with each other and share files over a network. 82 00:03:32,370 --> 00:03:34,380 Now, there is a cross platform version of this 83 00:03:34,380 --> 00:03:37,110 known as Samba, which exists on Linux systems, 84 00:03:37,110 --> 00:03:40,230 that then does rely on the SMB protocol as well. 85 00:03:40,230 --> 00:03:41,820 And so, it is something that is now considered 86 00:03:41,820 --> 00:03:43,980 cross-platform, but was originally designed 87 00:03:43,980 --> 00:03:45,990 just for Windows systems. 88 00:03:45,990 --> 00:03:48,480 Another important thing to remember about SMB 89 00:03:48,480 --> 00:03:50,400 is it is almost exclusively used 90 00:03:50,400 --> 00:03:53,280 inside of local area networks, and it is not a protocol 91 00:03:53,280 --> 00:03:55,320 to send data across the internet, 92 00:03:55,320 --> 00:03:59,010 like you would with FTP or SFTP. 93 00:03:59,010 --> 00:04:01,800 So remember, it's important to understand how file transfers 94 00:04:01,800 --> 00:04:04,260 can be done by using the right ports and protocols 95 00:04:04,260 --> 00:04:06,060 for the function you need. 96 00:04:06,060 --> 00:04:08,700 If you're dealing with FTP, you're going to be utilizing 97 00:04:08,700 --> 00:04:12,180 port 20 and port 21 for basic file transfers. 98 00:04:12,180 --> 00:04:14,400 Where port 20 is used for the data transfer, 99 00:04:14,400 --> 00:04:16,589 and port 21 is used for the commands 100 00:04:16,589 --> 00:04:18,810 inside of the FTP protocol. 101 00:04:18,810 --> 00:04:21,149 If you're using SFTP, you'll be able to have 102 00:04:21,149 --> 00:04:25,020 secure file transfer capabilities by operating over port 22, 103 00:04:25,020 --> 00:04:27,900 by combining the benefits of file transfer from FTP 104 00:04:27,900 --> 00:04:30,180 with the security of SSH. 105 00:04:30,180 --> 00:04:32,580 If you're using TFTP, you're going to use this 106 00:04:32,580 --> 00:04:34,350 for simple unsecured transfers, 107 00:04:34,350 --> 00:04:36,870 and this occurs over port 69. 108 00:04:36,870 --> 00:04:39,480 And finally, if you're operating SMB, 109 00:04:39,480 --> 00:04:41,997 you're going to be doing this over port 445, 110 00:04:41,997 --> 00:04:44,940 and it's mostly used for Windows network file sharing, 111 00:04:44,940 --> 00:04:47,940 especially inside of a local area network. 112 00:04:47,940 --> 00:04:49,770 When it comes to choosing your protocol, 113 00:04:49,770 --> 00:04:52,050 remember that you need to align your security requirements, 114 00:04:52,050 --> 00:04:54,120 network environment, and functionality needed 115 00:04:54,120 --> 00:04:56,250 for the task at hand to select the right 116 00:04:56,250 --> 00:04:58,443 file transfer protocol for your use.