Hey, welcome back to this video.
So in this video, we're going to see how you can perform a search.
Now, a search is used to do a remote login into another host device or, in simple words, another
Linux operating system.
All right.
So let's see how to do it.
So in this lesson, we are going to perform three different ways to do a search.
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 two, which is the pirate 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 one 92.1 60 8.0. 69.
Now to log in 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 to in our case, which is our parrot operating system.
Now, once we give the IP address, we simply need to hit enter and we can see it will by default give
route at the rate the IP address and it is asking for a password prompt.
Now it is by default trying as to login into the default user, which is Rohit.
Now.
Once I give the correct password, I will be able to successfully login into the operating system.
As you can see, Rohit added 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 log out and the connection gets closed.
So we have seen the first way, which was simply a search 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 log in using an 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 as a such admin, add the rate IP address of the remote host where we want to log
in, just specify the password and you will be able to log 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 as admin.
Perfect.
So this was our second way to do a search using a username.
Now let us see the third way in which we are going to search into the remote host using the default
port number.
Now we always know that search uses the default port, which is port 22, which you can specify using
the flag hyphen 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 I have successfully logged in into the machine.
Now let us do one thing.
Let's try to change the port number.
This is basically a configuration which is done many times by sysadmins wherein they do not want some
random persons to try to do a search 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 search logins.
So let's see how to change the port number.
It is through the ssh configuration file.
So nano slash etsy slash search slash search d config.
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 search changes get 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 no.
So let us just confirm that the search 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 set server has configured correctly on our new port.
So now let us try to log in again.
But this time when we try to log in into the port 22, you can see we get an error which is connection
refused because we know that SSH is not running on the default port, which is 22.
Now, does it say 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 onto our new port that is six nine 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 as admin.
So I hope you guys understood how you can do a search to the host.
You can do a search 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.