INTE2625 Week 2 Lab Manual
INTE2625 Week 2 Lab Manual
Classifi
cation:
INTE2625 Introduction to Cyber Truste Security
Week 2 Lab Manual d
Objectives
In this Lab, you are going to learn some of the basics of Kali Linux operating system. You will
find step-by-step instructions to perform several basic operations.
At the end of the Lab, we will learn the followings:
An overview of the File System of Kali Linux
Accessing directories
Creating a user in Kali Linux
In this lab, we will use the Kali Linux Operating System. We will learn some basic file and
directory manipulation commands for the Kali Linux in the command terminal, so that we
can use the command terminal in future labs in this course.
In Kali Linux, most of the operations are performed on files. To handle these files, Kali
Linux has directories (also known as folders) which are maintained in a tree-like structure.
Kali Linux has 3 basic types of files:
Regular Files: It is the common file type in Linux. It includes files like – text files,
images, binary files, etc.
Directories:
o Same as folders in Windows Operating system. These are the files that store
the list of file names and the related information.
o The root directory, represented as ‘/’, is the base of the system,
o /home/ is the default location for user’s home directories, /bin for Essential
User Binaries, /boot – Static Boot Files, etc.
Special Files: Represents a real physical device such as a printer which is used for
IO operations.
Page 1 of 10
RMIT
Classifi
cation:
Truste
d
Log in to Kali Linux using default username kali and its default password kali in the
following login screen:
Page 2 of 10
RMIT
Classifi
cation:
Truste
d
After the successful log in, you should see the root directory of Kali
Linux:
Terminal: The terminal is the primary tool for interacting with the file system. You
need to type your necessary command and press Enter to execute the command.
Open a terminal window. Click the Applications icon on the top-left corner:
Page 3 of 10
RMIT
Classifi
cation:
Truste
Open the Terminal Emulator.
d
You should see the Terminal window as follows (or something similar):
Understanding the prompt: The terminal prompt typically displays your username
and current directory. For example:
Kali@kali:~$
Kali: Your username in Kali Linux.
kali: The hostname of your system.
~: This symbol represents your home directory.
$: This symbol indicates a regular user prompt.
You will have to type the necessary command after the $symbol in the Terminal.
The path “/home/kali” indicates the home directory of the user Kali. Hence, the home
directory of a user is “/home/username”. For example, if we have a user called “Alice”, the
home directory of Alice would be “/home/Alice”. As discussed above, the home directory
can also be denoted as ‘~’.
Page 4 of 10
RMIT
Classifi
cation:
Check the current working directory
Truste
d
Type the pwd command in the Terminal as follows to print your current
working directory:
We can see that there are eight sub-directories under the current directory.
Type the cd command followed by the directory name to change directories. For example, if
you want to change the current directory from ‘/home/kali’ to ‘/home/kali/Desktop’, type
the following command in the terminal:
Page 5 of 10
RMIT
Classifi
cation:
Truste
You are now in the ‘/home/kali/Desktop’ or ‘~/Desktop’ directory and should see
d
the following:
Use “cd ..” command to go back one level in the directory structure.
Page 6 of 10
RMIT
Classifi
cation:
Task-2: Creating a User in KaliTruste Linux
In this task, we will create a user “Alice” d perform some user management task
such as assigning password, log in and log out.
Note: You might require administrative privileges (use sudo) for this task depending on your
Kali Linux configuration. You also need to use su command to switch user. Therefore, you
need to understand “sudo su” commands.
sudo su combines two separate commands in Linux: sudo and su. Here's a breakdown of
what each does and what sudo su achieves:
sudo: Stands for "superuser do" and allows you to execute a single command with
the privileges of another user, typically the root user (administrator). It prompts you
for your password to verify you're authorized to use these elevated privileges.
su: Stands for "switch user" and lets you change your current user account to
another one. By default, if you simply use su, it attempts to switch you to the root
user. However, it will prompt you for the root password, which is generally not
recommended to have readily available for security reasons.
sudo su essentially lets you run the su command with elevated privileges using sudo.
This means you can switch to the root user without needing the actual root
password, as long as your user account is authorized to use sudo.
Once you hit Enter key, you will see that the user is being added to a user group with some
ID number. Here, the group Id is ‘1003’. You may see different value at your end.
Next, you will be asked to provide password and reconfirm it. Please note that you will not
see any characters while you type passwords due to security reason. It’s absolutely fine.
Once you type passwords, you will be asked to provide: Full Name, Room Number, Work
Phone, Home Phone, and Other. You may provide only the Full Name as “Alice”.
Type ‘Y’ to confirm if the information you have provided is correct. Type ‘n’ otherwise.
Page 7 of 10
RMIT
Classifi
cation:
You should see the following:
Truste
d
To check if the user “alice” has been created or not, type the following command:
If the user ‘alice’ has been created successfully, you should see the following information:
You may also try the command cat /etc/passwd | grep alice to see the information:
Page 8 of 10
RMIT
Classifi
cation:
Truste
By default, all user information is stored in /etc/passwd file. The cat command shows
d
the content of the /etc/passwd file. The grep command finds the user alice in the
passwd file applying regular expression. The operator ‘|’ is called pipe operator that would
combine the output of commands ‘cat /etc/passwd’ and ‘grep alice’.
You will be asked to provide Administrative User’s password. If you are logged in as the
user Kali, you need to provide the password for that user. If you provide the password of
Administrative User (i.e., Kali) correctly, you will be asked to provide new password twice as
follows to complete the password change:
Assume that you are currently logged in as the user kali and now you want to switch user to
alice from the terminal. You have two options: 1) login as alice within the current session
(that is, the session of the current user kali) or 2) login as alice with a new session.
Use su - alice when you want to start a new shell session with the environment
settings and home directory of the user "alice."
Use su alice when you want to switch to the user "alice" within the current shell
session, without starting a new shell.
Page 9 of 10
RMIT
Classifi
cation:
Task-2.4: Logout from a user’s session in Terminal
Truste
d
Use exit command to log out from the current user session.
To delete a user in Kali Linux, you can use the userdel command followed by the username
of the user you want to delete. Additionally, you can use the userdel command with the -r
option to delete the user's home directory and mail spool along with the user account. The
mail spool is a directory that contains individual mail spool files for each user who has mail
waiting to be delivered or read.
Check if the user ‘alice’ has been deleted or not using the command id alice:
Page 10 of 10