What you DID NOT know about Network Protocols - FTP, FTPS, and SFTP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this video is sponsored by rebx.net so you need your app to handle data and you need your app to transfer data to and from a server well done an SFTP connection might be very useful and that's what you're going to set up in this video stay until the end to learn how to set up an SFTP connection and transfer data securely the difference between SFTP FTP and FTP SSL first things first though let's clear up some confusion you might have heard of FTP FTP SSL and SFTP but what exactly do they stand for and what's the difference between them well FTP or file transfer protocol is one of the oldest methods of transferring files over a network it's a standard Network protocol used to transfer files from one host to another over a TCP based Network such as the internet however FTP doesn't encrypt your data which means it's not the best option for transferring sensitive information FTP SSL or ftps is essentially FTP with an added layer of security it uses either SSL or secure socket layer or TLS which stands for transport layer security to encrypt the data being transferred SFTP or SSH file transfer protocol is a newer Network protocol similar to FTP but it's built on a different technology it uses SSH or secure shell to encrypt both commands and data providing secure and efficient file transfer SFTP is generally considered the most secure method for transferring files so here is a quick summary FTP is fast but not secure making it suitable for transferring non-sensitive data however it's not recommended to use because of those security issues ftps which stands for FTP SSL or FTP over TLS SSL is more secure than FTP when configured properly it encrypts both commands and data providing a secure layer for data transmission however it may still lack some Advanced security features compared to other secure protocols and finally SFTP is by far the most secure option for file transfer it encrypts both commands and data ensuring a high level of security and integrity for sensitive information Okay so we've got three options then now the question becomes which one should we use why SFTP is the preferred choice at the current stage that would be SFTP sure with what we have heard so far that's what we would expect right but why is SFTP so often the go-to choice for this then I mean the other two seem to be good up options too depending on what your goal for your app is well there are a couple of good reasons first off let's talk about security with SFTP both your commands and your data are encrypted that's a big deal because it means you're safeguarded against unauthorized access and data breaches now imagine you're transferring a large file and suddenly your connection drops with SFTP you don't have to start all over again you can pick up right where you left off thanks to its robust error recovery and if you're a business that has to follow strict rules like HIPAA or gdpr then SFTP is often your go-to because it meets those high security standards plus it's super versatile whether you're on a Mac windows or Linux SFTP has got you covered so yeah there are a bunch of reasons why SFTP is the current standard and we haven't even talked about SFTP authentication modes yet authentication modes in SFTP one of the standout features of SFTP is its versatile authentication modes most of the times when you use some sort of login system it is SFTP where you go through like with your standard password authentication this is the most straightforward method you enter your username and password and you're in you've obviously seen this one a million times already however it's not the most secure option especially if your password is weak then comes another one you probably use a lot two-factor authentication this adds an extra layer of security by requiring not only a password and username but also something that only the user has on them such as a physical hardware token or a smartphone app that generates time-based codes then we have the public key authentication this involves a pair of cryptographic keys that are used to authenticate to an SFTP server as an alternative to password-based logins a private key which is secret is kept on your machine and the public key which is public is placed in a special file on the server then we have some more odd ones like the Kerberos authentication this is a network Authentication Protocol designed to provide strong authentication for users and services over a non-secure network like the internet or the certificate-based authentication which is a method that uses a digital certificate to confirm your identity the certificate is a digital ID for the server or the client and is more secure than a password naturally and that is not even all of them each of these methods has its own set of advantages and disadvantages and the choice of them often depends on the specific requirements of your project for instance public key authentication is generally more secure but can be complex to set up password authentication is easier but less secure and less combined with to UFA so two-factor authentication there's a lot going on in this space and summarizing all of it in one video would obviously lead to many Loose Ends so if you want us to go a lot deeper into any of the topics please let us know in the comments down below but well for now it'll be enough Theory let's get into the practice of it and see how it works on a practical example connecting our app to our test server using c-sharp alright then for this example implementation here I'm going to show you how to connect to a public test SFTP server for this video we're going to be using the test.rebex.net server that the kind people at our sponsor provided us with rebx.net we will be using their server for our testing and if you want to do the same you'll be able to follow along without any problems too we naturally recommend that you do so as it's the easiest and most straightforward way to get started with SFTP besides their services are top-notch if you want to expand your rev-x implementation further with things like file compression terminal emulation and their host of security features not only will the implementation be simple but you will also end up with a great app that is up to Modern standards in just a few steps nonetheless I can assure you that anything we will be learning here today will be perfectly useful as well for any kind of test server that you might want to use in any way let's get started so starting with the essentials let us create a new c-sharp projects for this simple example we will be building a console application as the app focuses on data retrieval so search and select the console app from the list then give your project a name and choose where to save it on your drive as well as where to save the solution we will save the solution in the same directory choose.net 7 and deselect do not use top level statements and click on create great now let's set up our requirements for this application to work first you'll need to install the WebEx SFTP Library you can do this via nougat package manager in Visual Studio this Library will greatly simplify our process here in your c-sharp file import the rebek's namespace great now let's get into the app itself create an instance of the SFTP class SFTP client equals new SFTP so this new object will be used later on now that you are ready you can connect to the server test.rebex.net on Port 22 we can see the port on the server page itself as well as the username and password which are demo and passport respectively so client connects and then in Brackets and in quotations test.rebex.net then quotation and comma 22 closing brackets comma and then in the next line clients.login and then within brackets inside of quotations demo quotation and comma quotation start password quotation and closing bracket and semicolon just as a disclaimer for the purpose of this video where our intent is to Simply connect to the WebEx test server our approach is perfectly fine however if we want to apply this to a production environment one essential step is missing server key validation you find more information about it here by the way we will in our case not need that so we can just move on as is it's good practice always to check if you're connected before you try to make any requests this way you can avoid pesky errors that might arise later or at least you will know that the problem is a connection error technically the step in this specific case is not directly needed as the application would throw an exception if if the connection has not been correctly established however it's a good thing to do as that is not always the case so here we check the connection if client dot is connected then we are just going to write something onto the console saying successfully connected this should already allow us to test the app so let's see if we get successfully connected once you have something like this set up we should be good to go so using system using rebx.net then having the SFTP client object new SFTP then connecting to that client to the WebEx server with the port 22 then logging in with demo and password and then checking if we are connected but first we need to get ourselves a trial key don't worry you'll have 30 days to play around with this and get a good grasp on servers connectivity for that visit the page redbox.net support slash trial and click get trial this will redirect you to a page that it will give you your own personal key to use for your app right underneath you can find a basic implementation which should be more than enough for us so now let's add the line remix.licensing dot key and add our licensing key and now if we run this we will get the following successfully connected so nice the connection is secured now let's use the server let's do this by specifying the remote file path that'll be just the readme file enough for our testing then the local path where you want to download the file here you will also give the file a name we will just call it test.txt now with that file that we want Chosen and the local path set use the get file method to download the file to your local machine so we use our client object again dot get file with the remote path and the local path as parameters by the way we got this remote file from this page over here but you should be able to get more info about what else you can download from their server check out this over here here you can see everything that is available to you for downloading and testing alright and now before we launch let's make sure to disconnect from the server once we retrieve the data we need so in order to disconnect use the client object dot disconnect so just call the method and while we are here let's also enable logging that way we get a bit more information about the connection process itself for that simply add the following line just before the connection here client DOT log Rider new console Rider log level and let's do info and if we run our app now we'll get the same result on our console as last time with the slight difference that now if we navigate to the right file path we can find a new text file that contains the content of the readme file we retrieved great see we already got it working and it was like just a handful of steps actually it was almost two handful of steps but easily enough but now what if we want to write to a server or have some sort of a local server well that's where rebec's tiny SFTP server comes in what if read and write is needed sometimes you need a playground where you can both read and write files getting access to such a tool is not always the easiest especially if you want to test server connectivity and not build yourself a server from the ground up the tiny SFTP server by rabex offers a simple and efficient solution for those who need a minimalist SFTP server for Windows it's designed to be incredibly user friendly you can get it up and running in just 60 seconds all you have to do is download and unpack the zip package run the executable file and press the start button voila you are now serving files via SFTP however it's important to note that this server stores passwords in a clear text configuration file so it's not recommended for scenarios that require high security for those cases rebekst also offers a full-featured SFTP server called buru SFTP server tiny SFTP server is particularly useful for local SFTP client application development and testing if you're a developer who needs to test an app quickly This Server is a godsend you don't have to wait for your tech support department to set up a testing environment or spend hours learning how to configure a full featured SFTP server just get tiny SFTP server and start developing in minutes let us know in the comments below if you'd like to see a follow-up of this video building from scratch a.net application that can read and write data to a server the tiny SFTP server will make quick work of that one and with that there you have it we've explored the ins and outs of SFTP and even connected to a server securely thanks again to revx for making this process so simple so I highly recommend checking them out revx.net you can find the link in the description as well and if you need even more control then give tiny SFTP server a spin if you found this video helpful please hit the like button and subscribe if you haven't done so already and obviously also leave a comment if you have any questions or remarks until next time happy coding foreign
Info
Channel: tutorialsEU
Views: 2,758
Rating: undefined out of 5
Keywords: Tutorials, Tutorial, Programming, Course, Learn, Step by step, guide, programmer, video tutorial, learn how to, how to, sftp, ftp, configuring ftps, ftp server, c#, ssh file transfer protocol, sftp file transfer, sftp vscode, visual studio code, vscode, ftp file transfer, file transfer, sftp server, FTP, FTPS, SFTP, FTP FTPS and SFTP, tcp/ip, TFTP, file transfer protocol, what is ftp, ftp protocol, what is sftp, coding, how to learn programming, programming, code, csharp, c# tutorial, .net, learn
Id: UnSYbu1oOfE
Channel Id: undefined
Length: 15min 35sec (935 seconds)
Published: Thu Oct 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.