Prepare Username and Password Lists
In this step, you will create two essential files: a username list and a password list. These lists will be used by Hydra to attempt SSH logins. Creating these lists allows you to systematically test various username and password combinations against your target.
First, open your terminal. You are currently in the /home/labex/project directory (also accessible as ~/project). You will create the files in this directory.
Use the nano text editor to create a file named usernames.txt:
nano ~/project/usernames.txt
Now, add the following usernames to the file. These are examples; you can customize them as needed.
root
admin
test
user
ubuntu
After adding the content, save the file by pressing Ctrl + O, then press Enter to confirm the filename, and finally press Ctrl + X to exit nano.
Next, you will create the password list. Again, use nano to create a file named passwords.txt:
nano ~/project/passwords.txt
Add the following passwords to the file. Remember, these are just examples.
password
123456
qwerty
secret
ubuntu
Save the file by pressing Ctrl + O, then press Enter to confirm the filename, and finally press Ctrl + X to exit nano.
To verify that the files have been created correctly, you can use the cat command to display their contents.
Display the content of usernames.txt:
cat ~/project/usernames.txt
You should see output similar to this:
root
admin
test
user
ubuntu
Similarly, display the content of passwords.txt:
cat ~/project/passwords.txt
You should see output similar to this:
password
123456
qwerty
secret
ubuntu
These files, usernames.txt and passwords.txt, are now ready to be used with Hydra in the subsequent steps.