Hey, welcome back to this
video.
So in this video we are going to see how you can
perform SSH now SSH is
used to do a remote
login into another host device or
in simple words another Linux operating
system.
Alright, so, let's see how to do it. So in this
lesson we are going to perform three different ways
to do SSH. So let's
quickly begin with now as you
can see on the screen. This is my OS number
one or host one, which is the Mac OS
and I also have my second
OS which is the host to
which is the parrot OS perfect. So
now I'm going to log in into my
parrot OS which is this operating system from my
host one, which is the Mac
operating system.
Now let me quickly see the
IP address of this device to home which
we are going to log in and you can see the IP was
192.168.0.69.
Now to login into the Remote device
we are going to use the command which is
SSH and the IP address of
the remote host which is the host 2 in
our case, which is our parrot operating system.
now once we give the IP address
we simply need to hit enter and you
can see it will by default give Rohit
at the rate the IP address and it
is asking for a password prompt now
it is by default trying us to
login into the default user, which is Rohit now.
Once I give the correct password, I will be
able to successfully log in into the operating system
as you can see Rohit at the rate parrot and
I'm successfully logged in into the
remote OS and I can control the whole operating system
from here perfect. Now, let me simply exit
from here which is basically logout and
the connection gets closed. So we have seen
the first way which was simply SSH and
the IP address of the remote host now.
In case you need to log in through
a specific user only in our first
case it was Rohit but let's say I want
to login using a admin user. So for
that you can simply specify the name of
the user add the rate the IP address
of the remote host. So as you can see SSH admin
at the rate IP address of the remote host
where we want to login just specify the
password and you will be able to login into
the remote machine as you can
see I have successfully logged in.
Now I have typed the command which is who am I
to confirm and you can see the user which
has successfully logged in is admin perfect.
So this was our second way to do SSH using
a username now, let
us see the third way in which we are
going to SSH into the remote host using the
default port number.
Now we always know that SSH uses the
default Port which is Port 22, which
you can specify using the
flag - P which stands for
the port number and the port number is 22 now.
I will simply hit enter and it
will ask me for a password prompt and I
will specify the password.
And you can see a high successfully logged in into the machine now. Let
us do one thing. Let's try to
change the port number.
This is basically your configuration which is done many
times spices admins wherein they do not
want some random persons to try to do
SSH login.
That is the main reason they most of
the times change the port numbers of these services
like SSH so by default no
other random people are trying to Brute Force
the SSH logins.
So, let's see how to change the port number. It is
through the SSH configuration file. So Nano
slash Etc slash SSH slash
sshdconfig and
here you can see I have modified the port number
and I have written it as Port 69 and
I'm just going to save the file. Now. Remember
once you have modified the configuration file
you need to restart the SSH service.
For which the command is surface SSH restart?
Once we do that our SSH changes
gets replicated into the system. Now, let's
quickly see the status of the
service if it is running fine and our changes
have been modified or reflected or known. So
let us just confirm that the SSH server
has started on Port 69 or
no, or is it still running on 22?
So just hit status and you can see it is
active running and the new port number is 69 as
we can see over here. Perfect now our
SSH server has configured correctly on
our new Port. So now let's try to log in again.
But this time when we try to log in
into the port 22, you can see we get a error
which says connection refused because we know that
SSH is not running on the default
Port which is 22 now does it
says connection refuse the port is not accepting
any connections and we know that we
have just now modified the port number
and the new port number is six nine. So let
us try to connect on to our new Port that is
69 and hit enter and you can see it immediately
gave a prompt to give the password when
the user gives the right password. He is able
to successfully log in and you can see who am I
say is the user which is currently logged in
is admin.
So I hope you guys understood how you can
do SSH to the host. You can
do SSH using the second method that was
using the name of the host and the Third
Way was using the port number in case the
SSH service is not running on the default
Port. I hope you guys understood. Thank you.