Learn basics of SSH ( Secure Shell) and key pair generation : The beginner's guide | BEENUM LEARNING | Skillshare
Drawer
Search

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Learn basics of SSH ( Secure Shell) and key pair generation : The beginner's guide

teacher avatar BEENUM LEARNING, Simplifying Imaginations

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      1 Course Introduction

      2:12

    • 2.

      2 Overview of SSH (Secure Shell)

      8:58

    • 3.

      3.1 Generate SSH key pair with WSL (Windows Subsystem for Linux) in Windows OS

      5:21

    • 4.

      3.2 Generate SSH key pair with PUTTYgen application in Windows OS

      4:02

    • 5.

      3.4 Generate SSH key pair with Command Prompt in Windows OS

      4:14

    • 6.

      3.5 Generate SSH key pair with Linux terminal (Ubuntu) / Same for Mac OS as well

      3:02

    • 7.

      4 SSH authenticate / create secure communication channel between client and server

      6:42

    • 8.

      Congratulations

      1:04

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

160

Students

2

Projects

About This Class

In this course we are going to learn following concepts

1. What is SSH ( Secure Shell) ?

2. Why to use SSH ( Secure Shell) ?

3. Various methods to generate SSH ( Secure Shell) key pair i.e. private and public keys with Windows, Linux/Mac Operating systems for desktop.

4. Practical session on how to SSH into server from client with private key i.e. without and with password based authentication.

SSH Protocol – Secure Remote Login and File Transfer

The SSH protocol (also referred to as Secure Shell) is a method for secure remote login from one computer to another. It provides several alternative options for strong authentication, and it protects the communications security and integrity with strong encryption. It is a secure alternative to the non-protected login protocols (such as telnet, rlogin) and insecure file transfer methods (such as FTP).

Typical uses of the SSH protocol

The protocol is used in corporate networks for:

1. providing secure access for users and automated processes

2. interactive and automated file transfers

3. issuing remote commands

4. managing network infrastructure and other mission-critical system components.

How does the SSH protocol work

The protocol works in the client-server model, which means that the connection is established by the SSH client connecting to the SSH server. The SSH client drives the connection setup process and uses public key cryptography to verify the identity of the SSH server. After the setup phase the SSH protocol uses strong symmetric encryption and hashing algorithms to ensure the privacy and integrity of the data that is exchanged between the client and server.

Strong authentication with SSH keys

There are several options that can be used for user authentication. The most common ones are passwords and public key authentication.

The public key authentication method is primarily used for automation and sometimes by system administrators for single sign-on. It has turned out to be much more widely used than we ever anticipated. The idea is to have a cryptographic key pair - public key and private key - and configure the public key on a server to authorize access and grant anyone who has a copy of the private key access to the server. The keys used for authentication are called SSH keys. Public key authentication is also used with smartcards, such as the CAC and PIV cards used by US government.

The main use of key-based authentication is to enable secure automation. Automated secure shell file transfers are used to seamlessly integrate applications and also for automated systems & configuration management.

We have found that large organizations have way more SSH keys than they imagine, and managing SSH keys has become very important. SSH keys grant access as user names and passwords do. They require a similar provisioning and termination processes.

In some cases we have found several million SSH keys authorizing access into production servers in customer environments, with 90% of the keys actually being unused and representing access that was provisioned but never terminated. Ensuring proper policies, processes, and audits also for SSH usage is critical for proper identity and access management. Traditional identity management projects have overlooked as much as 90% of all credentials by ignoring SSH keys. We provide services and tools for implementing SSH key management.

SSH provides strong encryption and integrity protection

Once a connection has been established between the SSH client and server, the data that is transmitted is encrypted according to the parameters negotiated in the setup. During the negotiation the client and server agree on the symmetric encryption algorithm to be used and generate the encryption key that will be used. The traffic between the communicating parties is protected with industry standard strong encryption algorithms (such as AES (Advanced Encryption Standard)), and the SSH protocol also includes a mechanism that ensures the integrity of the transmitted data by using standard hash algorithms (such as SHA-2 (Standard Hashing Algorithm)).

SFTP file transfer protocol

The SFTP (SSH File Transfer Protocol) is probably the most widely used secure file transfer protocol today.

Public key file format

The public key file format is not a formal standard (it is an informational document), but many implementations support this format.

How to Cite SSH

To cite SSH in a research paper, please use the following:

Tatu Ylonen: SSH - Secure Login Connections over the Internet.

Proceedings of the 6th USENIX Security Symposium, pp. 37-42, USENIX, 1996.

Reference: SSH Academy

Meet Your Teacher

Teacher Profile Image

BEENUM LEARNING

Simplifying Imaginations

Teacher

Hello, 

We're BEENUM LEARNING, Oracle Cloud and Python content creator. We create content to help students and professionals to learn Oracle Cloud, Oracle Integration Cloud (Integration, Process, Visual Builder, B2B and Insight) and excel in their career. Please watch our courses to begin your career in Oracle with BEENUM LEARNING.

See full profile

Level: Beginner

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. 1 Course Introduction: Have you come across the term SSH, secure Shell while working on any of your projects. And are you wondering, what does SSH time for? What are the basics of intersect, and how does the SSH mechanism works? Then this course is specifically meant for beginners like you who are new to SSH terminology and don't know anything about SSH. So this course is going to help you in order to understand about the basics of SSH. This course is just for the beginners who want to learn essences at the beginning of your career, just to know what is SSAS, how we can generate the SSH keys and basic concepts involved in the SSS. Here is the short beams on the contents covered on this course. We are going to discuss about the basics of SSH. What is SSH? What is the algorithm which drives the SSS? And how the authentication will happen and establish that take your channel or the tunnel between the client and the server so that they can communicate securely over the web without the security database or any other threads from the third party. We're going to learn in detail how we can generate SSH key pair, that is private and public key. As SSS is going to make use of asymmetric encryption standards over here, we're going to learn what does it stand for shortly in this course, we will learn how we can generate the SSH key pair on Windows, Linux, as well as on the Mac. Mac specifically, we own power. We will explain the concept with the help of Linux terminal that will hold true for Mac as well. So both are having the terminal. So on Windows we will make use of couple of applications and demonstrate how we can make use of SSDs. The end of this course, we will have hands-on on how we can SSH into the server from our client machine with the help of private key as well as with the help of password. But the concepts we will learn with the wide adoption of cloud, that is AWS, Google, or any other Cloud platform. We're using SSH heavily in order to login to a remote servers and carry out the operations available with resources on that particular Cloud Platform. We hope you would enroll for this course and learn along with us, what does SSH mean and how we can generate SSH key pairs, and how we can login to the service from the client. So without wasting much time, let's begin with the workforce. 2. 2 Overview of SSH (Secure Shell): In this class, we are going to learn about the basics of SSH. What does SSH time for home? Ssh works. And what is the technology which drives this SSH? What are the pros and cons of SSH? Plus, let's see what is SSH. Ssh stands for Secure Shell. Ssh is a cryptographic network protocol. Cryptography is a technique with the help of the sender and the receiver will be able to communicate securely, that is, without the intervention of third party. So the third party cannot delete the data or the messages, what is exchanged between the sender and the receiver. With the help of this SSH, we can establish a tunnel or communication channel between sender and receiver so that the messages are not red or decrypted by anyone during the path. Now the question will arise, why does SSH is used, as I said, are basically used in order to access the remote system or servers with the wide adoption of Cloud servers, nowadays, we basically make use of SSH heavily in order to establish the connection between our server and the client machine. Ssh will provide a mechanism that is for mutual authentication between the server and the client so that a tunnel or the channel is established for communication purpose. No way does SSH is needed. We already have username and password with the help of V-to-V login to our Cloud systems. Long way, suddenly there is a requirement for SSH, username and password most of the time are highly risky because we might use username and password in order to carry out a lot of activities. Like me will have a username, password for our personal e-mail account, and lots of other stuff. Maintaining all those username and passwords will require us to audit those things in a file or some web so that we can remember this mix, username and password. Risky because someone who is having access to those plain text files wherever we store this password, they can try to get those passwords and login on our behalf and carry out the operations. Before SSH, there was symmetrical encryption in which the sender and the receiver use to authenticate with a single key. That is a key. It could be anything like 1234. So sender will send these key and the receiver will identify these key. And then they tried to establish that connection as there is only one key in all over here, it makes, again, the security risky because anyone who is having access to that key will try to login on our behalf. Ssh makes use of asymmetric encryption. That is, instead of one key, like in symmetrical encryption, we're having a couple of keys. That is, a pair of keys that is called as public key and the private key. So public key, this key will be generated and stored in the server as well as in the client machines. Like there is a cloud. So there we have the public key attached to the VM or any other resources. Any communication happens with the client. It could be a user or the principal or application, so it could be authenticated with the private key. Public key is basically used for encrypting the data, and private key will be used for decrypting the data. So every user application will have their own private key. With the help of this, they will decrypt the data, whatever is sent by the server, public key and private key, or used in a combination to encrypt and decrypt the message respectively. Now, here is the comparison between symmetrical encryption and asymmetrical encryption. In symmetrical encryption, the encryption will happen with the help of single key, that is, the server. And the client will make use of the single key in order to authenticate and then establish the communication channel. But here in the case of asymmetric encryption, it is making use of keeping that is private and the public key, we will learn in our next slide how this SSH key pair works in real time. This provides confidentiality, but here in the asymmetrical encryption, this provides the confidentiality, authenticity as well as non-repudiation, please, a few other algorithms with the help office does symmetrical encryption key could be generated and those are asymmetrical encryption methods. These are not the only one. There could be many, and there could be many more added in future as well. Now, let's see in brief how these SSH works in real time. So there is the computer over here client, it could be your FTP client machine like the FileZilla or the WinSCP. And that could be a server like Oracle Cloud, or it could be any other server which will authenticate based on this SSH. Now first, the public key will be generated and it will be attached over here in the server, as well as it could be shared with the clients. So there are four steps involved here in order to establish the SSH communication channel. So in the first step, the client will share the public key to the server, the server. It will store this public key in its own database. Or database could differ. It could be relational or any other thing, but it will store in some format in the server, server, it will identify this public key and check whether that server is having this public key when it finds that it is intended for this server only, the public key matches. Then what it does is it will try to encrypt a message with the help of this public key, and it will send the message back to the client. Now, when it sends the message back to the client, the client will decrypt the message with the help of private key. This client will be assigned with a private key like this. There will be n number of clients, which we'll talk with the server. So this is some data on the client which was designed with the private key. It will decrypt the message which was encrypted by the server. After decryption, it will generate the hash value. In other words, in some of the cases, this is referred to as a session key as well. So once the hash is generated, what it does is it will send the message or the value of the hash back to the server. What this server will do is the message, what it had sent in the previous. That is step two, it will make use of that message and it will generate its own hash. After generating the hash, it will compare the hash value generated for that particular message with the hash value sent from the computer or the client. Once it identifies that both the hash values are same, then it will authenticate and it will send back the authentication token back to this client machine. So as you see, next, communication is established. That is, the tunnel is established between the client and the server so that they communicate openly over this channel. Now this client can make use of server for a number of cases, which we'll learn in our next side. So after the connection is established, the client can access the file. Again, this will depend upon the permissions. Now, let us for simplicity, assume that our client is having access to everything on that server so it can carry out the file operations like the FTP file transfer protocol with the help of, as I said, it can carry out the CLI things. That is the command line interface execution of commands. It can remotely login to any of the VMs. It can do a number of operations in that particular server. Now the question will arise how we can generate the SSH keys. So there are SSH client is available across the operating systems. Here are covered only desktop. There could be many more OS's or the mobile OS's for assistance clients are available, come into Mac and Linux operating system. They have built-in terminal with support SSH. But when it comes to the Windows OS, we don't have this SSH client build into command prompt, but we can make use of *** tea or WSL, that is Windows Subsystem for Linux. If you're using any other operating system, then you please check your operating system layer of the manual. Like what are the SSS clients available for that particular operating systems? Now, what are the best practices available for key management? Again, everything is having pros and cons. This is the cone attached with the SSH keys in order to overcome security breach associated with SSH keys. So these are the best practices which we need to follow as an organization. We need to have the visibility or the keys, like whatever keys we generate, we should have proper visibility like where we store those keys in our server and to whom we are sharing. It is a good practice that is to rotate the keys periodically, like once in a two or three months, we change our public private key. Whenever we change those things we do to our clients are the applications that we are attaining the keys. We must share those keys after rotation to our clients so that they can update in their system so that the communication doesn't break in that production environments. Also, we should regularly audit and enforce the policies, as I told in the step one, where we place those keys in the server and also with whom we share those keys. Also, we need to make sure we named the keys properly so that we will know for what purpose we have generated those SSH keys in real or the actual use case, we will have n number of public-private keys generated. Also, we can control the access with the help of permissions only so and so person will be able to access the keys which are stored in the server as well as on the client side as well. We must always avoid during these keys as a plain text file on our client machine, we should always make sure our client machine is not accessible to anyone and we keep our SSH File Save. So we have studied in brief, what is SSH and how does the SSH works? What are the pros and cons of SSS? In our next class, we will learn how we can generate SSH key that is private and public key also will learn the various methods, how we can generate those keys in Windows operating system as well as on Linux. 3. 3.1 Generate SSH key pair with WSL (Windows Subsystem for Linux) in Windows OS: In class, we are going to learn how to generate SSH keys, private and public key with the help of WSL that these windows Subsystem for Linux on our Windows computer. I'm currently making use of Windows 11 operating system on my desktop. The prerequisite for this is you need to have a WSL units distro or here in store. I'm currently making use of urban to destroy for Windows 11. So you can download that distro from Microsoft Store. This is the distro, what I'm making use of currently. After installing that is true. If you are facing any issue, just make sure you turn on WSL in order to turn on the settings to your Windows settings, just search for it on and off. You will see this option that is turned Windows features on or off people on this. If you are unable to see that option, just be how to search for the Windows feature. Then from that, you can navigate to turn Windows features on or off. So here if you scroll down, there is something called as Windows Subsystem for Linux, just make sure this is checked and click on. Okay. Now let's proceed with our class to create SSH keys. Here is the documentation by Oracle on how to create the SSH keys. We can create the key with the help of SSH command from our Linux terminal directly for each and every argument which we are going to make use of in this kitchen, Oracle has documented what is transform. We will learn one-by-one. We can do in a stretch everything out. We can just add only SSH key then in our terminal and we can run the commands in bits and pieces. So we're going to do the same. That is, we are going to run that amount in bits and pieces. We're not going to do the entire command at once. So it's your choice, whatever you want to follow the approach. Now let me open the terminal, the command SSH hyphen Qi Jin space. Now let's see what is the command? It is minus t. That is the type which we are going to generate this key or the algorithm we are going to make use of Odyssey. In our previous class, we had seen what are the various standards? Are the algorithms available in order to generate this SSH keys? Here in detail, it is mentioned that I'm going to make use of RSA algorithm. If you want to use any other type, we can make use of that as well. If you want to enter the vast phase, we can do that. One more thing. What we are going to add is our key is or how many bits. For security purpose, you can increase the number of bits so that you can make the key stronger. So the minimum is 2048. We will make 4096. Let me open the terminal minus b. Within the brackets we are to read 4096 and click on Enter. Now it is asking for where we have to store the side. By default, the path will be under form. This will be your virtual machine or the username SSH. And then the ID underscore, as I say, if you want to chain this part, we can do that as well. Now, let's see whether we already have this data set in our home learning folder. We are going to make use of Windows Explorer in order to check the files. Also, we can use the CLI as well. On this terminal, we can navigate to that particular directory and use the ls command. But as we are running this WSL, we have the advantage of making use of Windows Explorer. I will show you how we can make use of Windows Explorer and check the directories of Linux distro. If you open the windows Explorer on the left side, you will find distros which are available on your Windows computer. Currently I'm having only in Linux that is open to 22 dot 0 for, if you are having n number of Linux distros in, it will list over here based on the version and destroy name. As we're going to store this public and private key in dot SSH. We will navigate to the same folder, go to whom were to learning. As we don't have dot SSH, we're going to keep it as is, and click on Enter if you want to change, we can change as well. It is asking for the passphrase. This is required in order to protect the private key. We can make the security is stronger so that whoever is having the access for the private key, they should know the passphrase as well. So this will increase the security layer. As of now I just clicking on Enter because I don't want to enter any passwords if you want to do, you can do it all here. It is asking again, just I'm getting on Enter. So it has generated the SSH keys. Now let's verify whether it has generated the keys in the folder. Let us go to this Windows Explorer. Click on refresh. It escalated dot SSH folder over here. Enter this. We are having two folders over here. One is the private key and public key. So that block B key will have the extension. Let's see what is the extension it has created all the properties. It is having dark BOB extension that is public buy-in. For the private it is, it will not have any extension. It will straight away how the name that is idea. And as for RSA, whatever we have mentioned while creating the SSH key, that is not SSS ID underscore RC. Now we can place this public key in our servers so that we can SSH into there. Apparently, if you want to have any key commands that is in order to uniquely identify key, then you can make use of this command as well as we have entered t, that is type and the build information, we can add the comment as well, creating that. We have not added that. But if you want, you can add, because in real life scenario, we will work with a number of SSH keys so that it will make their life easy for the person who is handling or managing those keys. 4. 3.2 Generate SSH key pair with PUTTYgen application in Windows OS: In this class, we are going to learn how to generate SSH key pairs, that is private and public key on a Windows computer with the help of deejaying application. I'll open that to teach in application audio. In order to open the application, you are to just search for P on your Windows computer. You will have this application already installed. I'm currently making use of Windows 11 operating system. If you don't find this application, then you can download this from the public website. So in my case, this application is already available. So when you launch this application, you will see such kind of screen. So first thing is we need to select the parameters over here. I'm keeping the default that is RSA. In our previous class, we had seen how we can generate SSH key pairs from our Linux terminal. We had made use of WSL on our Windows computer. Same will be applicable for Linux machines as well. If you're not watched that video, please check out the video. First thing is we need to select the algorithm, selected RSA. We can select any other algorithm as well. And next thing is number of bits. I will make this S 4096. Default will be 2048. As you increase the number of bits, it will increase the security as more number of bits will be earlier. But in order to encode and create the keys, once you populate those details, we need to become this Generate button over here. Once you click on Generate, it will take some time. So we'll pause this video for a couple of seconds and we'll resume once or PuTTYgen application genders the files for us. We'll put D as gender did the keys for us. If you see over here, it has having the fingerprint, the key command. If you want the gender command, we can change this as well as we had seen in our previous class. These comments are used to identify the key uniquely. So if you want, we can change and getting this default next to it is asking for the key phrase. This key phrase is used for private key security. In order to enhance the security of the private key, we can add the passphrase also, we can confirm once we have populate the pathways as well. I'm not populating any passphrase over here. Suppose, if we want to connect to any specific Cloud services, like AWS or Oracle's Cloud services. Particular resource on that particular platform might require you to have the passphrase for the private key at that time, you have to populate this for this demonstration, we are not considering this use case. In order to sell the private key and the public lives, we need to click on this self private key. First, we are going to save them private key. And clicking on, as I will be storing this fine in downloads folder. As you see, the extension is P, P K format. This dot py PKA is exclusively for put t private key files. This will be used only for connecting from here, I'm naming this as a primate. If you want, you can name this with document as well. Whatever we have the commenter here, we can add it on here. So it's always a best practice to save the file with the command click on Save. We can say that public key. I will name this as bubbly. The concept. Suppose if you want to seal the primary key in OpenSSH formats, if your requirement is to generate the private key in OpenSSH format, then first thing is we can copy this entire text, whatever is visible over here, and paste it into notepad. Just select All and click on Copy and Paste in an odd pregnancy. So it will save in the open SSH format. This is the public key. In order to generate this private key, go-to conversations and click on Export open SSH key. Here it will run for, are you sure you are not populate the passphrase began as c in the open SSH format. Let me name this as private E, open SSS, click on Save. This will save the file in OpenSSH format. In this class, we had seen how we can generate the SSH keys, that is private and public key with the help of PuTTYgen application from our Windows machine. 5. 3.4 Generate SSH key pair with Command Prompt in Windows OS: In this class, we are going to learn how to generate SSH key bits, that is public key and a private key with the help of command prompt on a Windows computer. In our previous classes, we had seen how we can generate SSH keys with the help of Linux terminal. We had made use of Ubuntu distro on our WSL on Windows computer in order to demonstrate the use case. Also, we had seen how we can generate SSH keys with the help of an application which comes out of the block with Windows operating system. If you're not one of those classes, please check out those classes before proceeding with this class. In order to generate the SSH keys with the help of command prompt, first thing we need to make sure it's open. Ssh client is enabled. We need to go to settings. So let me click on the Settings app. From the settings we need to click on these applications. So the navigation might vary in our case, for this, we need to click on this optional features. Just scroll down and check whether open SSH client is available on your computer. If you are not installed this OpenSSH claim, then you can install this feature as well. So let me close this application. Next thing is we need to go to search, search for CMV, that is Command Prompt. Right-click on this and click on Run as administrator. If you get a prompt, click on S. Now we need to run the command like what we had seen in our previous classes. That is, with the help of this command, I'm making use of Oracle's documentation on how to generate SSH. Here, I'm writing the command that as I said, minus key gen space. We need to select the type of algorithm with which we are going to generate the key. And I'm making use of RSA. There are lots of algorithms available to gender. The SSH keys, RSS is the default one, and then c is the number of bits. I'm increasing the security of the key by increasing the width size to 4096. Default is 2048. If you run only SSH hyphen antigen, it will consider RSA as the type 102048 bit size. Apparently, if you want to add any comments in order to uniquely identify your key, you can add as well. I'm clicking on Enter. So it is in generating your public and private key pair list, it will tell the location where it will install the SSH heat. In my case, it will be users and the username dot SSH folder, it will create an ID underscore. Rsa will be our primary key. Also, it was going to create one more key that is ID underscore RSA public key with the.edu extension. I'm keeping this default as I don't want to change the directory. If you wanted to change again, the part over here, click on Enter. So it is asking for the past phase, and this is used for encrypting private key with the password. This will enhance the security of the private key. Suppose if your computer is accessed by lots of people and they come across your private key, then they must know the passphrase as well in order to SSH into any x hours, I'm keeping this empty and clicking on inter, if you want to populate a needle than just provide the password and click on Enter, you will get another pump saying enter the same password again, if you're entered the past phase in reverse step, you need to provide the same over here, and you need to remember this passphrase until you don't change your keys. Click on Enter. It has generated the keys for us. Let us know verify installed in users, the name and the dot SSH. Let's navigate to that folder. Doesn't know user's username. We have to search for the folder it has created today. I'm recording this class on 30th of August, ready to only do click on this. This has created two files. One is the private key. It is not having any extension, and you see the type. And the next one is the ID underscore Odyssey. This is the public key which will have.edu extension elastic in the properties. Sorry it is not PUB extension for public key like this, we can generate the SSH key pair that is private and the public key in OpenSSH format with the help of command prompt. This will make their life easy so that we don't have to install the Windows Subsystem for Linux and Linux distros on a Windows computer. Also, we don't want to have the mutagen application in store, so we can clear the SSH keys right from the command prompt. 6. 3.5 Generate SSH key pair with Linux terminal (Ubuntu) / Same for Mac OS as well: In this class, we are going to learn how to generate SSH keys that these private and public key with the help of Ubuntu or any other Linux distros. For this demonstration, I'm making use of Ubuntu, which is installed on my Oracle VirtualBox. If you haven't installed any Linux operating system as a standalone operating system on your computer, then that also will work similar, like what I'm showing over here. What's gel box? In order to generate SSH key, we have to get into the terminal. Just right-click on this home screen and click on this open interval. Let me increase the size of this window. Now we need to follow the same steps like what we used to do in our earlier classes. That is, we have to write this command. In this case, we're going to define this odyssey, that is, the algorithm which we are going to make use of in order to generate the necessity. And so we aren't mentioned how many bits we need in order to create this. Keith. If you just essence it's hidden, it will consider by default algorithm as RMSE and the number of bits is 2048. We can add this. It will ask in the consequences if we just use SSH keys. And so let me go to the terminal. Here. Let me SSH hyphen key then, and click on Enter. Asking entered the final image, you want to save the key. Here it is saying home slash learning dot id and c. Now let's verify if there is already dot SSH folder affiliated or not. Let me go to the files. So I'm here in the womb, but as of now, we don't have any note SSH file is created on the folders. Let me go back to the dominant because you want to check with the help of CLI, you can do by going to that folder manually with the help of cd command and then ls in order to check that did increase. As of now, I don't want within the directory in which it has to save the t, I'm taking one enter. It will ask to enter the past phase. As we had seen, this passphrase is used for private key so that it will increase the security of the key. Suppose if anyone is having access to those private key whenever you store, they must know passwords as in, in order to SSH into the servers. So this is to increase the security purpose. As of now, I'm leaving this empty, taking one and again it will ask, enter the password. Again. Suppose if you're entered the passwords in previous step, we need to use the same over here and then click on enter. In my case, I have not entered anything in the previous step, I'm teaching on entering in. As you can see, the files are being clear and nothing happened. Now let's go back to our directly and j. Now we could see that dot SSH folder has been created. If you open, we are having BOB, that is the public key and ID underscore RSA private key. Then we can push this to the server and we can SSH into that server with the help of those keys. This class, we learn how we can SSH into any server, in which case we are going to make use of this toolbox, as I said, one from Windows command prompt, we are going to SSH into this. So that is what your box. 7. 4 SSH authenticate / create secure communication channel between client and server: In this class, we are going to learn how we can SSH into any server from our client system. For demonstration purpose, I'm considering my Linux computer, which is set up in the VirtualBox in my computer, and a server and the WSL client, which we had installed in our previous class. That's my client which will SSH into the server. This clean, whatever you see, this icon that is 22 for this is that WSL Klein. And whatever you see with the terminal disease in the virtual box. This will be our server and this will be our claim. Let me maximize this in order to avoid any ambiguity. First of all, we need to install SSB over here in that arena. Here is the steps which are required in order to set up the SSH server in our VirtualBox or Ubuntu system. Before installing any software, we need to just prevent the sudo apt update. So let's run this here. Just copy and paste. I'm going to provide all the commands in the block associated with this class. Please take on that blog in order to get the set of all the commands, whichever I'm going to make use of in this class. This has imported all the packages. Now let's take what is the next command, sudo apt upgrade if you want, you can do, I'm running the latest version off. We're going to write not in my computer. Next statement is we need to install the essence is B, that is OpenSSL server. Let me copy this command from here so that it can import all the packages for this OpenSSL server. To my dominant. Let me clear this window, right-click and paste and enter. It will prompt you to get your input that needs to continue or not. And getting light and clicking on Enter so that it can import the packages necessary for OpenSSL installed all the packages. Now let's check what is the next step. We can verify whether when necessary, so what is happening or not. Let me copy this. Paste it down here, click on Enter. So we aren't getting it started. Openbsd Secure Shell knowledge check What is the next step? So this is optional if it is not running, we can just enable and we can start the SSH. Now we need to open the port 22, that is the TCP port, so that we can SSH into this server. I'm going to run this command in order to allow the SSH, it will open the port 22. Got updated. Next is we need to enable u fw, copy this and paste it over here. Click on enter, active and startup. Now let's take the status with this command here and click on Enter, saying it is accepting or the port is open for TCP port 22. Now we can SSH into this server. We are going to make use of WSL client from this, which is on our host computer, that is Windows ten. Before starting, we have to make sure we have the public key installed on here. This is the shared folder with the help of which I am going to share the files between the server and the host computer, that is Windows. So this might differ in your case. If you want to SSH into the server, you have to make use of that SDP copy command in order to push the file from your client to the server, server to the client, vice versa. So in my case, what I've done is, I hope not SSH file from here, and I'll pop it into my client. In my case, my client is the host computer that is Windows because my server is running in our toolbox within the same day. So we can access this WSL files from within the File Explorer. In event then you can access WSL file on the Network tab. But if you're using Windows ten, then you can derive this w as a dollar symbol. It will open the File Explorer for your Ws and client. In order to SSH into this Virtual Box server which we have created, we need to get the IP address. Let me check the IP address for this, it is 192 dot one dot one dot six. Let me copy this. This is essential when we SSH into any server. Now let us switch over to our lovely circling, which is over here. And here let me write the command. This is the username. Loved me, I did it. Thank you. Gone into this asking for the password. So we need to enter the password or phone VirtualBox machine, the term giving a talk here. Now if you see it is logged into a virtual machine. Now let's see what an all folders are available with the ls command so that we are having the extra documents, music, pictures, and all. Now let's create one folder over here on the side. Let me go to the home. Let me go to new file or the folder over here. This is me testing him, Liam. Go back to our WSL. So here let me get into this pitchers. Let me give this Ls infancy again, having the folder which we created in our server. Like this. We can SSH into the server from the client machine. Now, let's see how we can avoid that password. Like when we SSH into the server, it has prompted us to enter the password as we are using private key, which you don't get the prompt to enter the password. So let's see how we can avoid that. In order to do that first, we need to provide the access to the private key. So we can run this command from the terminal of your client that is over here, which will provide the access to those two files on your computer. So next step is we need to copy this SSH copy ID that is in order to configure a server, that is to use the private key whenever SSH into this IP address. Now, go to this client and click on Enter. And I've already done this. So you'd have added the key first term menu. Try to do this, you will get a prompt to enter the password. Just enter the password and that it didn't ask because I'm running this command for the second time. But in your case, for the first time, it will ask the password of your server. That is, in our case, it is the virtual box. So we need to enter that all here, triggered upon. Now next step is we need to use the SSH command that needs to get into this server. For that we use the normal command, but this time we should get the prompt to enter the password. Pick on it. As you can see, we have logged into the server with this command directly. We didn't get the prompt to enter the password. If I try to check the folders within the server that we'll see these Ls until we get to pictures and check the folders. What we had created that is dummy text via like this, we can SSH into the server with the help of password as well as with the help of private key, in which case we can bypass the password authentication. This is how the mechanism works. I'm provides the channel or the communication channel so that the client and the server can communicate securely over the internet. 8. Congratulations: You would like to congratulate you on completing this course successfully. And we would like to thank you for enrolling to this course. We hope you have learned something new with this course and you are now comfortable in understanding the concepts of SSH. How we can gender the SSH key pair, how we can SSH into any server from the client. This was just the basic, that is tip of the iceberg. So there is a lot of concepts involved in the SSH. This is just a beginner's guide so that you'll get comfortable working with, as I said, at the beginning stage of your project, we would like to get feedback from you. Please let us know how we can improve the content of this course. If you want to have any suggestion on our teaching style or the course content creation stuff, please do share your feedback so that we can work on those feedbacks and bring quality contents to you in the future. We would like to thank you once again and wish you Happy learning all the very best in your professional career for any organs. And you may write us to be num dot abs at the rate gmail.com.