Instructor: In this video,
we will learn how we could access our Linux machine
through the Putty client or through the SSH command line.
All right, the first way of doing it,
if you have downloaded and installed Putty client
then you want to connect to a Linux machine,
all you need is an IP address of your Linux machine
and you'll be able to connect.
Now, as I said earlier in the last video as well,
if you're using a newer version of Windows 10 or newer,
then you don't need Putty client.
All you need to open up your command prompt
and then simply type, "SSH space,
the IP address of your Linux machine."
Or you could also do "SSH space -L."
L is the option to use specify the username
and then followed by the IP address.
All right, the first method we will use
is to connect to a Linux machine using the Putty.
So, what we are exactly doing,
we are gonna open up our Putty software
on our Windows machine,
and we're gonna connect it to our Linux machine.
Now, of course, in order to connect, what do I need?
I need the IP address of this Linux machine,
so I could plug it in here.
Now how do I get the IP address?
Very good question.
In order to get an IP address,
you have to run a command on the command line,
and the command is ifconfg.
Now, before we go any further, an important message,
the newer version of CentOS
might not have the command ifconfg.
Please use IP a command,
if you are on a newer version of Red Hat or CentOS system.
If you wanted to use ifconfig in the 7.5
or later version of CentOS or RHEL,
then you could install the tools by running
the "Yum install net-tools" commands as root.
So in order to get to the console,
we'll go first to our Oracle virtual box manager right here
and look for the machine that we have created,
installed CentOS, which was right here.
I have already started it up, okay, so it's up and running.
Let's minimize it, and let's go to our machine.
Here is my machine.
When you log in through the console, you'll see all the GUI.
Now, on the version seven with the GUI,
you'll right click on the desktop and open terminal.
Same thing with version eight as well,
but if you're using version nine,
then you could go to the application on the side
and look for the terminal.
All right, so right here you have a terminal,
the blinking cursor right here.
In order to get the IP address of this Linux machine,
you run the command ifconfig and hit Enter.
So in my case, the ifconfig command worked,
so I don't have to run the IP space addr command.
You could run that command again
as well, if you want, ip addr,
which will give you the same information,
which gives you all the interfaces that you have.
Anyway, let's not get ahead of ourself again,
let's try ifconfig command again,
and it will output on the screen right here when you run it.
Here is your first interface, ENP 0S3.
Here's your local interface.
You could ignore this one.
The third one is your virtual adapt interface.
You could ignore this one as well.
Our focus is this interface, ENP 0S3.
The IP address that you're looking for is right here,
10.253.1.22.
In your case, the IP address might be different.
You might see 10, sorry, 192.168.1.X or whatever the IP,
but it depends which router
or which ISP network routers that you're using.
My router is Linux, so my IP starts with 10.
Anyway, once you have that IP,
then you open up your terminal, sorry, get out of here
and go to your windows and type Putty right here.
And this will open up your Putty.
And right here in the Putty, I want you
to type it in the IP address of the machine
of your Linux machine that we just picked right here, okay?
10.253.1.12 and simply click open here.
You'll get the message,
the host key is not cash for this server.
You have no guarantee that servers is the computer
you think it is?
That's fine, you could just click Accept.
It's just a warning sign.
Now here you have a login.
Now login is the same login, username
and password that you need to log in,
that you would use login here.
So if you could log in as your own self,
which is iofuel for me and the password
that I created during the installation.
Bingo, here you go, I am logged in.
And this is the command line of this Linux machine.
This Linux machine is the GUI access.
This Linux machine is the command line access.
Okay, so now we will access our Linux machine
or SSH command that is available
to us on Windows command line.
So here's a Windows command prompt,
and we will be able to connect to Linux,
but of course in this way,
we will need the IP address as well.
So we'll go open up a search bar
and type it in CMD and hit Enter.
And this is the command prompt or Windows.
So we will use SSH minus L,
but first type SSH, and hit Enter.
And make sure you get this message right here
with all the options, which shows that SSH is installed.
And here are the different options to use SSH.
Alright, so if you do get all that message,
then all you have to do is type SSH minus L,
then the username
that you have created on your Linux machine,
and then the IP address of your Linux,
which we already found out by running the ifconfg command.
And that is 10.253.1.22.
And then you simply hit Enter
and it will prompt you for a username and password
and you'll be able to connect to your Linux machine.
There is no need to run a Putty client.