SCP - Secure Copy Protocol

Imran Afzal (250k+ students)
A free video tutorial from Imran Afzal (250k+ students)
Bestselling Instructor with over 250,000 students worldwide
4.6 instructor rating • 16 courses • 246,808 students

Lecture description

SCP - Secure Copy Protocol in Linux

Learn more from the full course

Complete Linux Training Course to Get Your Dream IT Job 2021

The BEST Linux Administration course that prepares you for corporate world and for RHCSA, RHCE, and LFCS certifications

29:37:15 of on-demand video • Updated March 2021

  • By the end of this course you will be a professional Linux administrator and be able to apply for Linux jobs
  • You will be able to take the EX-200 exam and become Redhat Certified System Administrator (RHCSA - EX200)
  • You will learn 150+ Linux system administration commands
  • CentOS and Redhat version 7 and 8
  • You will gain advance Linux systems administration skills and have deep understanding of Linux fundamentals and concepts
  • You will be able to troubleshoot everyday Linux related issues
  • You will manage Linux servers in a corporate environment
  • You will write basic to advance level shell scripts
English [Auto] Hello In this lesson we are going to cover P which is secure copy protocol. Now the secure copy protocol or SGP helps to transfer computer files securely from a local host to a remote host. It is somewhat similar to FCP but it adds security and authentication. So if you are transferring a file again from server a to server B you could use S C P as the protocol or the command rather than FCP. And the reason it is preferred is because it is secure. It adds more security and authentication now the protocol as I said before the portal call is a set of rules used by computers to communicate. So and SVP was built they decided OK this is the protocol that SVP should use and this is the port that should be used to transfer a file from one server to another. The default SVP port is SS speech or port 22. So there is no different protocol that was established or set up for SGP so it actually leverages on to the same SSA protocol that we use to connect from one server to another. Or SS each. Now for this lecture again we needed two linux machines. One is for the Clyde and one is for the server. The client is where we have the file and the server is where we want to transfer that file to the client. I have my linux machine and it is called My First Linux VM for the server. I have a server which is exactly the same as client as well but I named it a Linux centre was 7 so the process is the ACP. The process in the graphical way is that you have a client a client B server now client a wants to copy a file over to server B. Now it will use the portal call as C P or the command ACP but it actually transferred that over through the protocol we already have in place and that is SSA. So there is no new protocol for that. It actually piggyback on SSA. And of course the SSA port is 22 and the service for SSA it daemon should be running under recipient order remote server in order to accept any incoming incoming traffic. Okay. What's the process. The MCP command to transfer files to the remote server first of all you have to log in yourself then create a file any file. Let's say V in this in this lesson or in this lab will create a file called Jack once the jack file is created. Then we will simply run the command MCP the file named Jack. I have Zoll is a user name that actually exists on their remote server at 1 I2 168 1 Dot. X is the app the app actual IP of the remote server. Of course to replace that X that the digit that is the digit of your remote server. And the last part is called the slash home slash high. So this is where you want the file to go to in this directory on the remote server. Once it's connected then it's going to ask you to enter username and password and it will transfer the file successfully. Now enough is enough. Let's actually start our Linux machine which I have already started and I have already logged into my putty. This is my linux machine and I refer to as my client machine because this is the one that connects to the server and this machine hostname is my first Linux VM who is logged in. Who am I. I'm logged in as myself. I followed the directions here. I'm gonna create a file called Jack in my home directory in my home directly slash home slash I have salt. I'll go ahead and do touch Jack and I do unless my ESL tr. You will see I have a file called Jack. It has zero bytes. Now I wanted to transfer that but before I translate put something in there just to make sure it is transferred with the right content. So let's do VII on Jack and just put Jack as Gerry's uncle. That's it. Do Ellis myself TR Now you see it has total by twenty two. Perfect. Now we need to transfer this file to our remote server. But before we transfer that file to the remote so well we wanted to know what is the IP address of that remote server. So I'm going to go into my remote server which I also have it opened and I'm going to do if config ENP 0 is 3 because that's the interface where the IP is assigned and the IP is 1 8 2 168 1 dot 58. Beautiful. Let's go back to my client and now this time I'm going to run the command. That's clear the screen so you could see it better now run the command MCP. The name of the file which is Jack the name of the user who is going to log in to the remote server. What is a remote server one ninety two the 160 a one DOD 58 yes and then colon slash. Where is it going to reach directory. It's going to home. I saw hit enter and it's gonna ask you for the password. If you are doing SVP for the first time then it's going to ask you for the fingerprints where you have to type in yes and then enter the password. So go ahead and password and it saves a Jack which is a file name. Hundred percent transferred and this size was 22 and this is the time it took to transfer. OK. I got this message on the client but let's confirm on the server or whether it was transferred or not. So first of all it was transferred as I have Zoll So I have to log in as I was all so who am I I am I have so beautiful now which directory am I logged into. I am in my home directory because that's where I transferred the file right now. I will do this minus l TR to check if that jag file came in. It did. Perfect. Now is this the right file that came in last CAD at we did the cat. Jack is Gerry's uncle. Perfect. This is how the SVP works. And you could also do the same thing by the way. ACP to go into this remote server if you wanted to pull something out of that server from server to the client. And you just have to reverse the command anyway try it out. And these are a couple of commands a few commands that I wanted to cover and very important commands. When you are dealing with transferring files for one server to another.