<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Enoch Amachundi Agbu</title>
    <description>The latest articles on Forem by Enoch Amachundi Agbu (@agbuenoch).</description>
    <link>https://forem.com/agbuenoch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3244359%2F19900dcf-dfbf-4f39-ad3e-8f0249618c54.jpeg</url>
      <title>Forem: Enoch Amachundi Agbu</title>
      <link>https://forem.com/agbuenoch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/agbuenoch"/>
    <language>en</language>
    <item>
      <title>Securing MariaDB Server</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Wed, 02 Jul 2025 11:01:18 +0000</pubDate>
      <link>https://forem.com/agbuenoch/securing-mariadb-server-1kkb</link>
      <guid>https://forem.com/agbuenoch/securing-mariadb-server-1kkb</guid>
      <description>&lt;p&gt;A step-by-step practical guide to creating secure user accounts, managing privileges, and enabling advanced audit logging in MariaDB Sever.&lt;/p&gt;

&lt;p&gt;In today’s threat landscape, databases are prime targets. Whether it’s an insider threat or an external breach attempt, controlling who can access your database and monitoring their actions is essential for any Cybersecurity Analyst.&lt;/p&gt;

&lt;p&gt;This project walks through a real-world simulation of how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create and manage users in MariaDB server.&lt;/li&gt;
&lt;li&gt;Apply the principle of least privilege.&lt;/li&gt;
&lt;li&gt;Restrict remote access to the MariaDB server.&lt;/li&gt;
&lt;li&gt;Enable advanced audit logging.&lt;/li&gt;
&lt;li&gt;Review and analyse logs for security incident detection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By combining proactive access control with reactive audit strategies, this project demonstrates how a cybersecurity analyst can secure critical systems and generate forensic-ready reports.&lt;/p&gt;

&lt;p&gt;Ensure the MariaDB Server is up and running. Read &lt;a href="https://www.linkedin.com/pulse/how-set-up-chinook-database-mariadb-server-using-linux-enoch-agbu-8cgff/" rel="noopener noreferrer"&gt;How to set up Chinook Database on MariaDB&lt;/a&gt; on how to start, stop, enable and disable the MariaDB server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setup and Import Chinook Database.
&lt;/h2&gt;

&lt;p&gt;If you have the MariaDB Server or MySQL Server already set up, you can skip to &lt;code&gt;Step 2&lt;/code&gt;; otherwise, read the article &lt;a href="https://www.linkedin.com/pulse/how-set-up-chinook-database-mariadb-server-using-linux-enoch-agbu-8cgff/" rel="noopener noreferrer"&gt;How to set up Chinook Database on MariaDB&lt;/a&gt; to implement the &lt;code&gt;Step 1&lt;/code&gt;, where you will install the MariaDB Server, download and import the Chinook database. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create Users and assign Permissions.
&lt;/h2&gt;

&lt;p&gt;The SQL statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW DATABASES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will display all the databases in the MariaDB server. The 1st arrow points to the &lt;code&gt;Database column&lt;/code&gt;, and within the column is the list of preinstalled databases that come with the MariaDB server, which hold important files and configuration settings.&lt;/p&gt;

&lt;p&gt;The following databases, &lt;code&gt;information_schema, mysql, performance_schema&lt;/code&gt; and &lt;code&gt;sys&lt;/code&gt; are all default databases that come pre-installed with the MariaDB server. They contain important files and configurations like user privileges related to the MariaDB server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3h8a55copjcxgrak944j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3h8a55copjcxgrak944j.png" alt="Image description" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 3: Log in to MariaDB.
&lt;/h2&gt;

&lt;p&gt;First, view the list of existing users who can access and manage the databases in the MariaDB server, but note that only users with root privileges can view the list. This will give the admin or root user an overview of the users currently authorised to access the MariaDB server.&lt;/p&gt;

&lt;p&gt;In the second command, we added authentication_strings to retrieve more detailed information as pointed to by the 2nd arrow. You can specify more columns, like the password that you wish to retrieve.&lt;/p&gt;

&lt;p&gt;The query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT User, Host FROM mysql.user;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will display all users, including any user you created. Notice we have a user called &lt;code&gt;root&lt;/code&gt; on the &lt;code&gt;localhost&lt;/code&gt; as pointed to by the 1st arrow.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx86a1685hxwf7j0w9r9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx86a1685hxwf7j0w9r9.png" alt="Image description" width="781" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that &lt;code&gt;mysql&lt;/code&gt; is the database name while &lt;code&gt;user&lt;/code&gt; is the table name found inside the &lt;code&gt;mysql database&lt;/code&gt;, hence the reason we used &lt;code&gt;mysql.user&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;You can switch back to the mysql database using the query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE mysql;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and view the tables in the mysql database using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW TABLES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT User, Host FROM user;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to display all the users. &lt;/p&gt;

&lt;p&gt;From the screenshot below, notice that we did not use &lt;code&gt;FROM mysql.user&lt;/code&gt; but just &lt;code&gt;FROM user&lt;/code&gt;, this is because we are currently inside the desired database &lt;code&gt;mysql&lt;/code&gt; as pointed by the 1st arrow and the 2nd arrow points to the user table inside the mysql database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqatu2ukr82innqk299fq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqatu2ukr82innqk299fq.png" alt="Image description" width="599" height="322"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 4: Create New User.
&lt;/h2&gt;

&lt;p&gt;The following commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE USER 'firstuser'@'localhost' IDENTIFIED by firstpassword;

CREATE USER 'seconduser'@'%' IDENTIFIED by secondpassword;

CREATE USER 'testinguser'@'%' IDENTIFIED by testingpassword;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will create new users and will be recognised by the password you provide.&lt;/p&gt;

&lt;p&gt;The query &lt;code&gt;CREATE USER&lt;/code&gt; will create a new user called &lt;code&gt;firstuser&lt;/code&gt; on the &lt;code&gt;localhost&lt;/code&gt; and assigned the password &lt;code&gt;firstpassword&lt;/code&gt;.  The same applies to others.&lt;/p&gt;

&lt;p&gt;These users are created for the &lt;code&gt;Chinook&lt;/code&gt; database ONLY, as you can see, it is the Chinook database that is currently mounted while creating the users.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbz8dmuxb9zae72tmhkw5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbz8dmuxb9zae72tmhkw5.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@’localhost'&lt;/code&gt; in the query &lt;code&gt;‘firstuser’@’localhost'&lt;/code&gt; means firstuser can only connect to the database from the local machine.&lt;br&gt;&lt;br&gt;
The &lt;code&gt;@’%’&lt;/code&gt; in the query &lt;code&gt;‘seconduser’@’%’&lt;/code&gt; will allow seconduser to connect to the database from ANY host/machine.&lt;/p&gt;

&lt;p&gt;Use the query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DROP USER 'testing'@'%';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to remove the &lt;code&gt;testinguser&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To verify if testinguser has been dropped, query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT User, Host, password FROM mysql.user;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 1st arrow points to the authorised users, but the &lt;code&gt;testinguser&lt;/code&gt; has been removed or dropped and deleted the user and all associated permissions. The 2nd arrow points to the columns in the user table we specified in the query. The 3rd arrow points to the hashed password for the remaining new users we created.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2pv88fn4ogj39mczlgz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2pv88fn4ogj39mczlgz.png" alt="Image description" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The string &lt;code&gt;*826954EC52E6900DB7AC23C8151ED1A5F8E85715&lt;/code&gt; is a hashed representation of the user's password, stored in an encrypted format for security. &lt;/p&gt;

&lt;p&gt;In MariaDB, passwords are hashed using algorithms like &lt;code&gt;SHA-1&lt;/code&gt; or &lt;code&gt;SHA-2&lt;/code&gt; before being saved in the &lt;code&gt;mysql.user&lt;/code&gt; table. This protects the actual password, ensuring that only the hash, which is computationally difficult to reverse, is stored. This approach enhances database security by keeping users' real passwords hidden.&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 5: Grant Permissions to the Users.
&lt;/h2&gt;

&lt;p&gt;We can grant specific privileges to users of specific databases.&lt;/p&gt;

&lt;p&gt;The  following queries&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON Chinook.* TO 'firstuser'@'localhost';

GRANT ALL PRIVILEGES ON *.* TO 'thirduser'@'localhost';

GRANT SELECT, INSERT, UPDATE ON Chinook.* TO 'seconduser'@'%';

FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will grant ALL privileges to the &lt;code&gt;firstuser&lt;/code&gt; for &lt;code&gt;ONLY&lt;/code&gt; the Chinook database as pointed to by the 1st arrow. The second query will grant ALL permissions to the thirduser for ALL databases in the MariaDB server as pointed to by the 2nd arrow. The &lt;code&gt;*.*&lt;/code&gt; means all databases in the MariaDB server. The third query grants limited permissions &lt;code&gt;(SELECT, INSERT, UPDATE)&lt;/code&gt; to the &lt;code&gt;seconduser&lt;/code&gt; for the Chinook database, pointed to by the 3rd arrow.&lt;/p&gt;

&lt;p&gt;The query &lt;code&gt;FLUSH PRIVILEGES&lt;/code&gt; will apply the changes made as pointed to by the 4th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8q81h1m2u9eeh0b3ck6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8q81h1m2u9eeh0b3ck6.png" alt="Image description" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can view users’ privileges in MariaDB by querying the &lt;code&gt;information_schema.user_privileges&lt;/code&gt; table. The query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM information_schema.user_privileges
WHERE GRANTEE = 'thirduser'@'localhost';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will show privileges assigned to the thirduser.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;information_schema&lt;/code&gt; is the database name and &lt;code&gt;user_privileges&lt;/code&gt; is the table name, hence the &lt;code&gt;information_schema.user_privileges&lt;/code&gt;. Feel free to mount the &lt;code&gt;information_schema&lt;/code&gt; database and view its tables and table columns.&lt;/p&gt;

&lt;p&gt;NOTE: The &lt;code&gt;user_privileges&lt;/code&gt; provides a &lt;code&gt;server-wide permission&lt;/code&gt; view and not a &lt;code&gt;database-specific permission&lt;/code&gt;. Therefore, the query above will output the global privileges assigned to users across the MariaDB server, not tied to any specific database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbydj46ypw1krqf0e65og.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbydj46ypw1krqf0e65og.png" alt="Image description" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or we could view all users' privileges in the MariaDB server like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM information_schema.user_privileges;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v22d1benuryz26qgpd2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v22d1benuryz26qgpd2.png" alt="Image description" width="800" height="240"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5101jpee43m6p80zo3vj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5101jpee43m6p80zo3vj.png" alt="Image description" width="800" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;GRANTEE&lt;/code&gt; column lists all the users.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;USAGE&lt;/code&gt; privilege means that the user has no specific or explicit privileges granted at the level being queried &lt;code&gt;(i.e. server-wide or global)&lt;/code&gt;, other than the ability to connect to the database. This is often seen when a new user is created but hasn’t been assigned any particular privileges like &lt;code&gt;SELECT, INSERT, UPDATE or ALL PRIVILEGES&lt;/code&gt;. The &lt;code&gt;USAGE&lt;/code&gt; privilege effectively allows login access without granting any permissions to interact with or modify database content as pointed to by the 1st arrow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice that we granted &lt;code&gt;ALL PRIVILEGES&lt;/code&gt; to the &lt;code&gt;firstuser&lt;/code&gt; for &lt;code&gt;Chinook&lt;/code&gt; database, but from the screenshot above under the &lt;code&gt;GRANTEE&lt;/code&gt;, the &lt;code&gt;‘firstuser’@’localhost&lt;/code&gt; privilege_type is showing &lt;code&gt;USAGE&lt;/code&gt;, this is because the firstuser have no explicit privileges granted for this level, which is for the entire databases or MariaDB server, it privileges were specifically for the Chinook database and not for all the databases (server-wide) in the MariaDB server. But the thirduser was granted ALL PRIVILEGES for all databases (server-wide) in the MariaDB server. If we want to view user privileges specific to a database, use the SCHEMA_PRIVILEGES table instead of the USER_PRIVILEGES table. This will be demonstrated shortly below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;IS_GRANTABLE&lt;/code&gt; column in the user_privileges table indicates whether a user can grant a specific privilege to other users, as pointed to by the 2nd arrow. If &lt;code&gt;IS_GRANTABLE&lt;/code&gt; is set to &lt;code&gt;YES&lt;/code&gt;, it means the user can grant that particular privilege to others as pointed to by 4th arrow. If it’s &lt;code&gt;NO&lt;/code&gt;, the user can use the privilege but cannot pass it on, as pointed to by the 3rd arrow.&lt;/p&gt;

&lt;p&gt;This is controlled by the &lt;code&gt;GRANT OPTION&lt;/code&gt; privilege in MariaDB, which allows a user to grant their privileges to others.&lt;/p&gt;

&lt;p&gt;Hence, from the output above, we can see that the &lt;code&gt;‘mysql’@’localhost'&lt;/code&gt; user can assign privileges to other users, meanwhile &lt;code&gt;‘thirduser’@’localhost'&lt;/code&gt; cannot because its &lt;code&gt;IS_GRATABLE&lt;/code&gt; value is &lt;code&gt;NO&lt;/code&gt; for each privilege.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;SCHEMA_PRIVILEGES&lt;/code&gt; and &lt;code&gt;USER_PRIVILEGES&lt;/code&gt; tables in &lt;code&gt;information_schema&lt;/code&gt; database serve different purposes.&lt;br&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;SCHEMA_PRIVILEGES&lt;/code&gt;: Contains privileges specific to individual databases (schemas). It details permissions granted to users or roles for operations on a database, including GRANTOR, PRIVILEGE_TYPE, and IS_GRANTABLE.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;USER_PRIVILEGES&lt;/code&gt;: Provides a broader view of global privileges assigned to users across the server, not tied to any specific database. It reflects permissions like SUPER, CREATE USER, or server-wide privileges.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use &lt;code&gt;SCHEMA_PRIVILEGES&lt;/code&gt; for database-specific queries and USER_PRIVILEGES for server-wide permission analysis. The term &lt;code&gt;SCHEMA&lt;/code&gt; is referred to as &lt;code&gt;DATABASE&lt;/code&gt;, therefore, &lt;code&gt;SCHEMA_PRIVILEGES&lt;/code&gt; means &lt;code&gt;database privileges&lt;/code&gt;. The query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * 
FROM information_schema.SCHEMA_PRIVILEGES
WHERE GRANTEE = 'firstuser'@'localhost' AND TABLE_SCHEMA = 'Chinook';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will return the &lt;code&gt;firstuser&lt;/code&gt; database privileges associated with the Chinook database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F109eggmzr0rol468tsiu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F109eggmzr0rol468tsiu.png" alt="Image description" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mount and explore the information_schema database.&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;SHOW DATABASES&lt;/code&gt; displays all databases in the MariaDB server. The 1st and 2nd arrows point to two important default or preinstalled databases that come with the MariaDB server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz22ufpdq15ylimicsm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqz22ufpdq15ylimicsm0.png" alt="Image description" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE information_schema;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will mount the database on the MariaDB server as pointed to by the 1st arrow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW TABLES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will display all the tables in the information_schema database as pointed to by the 2nd arrow. The 3rd arrow points to the USER_PRIVILEGES, which is one of many tables in the database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rhtllwds5sptnee67iu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rhtllwds5sptnee67iu.png" alt="Image description" width="696" height="313"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmaph9yf1iyz5uk1n8dl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmaph9yf1iyz5uk1n8dl5.png" alt="Image description" width="690" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Explore the other databases and their tables to see other MariaDB server files and configuration settings. For example, the &lt;code&gt;mysql&lt;/code&gt; database has tables like &lt;code&gt;user&lt;/code&gt;, and &lt;code&gt;db&lt;/code&gt; that you can explore. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;information_schema&lt;/code&gt; Database: This is a virtual database that provides metadata about the database server. It stores information about databases, tables, columns, data types, privileges, constraints, and other schema-related details. Tables in &lt;code&gt;information_schema&lt;/code&gt; database are dynamically generated views, not stored on disk.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mysql&lt;/code&gt; Database: This is a system database containing user accounts, privileges, roles, and other essential system configurations. It stores tables like &lt;code&gt;mysql.user&lt;/code&gt; for user accounts, mysql.db&lt;code&gt;for database privileges, and&lt;/code&gt;mysql.tables_priv` for table-level privileges, among others.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 6: Revoking Users' Permissions.
&lt;/h2&gt;

&lt;p&gt;Before we revoke the firstuser permissions, let's have a view of the firstuser permissions by querying&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM SCHEMA_PRIVILEGES&lt;br&gt;
WHERE GRANTEE = 'firstuser'@'localhost';&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
The 1st arrow points to the users column and 2nd arrow points to the privileges with the &lt;code&gt;SELECT&lt;/code&gt; privilege appearing first in the column.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtb8ijlhrzyiqdcc4ph9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtb8ijlhrzyiqdcc4ph9.png" alt="Image description" width="781" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The query &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
REVOKE SELECT ON Chinook.* FROM ‘firstuser’@'localhost';&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Will only revoke the &lt;code&gt;SELECT&lt;/code&gt; permission. As pointed out by the 2nd arrow, the &lt;code&gt;SELECT&lt;/code&gt; privilege is no longer available.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9o6bvemer91xihx6jpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft9o6bvemer91xihx6jpr.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Meanwhile, the query:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM firstuser@localhost;&lt;/p&gt;

&lt;p&gt;FLUSH PRIVILEGES;&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
will revoke all privileges that have been granted to the &lt;code&gt;firstuser&lt;/code&gt; on the &lt;code&gt;Chinook&lt;/code&gt; database. As pointed to by the 1st and 2nd arrow, the firstuser is not seen among the user list because all its privileges have been revoked.&lt;/p&gt;

&lt;p&gt;This ensures the user can no longer perform any actions like &lt;code&gt;SELECT, INSERT&lt;/code&gt;, etc., and cannot grant privileges to others.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmic2cjbqqooagygxygjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmic2cjbqqooagygxygjs.png" alt="Image description" width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;REVOKE&lt;/code&gt;: Is the SQL command used to take away privileges.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SELECT&lt;/code&gt;: Is the specific privilege being revoked.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ON Chinook.*&lt;/code&gt;: Targeting all tables (*) in the Chinook database.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;FROM firstuser@localhost&lt;/code&gt;: This specifies the user and host combination.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After revoking, it’s good practice to flush privileges so changes take effect &lt;code&gt;FLUSH PRIVILEGES&lt;/code&gt;;&lt;/p&gt;

&lt;p&gt;Let's grant all the privileges back to firstuser and then view all users' privileges to confirm it. Run the two sets of queries separately as shown in the screenshot.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
GRANT ALL PRIVILEGES ON Chinook.*&lt;br&gt;
TO firstuser@localhost;&lt;/p&gt;

&lt;p&gt;SELECT * FROM SCHEMA_PRIVILEGES;&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7flayueg9lon1bih8w08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7flayueg9lon1bih8w08.png" alt="Image description" width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As shown above, the &lt;code&gt;firstuser&lt;/code&gt; have been granted all privileges again.&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 7: Test the New Users.
&lt;/h2&gt;

&lt;p&gt;From the screenshot above in &lt;code&gt;STEP 3&lt;/code&gt;, we have assigned &lt;code&gt;ALL PRIVILEGES&lt;/code&gt; to &lt;code&gt;thirduser&lt;/code&gt; for all databases in the MariaDB server, so let's log out and log in as thirduser.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;exit&lt;/code&gt; or &lt;code&gt;EXIT&lt;/code&gt; will terminate the database console and return to the Linux console as pointed to by the 1st arrow. The command&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
sudo mariadb -u thirdsuer -p;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
will log in as the &lt;code&gt;thirduser&lt;/code&gt; after passing its password as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw81r5tsqj4yotqk9na6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw81r5tsqj4yotqk9na6j.png" alt="Image description" width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are logged in as the &lt;code&gt;thirduser&lt;/code&gt;. Since the &lt;code&gt;thirduser&lt;/code&gt; has &lt;code&gt;ALL PRIVILEGES&lt;/code&gt; with &lt;code&gt;server-wide&lt;/code&gt; or &lt;code&gt;global privileges scope&lt;/code&gt;, let's run a &lt;code&gt;SELECT&lt;/code&gt; command on the Chinook database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyywn8ivcjlqhbk5nb2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyywn8ivcjlqhbk5nb2u.png" alt="Image description" width="714" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything works fine as the &lt;code&gt;thirduser&lt;/code&gt; was able to log in and run queries as expected.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 8: Harden and Enable Logging for Detection &amp;amp; Analysis.
&lt;/h2&gt;

&lt;p&gt;Let's edit the &lt;code&gt;50-server.cnf&lt;/code&gt; file and configure any desired security settings of our choice. But let's first understand the contents of this file, and this is very important.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;50-server.cnf&lt;/code&gt; file or any MariaDB/MySQL config file, &lt;code&gt;settings&lt;/code&gt; are grouped under &lt;code&gt;sections&lt;/code&gt; as pointed to by the 1st, 2nd and 3rd arrow, each identified by a header in square brackets, like &lt;code&gt;[mysqld]&lt;/code&gt;. Each section applies to a specific component or version.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzx2ueigd9rqgsqz27ery.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzx2ueigd9rqgsqz27ery.png" alt="Image description" width="711" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a quick breakdown:&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;[server]&lt;/code&gt;: This applies to all server-type programs (e.g., mysqld, mysqld_safe, mariadbd, mongod etc.). It is used to apply or share generic settings across all server modes. It is often used as a global section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[mysqld]&lt;/code&gt;: This section applies only to the main MariaDB/MySQL server daemon (mysqld). It is where you typically define ports, data directory, logging, connection limits, SQL modes, and buffer sizes, among other settings. This is the most important section for database server behaviour, and in this project, this is where most of our configuration settings will be applied.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[embedded]&lt;/code&gt;: This applies to the embedded MariaDB library &lt;code&gt;(libmysqld)&lt;/code&gt;. It is used when MariaDB is embedded inside an application (a rare use case).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[mariadb]&lt;/code&gt;: This applies specifically to MariaDB server instances (not the generic MySQL). The settings here will override &lt;code&gt;[mysqld]&lt;/code&gt; if both sections define the same setting. This section is used when you want MariaDB-specific tuning.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[mariadb-10.6]&lt;/code&gt;: This applies only to &lt;code&gt;MariaDB version 10.6&lt;/code&gt; and &lt;code&gt;below&lt;/code&gt;. It is useful when running multiple MariaDB versions on the same machine or preparing version-specific tuning. This will override both &lt;code&gt;[mariadb]&lt;/code&gt; and &lt;code&gt;[mysqld]&lt;/code&gt; for that version.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  What is a daemon in Linux?
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;daemon&lt;/code&gt;, pronounced &lt;code&gt;day-mon&lt;/code&gt; is a background process that runs without direct user interaction and starts automatically at boot time or when needed. It performs ongoing system or service tasks quietly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples of daemons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mysqld&lt;/code&gt;: Runs the MariaDB/MySQL database server.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sshd&lt;/code&gt;: Handles SSH connections.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;httpd or nginx&lt;/code&gt;: Runs a web server.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;crond&lt;/code&gt;: Runs scheduled tasks (cron jobs).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemd&lt;/code&gt;: Controls startup and background services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basic characteristics of a &lt;code&gt;daemon&lt;/code&gt; are: It runs in the background, it has a name ending in &lt;code&gt;d&lt;/code&gt; (like &lt;code&gt;mysqld, sshd&lt;/code&gt;), it is usually started by &lt;code&gt;init/systemd&lt;/code&gt; or a &lt;code&gt;service manager&lt;/code&gt;, and does not have a graphical interface.&lt;/p&gt;

&lt;p&gt;In MariaDB context, the MariaDB daemon is &lt;code&gt;mysqld&lt;/code&gt;. It waits for database connections, and processes queries, manages users, reads config files, etc. We interact with it indirectly via the mysql command-line client.&lt;/p&gt;

&lt;p&gt;The screenshot below shows the path/directory to the &lt;code&gt;50-server.cnf&lt;/code&gt; file, where we can apply configuration settings for MariaDB. The 1st arrow points to the directory inside the &lt;code&gt;mysql&lt;/code&gt; directory, and the 2nd arrow points to the &lt;code&gt;50-server.cnf&lt;/code&gt; file inside the &lt;code&gt;mariadb.conf.d&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Therefore, log out of the database and edit the &lt;code&gt;50-server.cnf&lt;/code&gt; file by running: &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbf9h96lpm8hl4xzej2yp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbf9h96lpm8hl4xzej2yp.png" alt="Image description" width="772" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the moment, notice the &lt;code&gt;mysql&lt;/code&gt; directory is currently empty with no files or directories as pointed to by the arrow below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbdi9qgxte5g69xxk66j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbdi9qgxte5g69xxk66j.png" alt="Image description" width="666" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;50-server.cnf&lt;/code&gt; file and provide your &lt;code&gt;sudo&lt;/code&gt; password for authentication.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mh4mr7a36h5lv8ye6hs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mh4mr7a36h5lv8ye6hs.png" alt="Image description" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 1st arrow points to the file currently opened, and the 2nd arrow points to a brief description about the file and its contents.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbfm8ytgsdgkae9r9voo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbfm8ytgsdgkae9r9voo.png" alt="Image description" width="800" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within the &lt;code&gt;[mysqld]&lt;/code&gt; section, restrict MariaDB to only &lt;code&gt;localhost connections&lt;/code&gt;. Look for where &lt;code&gt;bind-address&lt;/code&gt; is commented and remove the &lt;code&gt;#&lt;/code&gt; symbol before it. If the configuration setting cannot be found, type it:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
bind-address = 127.0.0.1&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Also, disable &lt;code&gt;symbolic-links&lt;/code&gt;. In Linux, a symbolic link (or symlink) is like a shortcut or pointer to another file or directory. Within the &lt;code&gt;[mysqld]&lt;/code&gt; group insert:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
symbolic-links=0&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwy18yjvuzfuw0z1dw21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwy18yjvuzfuw0z1dw21.png" alt="Image description" width="787" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auditing&lt;/strong&gt; actions taken by a MariaDB user is a crucial step in database security. This can be achieved by analysing query logs, enabling the audit plugin, or using MariaDB's general or slow query log, depending on the setup.&lt;/p&gt;

&lt;p&gt;While still in the 50-server.cnf file, inside the [mysqld] section as pointed to by the 1st arrow, insert the configuration settings below. But where any settings are already written and commented, you do not have to rewrite them, just uncomment the configurations by erasing the hash symbol #.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
general_log = 1&lt;br&gt;
general_log_file = /var/log/mysql/query.log&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Note that this configuration setting only records/captures users' &lt;code&gt;logging activities&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then, restart the MariaDB Server by running the command below:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
sudo systemctl restart mariadb&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahopqt87ridz7lv4stne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahopqt87ridz7lv4stne.png" alt="Image description" width="722" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After editing the &lt;code&gt;50-server.cnf file and restarted the &lt;/code&gt;mariadb server&lt;code&gt;, let's confirm the &lt;/code&gt;query.log&lt;code&gt; file is created in the &lt;/code&gt;/var/log/mysql/&lt;code&gt; directory. The &lt;/code&gt;query.log` file has been created as pointed out by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32wkoupggntbtkone9ve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32wkoupggntbtkone9ve.png" alt="Image description" width="758" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s log in as the &lt;code&gt;seconduser&lt;/code&gt; and perform some activities by querying the &lt;code&gt;Chinook&lt;/code&gt; database.&lt;/p&gt;

&lt;p&gt;Notice that currently there is no single activity recorded in the &lt;code&gt;query.log&lt;/code&gt; file about the &lt;code&gt;seconduser&lt;/code&gt; yet, when we run the query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep seconduser /var/log/mysql/query.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as no output was returned, as pointed out by the arrow below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhim79nayux4usmzh57hi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhim79nayux4usmzh57hi.png" alt="Image description" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will provide two &lt;code&gt;wrong passwords&lt;/code&gt; and finally log in with the correct password for the &lt;code&gt;seconduser&lt;/code&gt;, perform some queries and let's find out if it will be captured in the query.log file.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzz6rvlfzlldvdwztr99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzz6rvlfzlldvdwztr99.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's exit the database and view the &lt;code&gt;query.log&lt;/code&gt; file to confirm if the seconduser logging activities were captured. As pointed out by the 1st and 2nd arrows directly at the logging time, access was denied because I entered the wrong password. But the third attempt, as pointed out by 3rd arrow, the seconduser successfully logged in.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ec84cclwp0m3a1negv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ec84cclwp0m3a1negv1.png" alt="Image description" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the &lt;code&gt;grep&lt;/code&gt; command to search for activity performed by the &lt;code&gt;seconduser&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep seconduser /var/log/mysql/query.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or to get a real-time view&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tail -f /var/log/mysql/query.log | grep seconduser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show what queries were executed, on what database/table, timestamps (if configured), login and logout events.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The general log can grow quickly because it logs everything. Avoid keeping it on in production for long periods. It's best used for auditing user activity, debugging application-database interactions, security investigations (e.g., detecting &lt;code&gt;SQL injections&lt;/code&gt; or &lt;code&gt;misuse&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Enable MariaDB Audit Plugin (Advanced Audit Logging).
&lt;/h3&gt;

&lt;p&gt;If not already installed, you can enable the &lt;code&gt;MariaDB Audit Plugin&lt;/code&gt; for deeper auditing.&lt;/p&gt;

&lt;p&gt;Log in to the MariaDB Server and run the query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSTALL SONAME 'server_audit'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As pointed out by the 1st arrow, the query was successfully executed. After the installation, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW PLUGINS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to view the list of all plugins as pointed to by the 2nd, 3rd and 4th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2p3rt47osnu5hwg3039z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2p3rt47osnu5hwg3039z.png" alt="Image description" width="800" height="365"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnbk6hdhwz607uk58fw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnbk6hdhwz607uk58fw3.png" alt="Image description" width="800" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SONAME&lt;/code&gt; stands for &lt;code&gt;Shared Object Name&lt;/code&gt; &lt;code&gt;.so&lt;/code&gt;. In MariaDB/MySQL, SONAME refers to a shared library (&lt;code&gt;.so&lt;/code&gt; file) that extends the server's functionality, often through plugins.&lt;/p&gt;

&lt;p&gt;Configure the plugin by editing the file &lt;code&gt;/etc/mysql/mariadb.conf.d/50-server.cnf&lt;/code&gt; and insert within the &lt;code&gt;[mysqld]&lt;/code&gt; section, the configuration settings below as pointed to by the 1st arrow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server_audit_logging=ON
server_audit_events=CONNECT,QUERY
server_audit_excl_users=mysql
server_audit_file_path=/var/log/mysql/audit.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni0mc0ve6ukwa81b6yam.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni0mc0ve6ukwa81b6yam.png" alt="Image description" width="732" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, restart MariaDB by running &lt;code&gt;sudo systemctl restart mariadb&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e4yzrkrc2qurkw5qxql.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e4yzrkrc2qurkw5qxql.png" alt="Image description" width="678" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will get detailed logs of all queries and connections made by all users logged in to MariaDB.&lt;/p&gt;
&lt;h3&gt;
  
  
  Review the Audit Logs.
&lt;/h3&gt;

&lt;p&gt;Notice that when we extract the &lt;code&gt;firstuser&lt;/code&gt; activities from the &lt;code&gt;audit.log&lt;/code&gt; file, it returns nothing as pointed to by the 1st arrow, because since the creation of the &lt;code&gt;audit.log&lt;/code&gt; we have yet to perform any activities as the firstuser.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyr0d5yzenifs4b7obd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyr0d5yzenifs4b7obd1.png" alt="Image description" width="720" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Log in as firstuser and provide the firstuser password as pointed to by the 1st arrow. I deliberately provided a wrong password and was denied access as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxbuwlt6x4gh1i2iqywz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxbuwlt6x4gh1i2iqywz.png" alt="Image description" width="800" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We finally logged in and performed some queries like showing the databases on the MariaDB Server as pointed out by 1st arrow, and mounting the Chinook database on the server as pointed out by 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63m6ry90myocugvrvb21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63m6ry90myocugvrvb21.png" alt="Image description" width="721" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the command below to extract the firstuser activities from the audit.log file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;less /var/log/mysql/audit.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use filters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep firstuser /var/log/mysql/audit.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 1st arrow points to the first failed login attempt I tried earlier above. The 2nd arrow points to when we successfully logged in. The 3rd arrow points to when the firstuser run the query SHOW DATABASES. The 4th arrow points to when the firstuser mounted the Chinook database (i.e when the Chinook database was selected). The last arrow points to when the firstuser exited the database.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjk71w2vnp4gh3kph4lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjk71w2vnp4gh3kph4lk.png" alt="Image description" width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The audit file presents you with the timestamp, hostname, username and the query executed by a user.&lt;/p&gt;
&lt;h3&gt;
  
  
  Generate a Report (Optional).
&lt;/h3&gt;

&lt;p&gt;You can create a structured report of the user’s actions by running :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep 'firstuser' /var/log/mysql/query.log &amp;gt; firstuser_activity.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 1st arrow below points to the file created from the command above, which contains the firstuser activities or footprint in the MariaDB Server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa663tfotcpwsxc34u7h5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa663tfotcpwsxc34u7h5.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Auditing user actions is vital for Accountability, Threat hunting, Forensics after incidents, and Security compliance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary.
&lt;/h2&gt;

&lt;p&gt;By the end of this project, you will have enabled logging and monitoring, practised log forensics and system auditing.&lt;/p&gt;

&lt;h2&gt;
  
  
  LinkedIn Article.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/pulse/securing-mariadb-server-enoch-agbu-prslf" rel="noopener noreferrer"&gt;Securing MariaDB Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Connect with me.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>mysql</category>
      <category>mariadb</category>
    </item>
    <item>
      <title>Set up Chinook Database on MariaDB Server.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Fri, 27 Jun 2025 08:15:58 +0000</pubDate>
      <link>https://forem.com/agbuenoch/set-up-chinook-database-on-mariadb-server-bfl</link>
      <guid>https://forem.com/agbuenoch/set-up-chinook-database-on-mariadb-server-bfl</guid>
      <description>&lt;p&gt;This project provides a step-by-step guide to installing Chinook Database on a MariaDB Server.&lt;/p&gt;

&lt;p&gt;The Chinook Database is a sample database widely used for learning, practising SQL, and testing database management tools. It is commonly used in tutorials, technical interviews, and courses that teach SQL querying, database normalisation, and relational database design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is Inside the Chinook Database?&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
The Chinook database mimics a digital media store. It contains data about music, customers, and purchases, structured to reflect real-world business scenarios. &lt;/p&gt;

&lt;p&gt;This is a step-by-step guide to installing the Chinook Database on a MariaDB server.&lt;/p&gt;

&lt;p&gt;In the screenshots, the Linux commands and SQL statements are highlighted in &lt;code&gt;yellow colour&lt;/code&gt; for clarity and effective comprehension.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MariaDB&lt;/code&gt; was originally developed as a fork of &lt;code&gt;MySQL&lt;/code&gt;, and it shares a high degree of compatibility, including its command-line interface. In many Linux distributions, when you install MariaDB, the command to start the MariaDB shell is still &lt;code&gt;mysql&lt;/code&gt; for compatibility and familiarity, even though we are using MariaDB. However, you can often also use &lt;code&gt;mariadb&lt;/code&gt; instead of &lt;code&gt;mysql&lt;/code&gt; in the terminal. Both commands typically work interchangeably for MariaDB on most systems.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Install MariaDB Server on Linux.
&lt;/h2&gt;

&lt;p&gt;The 1st arrow points to the username &lt;code&gt;agbuenoch&lt;/code&gt;, and the 2nd arrow points to the host or the machine &lt;code&gt;DESKTOP-H57G709&lt;/code&gt;, the user agbuenoch is currently logged in.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is used to run an update on our Ubuntu Linux distro, and this is highly recommended to do from time to time to have updated versions, patches and security features that are released.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdr12d5es6ty611lmkxh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdr12d5es6ty611lmkxh.png" alt="Image description" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mariadb-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will install the MariaDB server on our machine/host. The MariaDB server is a &lt;code&gt;Relational Database Management System (RDBMS)&lt;/code&gt; that will host our &lt;code&gt;Chinook&lt;/code&gt; database. You will be notified of the storage space to be used as pointed to by 1st arrow. If you wish to continue, enter yes, i.e. &lt;code&gt;y&lt;/code&gt; as pointed to by 2nd arrow. The 3rd arrow points to the download progress in percentage.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9pgs14z1t5pc6fesd65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9pgs14z1t5pc6fesd65.png" alt="Image description" width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installing MariaDB, &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;enable&lt;/code&gt; the MariaDB server. The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will start the MariaDB server. You will be prompted to enter your password to be able to run the specified command and start the server as pointed to by the 1st arrow. For any wrong password you enter, you will be prompted to re-enter the password as pointed to by the 2nd arrow. If successful, you will be redirected to the next prompt as pointed to by the 4th arrow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always remember to &lt;code&gt;start&lt;/code&gt; the MariaDB server if you previously &lt;code&gt;stopped&lt;/code&gt; it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5it51ohlysx15j83gp59.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5it51ohlysx15j83gp59.png" alt="Image description" width="789" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will &lt;code&gt;enable&lt;/code&gt; the MariaDB server. The 1st arrow below points to the successful execution message.&lt;/p&gt;

&lt;p&gt;You can &lt;code&gt;stop&lt;/code&gt; and &lt;code&gt;disable&lt;/code&gt; the MariaDB server by running the command below, respectively.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop mariadb

sudo systemctl disable mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cmkwizx1th3g0qt03v8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cmkwizx1th3g0qt03v8.png" alt="Image description" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 2: Secure the MariaDB Server.
&lt;/h2&gt;

&lt;p&gt;Run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to secure and provide settings for the MariaDB server we installed.&lt;/p&gt;

&lt;p&gt;The 1st arrow points to the prompts requesting the root user's &lt;code&gt;agbuenoch&lt;/code&gt; password. But if you have no password for the root user, just press the Enter key on your keyboard.&lt;/p&gt;

&lt;p&gt;The 2nd arrow points to the prompt that says Setting root user password or unix_socket can be used to secure access to the MariaDB server. In the scenario below, I already have a root user password set up, and this is recognised; for this reason, I declined to set up a &lt;code&gt;unix_socket authentication&lt;/code&gt; by answering no, i.e. &lt;code&gt;n&lt;/code&gt;. You will be prompted to provide the password before you can log in as a root user to the MariaDB server.&lt;/p&gt;

&lt;p&gt;The 3rd arrow points to the prompt asking if I want to change/update my already existing root user password, therefore I answer the prompt question with no, i.e. &lt;code&gt;n&lt;/code&gt;.  I do not want to change it.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgzmpm40ezc5owsi0fzf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgzmpm40ezc5owsi0fzf.png" alt="Image description" width="800" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshot below is the continuation of the screenshot immediately above. From the screenshot below, the 1st arrow points to the prompt asking if we want to remove the default anonymous user that comes preinstalled with the MariaDB server. Because this installation is for a production environment setting, the database administrator will be responsible for creating and adding new users. Let’s answer with yes, i.e. &lt;code&gt;y&lt;/code&gt; to remove the anonymous user.&lt;/p&gt;

&lt;p&gt;The 2nd arrow points to the prompts asking to disallow root login remotely. If we disallow root login remotely, the root user can only log in to the database locally, which is highly recommended for security reasons and will reduce the attack surface. The root user's remote login can be allowed for troubleshooting or other valid reasons so that the root user can log in to the database from any host/machine.&lt;/p&gt;

&lt;p&gt;The 3rd arrow points to the prompt asking to remove the &lt;code&gt;test&lt;/code&gt; database and access to it, and we agreed to remove it by inputting yes, i.e. &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We then agreed to reload the privilege table to affect all the settings, as this is pointed to by the 4th arrow. We got a success message below confirming that our MariaDB server is now secure and can only be accessed by authorised users.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzswt05i3hv732x18duk2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzswt05i3hv732x18duk2.png" alt="Image description" width="800" height="575"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8lcmk712zr23uzksokr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8lcmk712zr23uzksokr.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 3: Download the Chinook Database SQL Script for MySQL.
&lt;/h2&gt;

&lt;p&gt;Download the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file, as the MariaDB server is compatible with &lt;code&gt;MySQL SQL scripts&lt;/code&gt;, using the command &lt;code&gt;wget&lt;/code&gt; to download it directly from the command line.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;wget&lt;/code&gt; is followed by the web address URL where the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file is located. The arrow below points to the download progress and afterwards shows that the file has been saved as shown with the underline in red.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8evq3p48um4fx6iulon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8evq3p48um4fx6iulon.png" alt="Image description" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is how to get the web address for the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
Click on the Chinook Database GitHub Repository and follow the screenshot below. Click just once on the file that the &lt;code&gt;green-coloured&lt;/code&gt; arrow points to.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focvvb65aru1hbhcab3wb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focvvb65aru1hbhcab3wb.png" alt="Image description" width="762" height="542"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmqe4opmqwlgdnzlts0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmqe4opmqwlgdnzlts0f.png" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ias4uftotsogdpjtsnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ias4uftotsogdpjtsnk.png" alt="Image description" width="620" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the top right-hand corner, click on &lt;code&gt;Raw&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbanpnn4dhylp58py3eni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbanpnn4dhylp58py3eni.png" alt="Image description" width="699" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be presented with the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; raw file. Highlight the &lt;code&gt;URL&lt;/code&gt; in the web browser address bar as shown below, highlighted in yellow and copy it.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzms6ugb48tdppmpughb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzms6ugb48tdppmpughb.png" alt="Image description" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be presented with the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; raw file. Highlight the URL in the web browser address bar as shown below, highlighted in yellow and copy it.&lt;/p&gt;

&lt;p&gt;Paste the URL immediately after the &lt;code&gt;wget&lt;/code&gt; command on the Linux console, as illustrated above.&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 4: Log in to MariaDB.
&lt;/h2&gt;

&lt;p&gt;When prompted for a password, enter your root password. If it was the &lt;code&gt;unix_socket&lt;/code&gt; authentication you chose, provide the required details as expected.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mariadb

or

sudo mariadb -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can be used to log in to the MariaDB server. Because we previously secured the database, you are prompted to enter a password as pointed to by the 1st arrow. If the authentication is successful, you will be granted access to the MariaDB server as pointed to by the 2nd and 3rd arrows. The 2nd arrow points to the &lt;code&gt;Relational Database Management System (RDBMS)&lt;/code&gt; we are using, which is &lt;code&gt;MariaDB&lt;/code&gt; and the 3rd arrow points to the current Database residing in the MariaDB server, at this stage no database has been mounted on the MariaDB server, which is why you see the &lt;code&gt;[(none)]&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu3e3odbjjcstsija8wq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu3e3odbjjcstsija8wq7.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 5: Create a new Database for Chinook (OPTIONAL).
&lt;/h2&gt;

&lt;p&gt;Create a new database called &lt;code&gt;Chinook&lt;/code&gt;. Then switch to the new database &lt;code&gt;Chinook&lt;/code&gt;, by so doing, the &lt;code&gt;[(none)]&lt;/code&gt; will be replaced by &lt;code&gt;Chinook&lt;/code&gt;. Make sure the new database name we are creating matches the exact name of the database found in the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Let’s take a look at the file and have a look at what I mean. From this screenshot, click on the file pointed by the green arrow below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboga7ev0rqk6th9vy0ol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboga7ev0rqk6th9vy0ol.png" alt="Image description" width="620" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 1st arrow points to the SQL statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DROP DATABASE IF EXISTS `Chinook`;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will replace and overwrite any existing database with the exact database name &lt;code&gt;Chinook&lt;/code&gt; when we upload the SQL file to our MariaDB server. But note that this SQL statement is &lt;code&gt;CONDITIONAL&lt;/code&gt;, it will only run if there is a database named &lt;code&gt;Chinook&lt;/code&gt; found in the MariaDB server; otherwise, it will not execute but jump to the next line of the statement. Therefore,  the Chinook database we will create will be replaced or dropped as a result of this line of SQL statement. In essence, the Chinook database in the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file will replace the empty Chinook database we are going to create.&lt;/p&gt;

&lt;p&gt;The 2nd arrow points to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE `Chinook`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the &lt;code&gt;CONDITIONAL SQL&lt;/code&gt; statement above did not execute, a new database &lt;code&gt;Chinook&lt;/code&gt; will be created.&lt;/p&gt;

&lt;p&gt;The 3rd arrow points to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE `Album`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This statement will create a new table called &lt;code&gt;Album&lt;/code&gt; and populate the table with values as specified inside the parentheses &lt;code&gt;( … )&lt;/code&gt;. When you scroll down, you will see more of the other statements that will build the Chinook database for us.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqx8fgp95ibzzelkytio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqx8fgp95ibzzelkytio.png" alt="Image description" width="791" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before creating the Chinook database and loading the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file, we run the statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW DATABASES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to view the current databases in the MariaDB server. The 1st arrow points to the Database column, and within the column is the list of preinstalled databases that come with the MariaDB server, which hold important files and configuration settings.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw3lzjikkgptgrz1s2od.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw3lzjikkgptgrz1s2od.png" alt="Image description" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE Chinook;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will create a new database, &lt;code&gt;Chinook&lt;/code&gt;. The database was created successfully, and we got the message &lt;code&gt;Query OK&lt;/code&gt; as pointed to by the 1st arrow. If we execute the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW DATABASES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now see the newly created database Chinook in the MariaDB server as pointed to by the 2nd arrow.&lt;/p&gt;

&lt;p&gt;Mount the Chinook database by executing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE Chinook;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If successfully mounted, we got the message &lt;code&gt;Database changed&lt;/code&gt;, i.e. from &lt;code&gt;[(none)]&lt;/code&gt; to &lt;code&gt;Chinook&lt;/code&gt; as pointed to by the 3rd arrow. View the tables in the Chinook database by executing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW TABLES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the Chinook database we created is empty; it has no tables. This is why when we execute &lt;code&gt;SHOW TABLES&lt;/code&gt;; we get the message &lt;code&gt;Empty set (0.001 sec)&lt;/code&gt; as pointed to by the 4th arrow. We will later upload the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file to the Chinook database and populate the Chinook database with tables and values in the next step below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwd35cafdgp9z4br82w8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwd35cafdgp9z4br82w8.png" alt="Image description" width="731" height="446"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 6: Load the Chinook SQL Script into MariaDB.
&lt;/h2&gt;

&lt;p&gt;We need to exit the database first before loading the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file to the MariaDB server. The command &lt;code&gt;EXIT&lt;/code&gt;; will log you out of the MariaDB server. The 1st arrow points that we are logged out, i.e. &lt;code&gt;Bye&lt;/code&gt;. The 2nd and 3rd arrows point to the username and hostname, respectively. The 4th arrows point to the &lt;code&gt;$&lt;/code&gt; symbol, which connotes a &lt;code&gt;regular user&lt;/code&gt; where whereas the &lt;code&gt;#&lt;/code&gt; symbol connotes a &lt;code&gt;root user&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwdvr7gj0uyatendul3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwdvr7gj0uyatendul3w.png" alt="Image description" width="576" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Load the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file we downloaded above. First, log in to the MariaDB using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mariadb;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mariadb -u root -p Chinook &amp;lt; Chinook_MySql.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will upload the file to the Chinook database we created above. But note that the empty Chinook database we created will be dropped and replaced by the database named Chinook specified inside the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file. As pointed to by the 1st arrow, you are prompted to enter the root user password for the sudo privilege; meanwhile, the 2nd arrow points to the prompt requesting the root user password for the MariaDB server. Remember from above that a root user password was recognised when I wanted to secure access to the MariaDB Server, and I chose to use the root user password over &lt;code&gt;unix_socket&lt;/code&gt; authentication. Therefore, because I am logging into the MariaDB server as a root user, this means I will enter the same password for the root user.&lt;/p&gt;

&lt;p&gt;The 3rd arrow points to the command &lt;code&gt;SHOW DATABASE&lt;/code&gt;, which will list all databases within the MariaDB server as pointed to by the 4th arrow. The Chinook database is the database we created earlier, which is now replaced with the Chinook database created in the Chinook_MySql.sql file. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;information_schema, mysql, performance_schema&lt;/code&gt; and &lt;code&gt;sys&lt;/code&gt; are all default databases that come pre-installed with the MariaDB server. They contain important files and configurations like &lt;code&gt;user privileges&lt;/code&gt; related to the MariaDB server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feog7ienlp72wn1yxzqln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feog7ienlp72wn1yxzqln.png" alt="Image description" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can skip &lt;code&gt;STEP 5&lt;/code&gt; and continue from &lt;code&gt;STEP 6&lt;/code&gt;. We will still achieve the same result, this is because when we load the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file, it will automatically create the new database Chinook with all the tables inside. On this premise, below is how to load the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file if you decided to skip the step of creating the Chinook database yourself.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mariadb -u -p &amp;lt; Chinook_MySql.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will load the SQL script and will automatically create a database named Chinook. Notice that we did NOT insert or pass a database name before the less-than symbol &lt;code&gt;&amp;lt;&lt;/code&gt;. The next arrow on the screenshot below shows that the Chinook database has been created automatically as a result of uploading the SQL script &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fktctooy8kktqquittxie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fktctooy8kktqquittxie.png" alt="Image description" width="795" height="488"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 7: Verify the Installation.
&lt;/h2&gt;

&lt;p&gt;After showing the databases, mount the Chinook database into the MariaDB server to start querying it.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE Chinook;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will mount the Chinook database. The database has been changed as pointed to by the 1st arrow.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW TABLES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will list tables in the Chinook database we just mounted. The 2nd arrow points to the column named &lt;code&gt;Tables_in_Chinook&lt;/code&gt;. The 3rd arrow points to the names of the tables inside the Chinook database, like &lt;code&gt;Album, Artist&lt;/code&gt; and &lt;code&gt;Track&lt;/code&gt;, among others.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z2uhyf6a73lr45zy7bz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z2uhyf6a73lr45zy7bz.png" alt="Image description" width="749" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that the SQL statement &lt;code&gt;SHOW TABLE&lt;/code&gt; now displays the list of tables in the Chinook database, meanwhile, before the &lt;code&gt;Chinook_MySql.sql&lt;/code&gt; file was uploaded into the Chinook database we created, no tables were inside the Chinook database as shown above In &lt;code&gt;step 5&lt;/code&gt;, the last screenshot pointed out by the 4th arrow, which reads &lt;code&gt;Empty set (0.001 sec)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Run the following SQL statement for each of the tables inside the Chinook database to view the columns in each table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM &amp;lt;The table name&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM Album;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  STEP 8: Stop and Disable the Database:
&lt;/h2&gt;

&lt;p&gt;We can &lt;code&gt;stop&lt;/code&gt; the MariaDB server and prevent it from starting automatically on subsequent system boots. This implies that we must &lt;code&gt;start&lt;/code&gt; the server each time we boot our local device. Let’s exit back to the Linux console and run the commands shown below.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will &lt;code&gt;stop&lt;/code&gt; the MariaDB server, while the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl disable mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will &lt;code&gt;disable&lt;/code&gt; the server. You can check the status of the server by executing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkoeprbn7atppnusmddld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkoeprbn7atppnusmddld.png" alt="Image description" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You must restart the database again before you can access and query it, as demonstrated at the beginning of the article. Let’s see what happens when you attempt to access the database without starting it.&lt;/p&gt;

&lt;p&gt;As pointed out by the 2nd arrow, you will get an error because the server was stopped, as shown in the screenshot above. Therefore, you will have to start the server before accessing it.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjug3esbce9s0mj58l91u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjug3esbce9s0mj58l91u.png" alt="Image description" width="737" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will &lt;code&gt;start&lt;/code&gt; the server, hence when we run &lt;code&gt;sudo mariadb&lt;/code&gt;, we can access it as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6frb8etgwrbptcggnhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6frb8etgwrbptcggnhu.png" alt="Image description" width="795" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary:
&lt;/h2&gt;

&lt;p&gt;This setup provides a complete local environment for practising &lt;code&gt;SQL&lt;/code&gt; on the &lt;code&gt;Chinook database&lt;/code&gt; using a &lt;code&gt;MariaDB server&lt;/code&gt; and &lt;code&gt;Linux Bash&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  LinkedIn Article.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/pulse/how-set-up-chinook-database-mariadb-server-using-linux-enoch-agbu-8cgff/" rel="noopener noreferrer"&gt;How to set up “Chinook Database” on MariaDB Server using Linux Bash&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Connect with me.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>mariadb</category>
      <category>sql</category>
    </item>
    <item>
      <title>Analyse Packets with Wireshark.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Mon, 23 Jun 2025 09:28:09 +0000</pubDate>
      <link>https://forem.com/agbuenoch/analyse-packets-with-wireshark-4c3p</link>
      <guid>https://forem.com/agbuenoch/analyse-packets-with-wireshark-4c3p</guid>
      <description>&lt;p&gt;This project opens a packet capture (&lt;code&gt;.pcap&lt;/code&gt;) file and explores the basic Wireshark Graphical User Interface. It opens a detailed view of a single packet and explores how to examine the various protocol and data layers inside a network packet. It applies filters to TCP packet data to search for specific payload text data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Explore data with Wireshark.
&lt;/h2&gt;

&lt;p&gt;Let’s open a network packet capture file called &lt;code&gt;sample&lt;/code&gt; as pointed to by the 2nd arrow, which contains data captured from a system that made web requests to a site. We need to open this data with Wireshark to get an overview of how the data is presented in the application.&lt;/p&gt;

&lt;p&gt;Wireshark is already installed on Windows, as indicated by the 1st arrow. To open the packet capture file, double-click the &lt;code&gt;sample&lt;/code&gt; file, as shown by the 2nd arrow below on the Windows desktop. This will start Wireshark. Note that the sample packet capture file has a &lt;code&gt;.pcap&lt;/code&gt; file extension, which is hidden by default in Windows Explorer and the desktop view.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vvdjp7xxuzqapdq18wk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vvdjp7xxuzqapdq18wk.png" alt="Image description" width="593" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we double-click the sample pcap file, the Wireshark window below will be displayed. Many network packet traffic is listed, so we will apply filters to find the information needed.&lt;/p&gt;

&lt;p&gt;The area pointed to by the 1st arrow is the &lt;code&gt;filter text box&lt;/code&gt; used to filter and select intended network traffic. As pointed out by the 2nd arrow, you can scroll up and down the Wireshark interface to view more network traffic.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5jnv8a8ejvty2dc4io7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5jnv8a8ejvty2dc4io7m.png" alt="Image description" width="800" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down the packet list until a packet is listed where the &lt;code&gt;info&lt;/code&gt; column starts with the words &lt;code&gt;Echo (ping) request&lt;/code&gt; as pointed to by the 1st arrow. The 2nd arrow points to the &lt;code&gt;ICMP&lt;/code&gt; Protocol contained in the traffic.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95vz2lgkb59fsr04xe7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95vz2lgkb59fsr04xe7x.png" alt="Image description" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let us look at common Protocol Names and their meaning.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ARP&lt;/strong&gt; (Address Resolution Protocol) --&amp;gt; used to map IP addresses to MAC addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP&lt;/strong&gt; (Internet Protocol) --&amp;gt; used for routing and addressing packets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP&lt;/strong&gt; (Transmission Control Protocol) --&amp;gt; used for reliable data transport.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UDP&lt;/strong&gt; (User Datagram Protocol) --&amp;gt; used for faster, connectionless transport.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS&lt;/strong&gt; (Domain Name System) --&amp;gt; This protocol translates domain names to IPs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP/HTTPS&lt;/strong&gt; (HyperText Transfer Protocol Secure) --&amp;gt; use in web traffic for regular and secure browser/server communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ICMP&lt;/strong&gt; (Internet Control Message Protocol) --&amp;gt; used in ping and traceroute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS&lt;/strong&gt; (Transport Layer Security) --&amp;gt; used for encrypted communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH&lt;/strong&gt; (Secure SHell) --&amp;gt; used to connect to a system remotely (Secure remote login).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTP&lt;/strong&gt; (File Transfer Protocol) --&amp;gt;  used for file transfers between client and server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SMTP&lt;/strong&gt; (Simple Mail Transfer Protocol)--&amp;gt; Used in email delivery or sending email, but not for receiving email.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IMAP&lt;/strong&gt; (Internet Message Access Protocol) --&amp;gt; used to retrieve emails from a mail server to your device (computer, phone, or app), but not for sending email.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POP3&lt;/strong&gt; (Post Office Protocol v3) --&amp;gt; This is also used to retrieve emails from a mail server to your device, but not for sending email.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Apply a basic Wireshark filter and inspect a packet.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;An overview of the key property columns listed for each packet:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No.:&lt;/strong&gt; The index number of the packet in this packet capture file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time:&lt;/strong&gt; The timestamp of the packet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; The source IP address. The IP address from which the traffic emanates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; The destination IP address. The IP address where the traffic is expected to go.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol:&lt;/strong&gt; This is the protocol contained in the packet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Length:&lt;/strong&gt; The total length of the packet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Info:&lt;/strong&gt; Some information about the data in the packet (the payload) as interpreted by Wireshark.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 1st arrow points to the name of the file currently opened in Wireshark. The 2nd arrow points to the filter text box. Inside the filter text box, we can run queries as pointed to by the 3rd arrow to return, extract, or filter network traffic. When the &lt;code&gt;filter text box turns&lt;/code&gt;pink&lt;code&gt;after inputting the query, as shown below, it means the command/query entered is wrong. The query&lt;/code&gt;ip.address&lt;code&gt;is a bad syntax. But when the&lt;/code&gt;filter text box&lt;code&gt;turns&lt;/code&gt;green&lt;code&gt;after inputting the query, it means that the syntax is correct. For example, instead of&lt;/code&gt;ip.address&lt;code&gt;, the correct syntax is&lt;/code&gt;ip-addr`.&lt;/p&gt;

&lt;p&gt;The 4th arrow points to the packets columns starting from &lt;code&gt;No&lt;/code&gt; all the way to &lt;code&gt;Info&lt;/code&gt;. Click on &lt;code&gt;x&lt;/code&gt; as pointed to by the 6th arrow to cancel the query you entered, or click on the Apply Display Filter symbol as pointed to by the 5th arrow to run/execute the query entered.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5kpbxnnbuiyxgj9dz4jb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5kpbxnnbuiyxgj9dz4jb.png" alt="Image description" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the query below to filter for traffic associated with the specified IP address, i.e &lt;code&gt;142.250.1.139&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
ip.addr == 142.250.1.139 &lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Press &lt;code&gt;ENTER&lt;/code&gt; or click the Apply display filter icon located at the end of the filter text box. Because the filter/query syntax is correct, the filter text box turns &lt;code&gt;green&lt;/code&gt; as shown below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7z8e2jwjyjap1qmnliji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7z8e2jwjyjap1qmnliji.png" alt="Image description" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;details pane&lt;/code&gt; is located at the bottom portion of the main Wireshark window, as pointed to by the first and second arrows. This can be opened in a completely separate window when you double-click a particular packet from the main Wireshark window.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpr1evkfb098odliu7fw5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpr1evkfb098odliu7fw5.png" alt="Image description" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above &lt;code&gt;details pane&lt;/code&gt; can also be accessed in a new window by double-clicking a packet. The upper section of the window below contains &lt;code&gt;subtrees&lt;/code&gt; where Wireshark will provide you with an analysis of the various parts of the network packet. As illustrated below, the upper section of the window, as indicated by the first arrow, contains subtrees (&lt;code&gt;e.g. Frame, Ethernet II, Internet Protocol Version 4 and Transmission Control Protocol&lt;/code&gt;) where Wireshark will provide you with an analysis of the various parts of the network packet. The lower section of the window, as indicated by the second arrow, contains the &lt;code&gt;raw packet data&lt;/code&gt; displayed in &lt;code&gt;hexadecimal&lt;/code&gt; and &lt;code&gt;ASCII&lt;/code&gt; text. There is also &lt;code&gt;placeholder text&lt;/code&gt; for fields where the character data does not apply, as indicated by the dot &lt;code&gt;.&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Double-click any of the subtrees in the upper section to have a detailed view of all information about the data packet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2hjjjm3zi9fxbq30420.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2hjjjm3zi9fxbq30420.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Double-click the &lt;code&gt;Frame&lt;/code&gt; subtree to view details about the overall network packet, or frame, including the &lt;code&gt;frame length&lt;/code&gt; and the &lt;code&gt;arrival time&lt;/code&gt; of the packet. At this level, we are viewing information about the entire packet of data.&lt;/p&gt;

&lt;p&gt;Double-click &lt;code&gt;Frame&lt;/code&gt; again to collapse the subtree, and then double-click the &lt;code&gt;Ethernet II&lt;/code&gt; subtree. This item contains details about the packet at the Ethernet level, including the source and destination MAC addresses and the type of internal protocol that the Ethernet packet contains.&lt;/p&gt;

&lt;p&gt;Double-click &lt;code&gt;Ethernet II&lt;/code&gt; again to collapse that subtree and then double-click the &lt;code&gt;Internet Protocol Version 4&lt;/code&gt; subtree. This provides packet data about the Internet Protocol (&lt;code&gt;IP&lt;/code&gt;) data contained in the Ethernet packet. It contains information such as the source and destination IP addresses and the Internal Protocol (for example, &lt;code&gt;TCP&lt;/code&gt; or &lt;code&gt;UDP&lt;/code&gt;), which is carried inside the IP packet. The &lt;code&gt;Internet Protocol Version 4&lt;/code&gt; subtree is Internet Protocol Version 4 (&lt;code&gt;IPv4&lt;/code&gt;). The third subtree label reflects the protocol. The source and destination IP addresses shown here match the source and destination IP addresses in the summary display for this packet in the main Wireshark window.&lt;/p&gt;

&lt;p&gt;Double-click &lt;code&gt;Internet Protocol Version 4&lt;/code&gt; again to collapse that subtree, and then double-click the &lt;code&gt;Transmission Control Protocol&lt;/code&gt; subtree. This provides detailed information about the TCP packet, including the &lt;code&gt;source&lt;/code&gt; and &lt;code&gt;destination TCP ports&lt;/code&gt;, the &lt;code&gt;TCP sequence numbers&lt;/code&gt;, and the &lt;code&gt;TCP flags&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Use filters to select packets.
&lt;/h2&gt;

&lt;p&gt;We will use filters to analyse specific network packets based on where the packets come from or where they are sent to. We will explore how to select packets using either their physical Ethernet Media Access Control (&lt;code&gt;MAC&lt;/code&gt;) address or their &lt;code&gt;Internet Protocol (IP)&lt;/code&gt; address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter traffic for a specific source IP address only.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
ip.src == 142.250.1.139&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
A filtered list is returned with fewer entries than before. It contains only packets that came from &lt;code&gt;142.250.1.139&lt;/code&gt; as pointed to by the 2nd arrow. Notice that all the &lt;code&gt;IPs&lt;/code&gt; under the &lt;code&gt;Source&lt;/code&gt; column match the &lt;code&gt;IP&lt;/code&gt; we filtered in the &lt;code&gt;filter text box&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl84b6hz8i52w7fogqi5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl84b6hz8i52w7fogqi5.png" alt="Image description" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next, let's filter to select traffic for a specific destination IP address only.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
ip.dst == 142.250.1.1399&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
A filtered list is returned that contains only packets that were sent to &lt;code&gt;142.250.1.139&lt;/code&gt; as pointed to by the 2nd arrow. Notice that all the &lt;code&gt;IPs&lt;/code&gt; under the &lt;code&gt;Destination&lt;/code&gt; column match the &lt;code&gt;IP&lt;/code&gt; we filtered in the &lt;code&gt;filter text box&lt;/code&gt;, as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffz5f4ua01asfkw5slzfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffz5f4ua01asfkw5slzfq.png" alt="Image description" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the following filter to select traffic to or from a specific &lt;code&gt;Ethernet MAC address&lt;/code&gt;. This filters traffic related to one MAC address, regardless of the other protocols involved.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
eth.addr == 42:01:ac:15:e0:02&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Double-click the first packet in the list as pointed to by the 2nd arrow. Double-click the &lt;code&gt;Ethernet II&lt;/code&gt; subtree if it is not already open as pointed to by the 3rd arrow. The &lt;code&gt;MAC&lt;/code&gt; address you specified in the filter is listed as either the source or destination address in the expanded &lt;code&gt;Ethernet II&lt;/code&gt; subtree; in this case, it is listed as the source address as pointed to by the 4th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2jrlt5hxfh3txmy4nkl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2jrlt5hxfh3txmy4nkl4.png" alt="Image description" width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Double-click the &lt;code&gt;Internet Protocol Version 4&lt;/code&gt; subtree to expand it as pointed to by the 1st arrow and scroll down until the &lt;code&gt;Time to Live&lt;/code&gt; and &lt;code&gt;Protocol&lt;/code&gt; fields appear as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44dydlglgs6brhq7d6lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44dydlglgs6brhq7d6lk.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always double-click a subtree that is already open to close or collapse it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step  4: Use filters to explore DNS packets.
&lt;/h2&gt;

&lt;p&gt;We will use filters to select and examine &lt;code&gt;DNS&lt;/code&gt; traffic. Once you have selected sample &lt;code&gt;DNS&lt;/code&gt; traffic, we will drill down into the protocol to examine how the DNS packet data contains both &lt;code&gt;Queries&lt;/code&gt; (names of internet sites that are being looked up) and &lt;code&gt;Answers&lt;/code&gt; (IP addresses that are being sent back by a DNS server when a name is successfully resolved).&lt;/p&gt;

&lt;p&gt;Enter the following filter to select &lt;code&gt;UDP port 53&lt;/code&gt; traffic. &lt;code&gt;DNS traffic&lt;/code&gt; uses &lt;code&gt;UDP port 53&lt;/code&gt;, so this will list traffic related to DNS queries and responses only. Enter this into the Apply a display filter... text box immediately above the list of packets.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
udp.port == 53&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Click on the first packet as pointed to by the 2nd arrow to highlight it, or we can double-click the first packet in the list to open the detailed packet window. Notice that the &lt;code&gt;Protocol&lt;/code&gt; column contains only &lt;code&gt;DNS&lt;/code&gt;, just as described in the filter text box.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5q6pztpm5hd0oar0o0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5q6pztpm5hd0oar0o0y.png" alt="Image description" width="800" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down and double-click the &lt;code&gt;Domain Name System (query)&lt;/code&gt; subtree as pointed to by the 1st arrow to expand it. You will notice that the name of the website that was queried is &lt;code&gt;opensource.google.com&lt;/code&gt;, as indicated by the 2nd and 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqzy5j6zkidnie5zl5s6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqzy5j6zkidnie5zl5s6a.png" alt="Image description" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us again double-click the fourth packet in the list as pointed to by the 1st arrow to open the detailed packet window.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55x92zr3aednp8c1rm82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55x92zr3aednp8c1rm82.png" alt="Image description" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down and double-click the &lt;code&gt;Domain Name System (query)&lt;/code&gt; subtree to expand it. Click &lt;code&gt;Answers&lt;/code&gt; as pointed by the first arrow, which is in the &lt;code&gt;Domain Name System (query)&lt;/code&gt; subtree. The &lt;code&gt;Answers&lt;/code&gt; data includes the names that were queried (&lt;code&gt;opensource.google.com&lt;/code&gt;) as pointed to by the 2nd arrow and the &lt;code&gt;IP addresses&lt;/code&gt; that are associated with the names, as pointed to by the 3rd arrow. The 4th arrow points to the &lt;code&gt;time&lt;/code&gt; it takes to look up the name.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5flsd95xgjj93djkjida.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5flsd95xgjj93djkjida.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Use filters to explore TCP packets.
&lt;/h2&gt;

&lt;p&gt;We will use additional filters to select and examine &lt;code&gt;TCP packets&lt;/code&gt;. We will learn how to search for text that is present in &lt;code&gt;payload&lt;/code&gt; data contained inside network packets. This will locate packets based on something such as a name or some other text that is of interest to us.&lt;/p&gt;

&lt;p&gt;Enter the query below to select TCP port 80 traffic.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
tcp.port == 80&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;TCP port 80&lt;/code&gt; is the default port that is associated with &lt;code&gt;web traffic&lt;/code&gt;. Click the first packet in the list as pointed to by the 2nd arrow. The &lt;code&gt;Destination IP address&lt;/code&gt; of this packet is &lt;code&gt;169.254.169.254&lt;/code&gt;. The 3rd arrow points to the &lt;code&gt;detailed pane&lt;/code&gt; of the selected traffic, which comprises of subtrees.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ahfchfqbcub93w4uil1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ahfchfqbcub93w4uil1.png" alt="Image description" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;detail pane&lt;/code&gt;, we will look up the &lt;code&gt;Time to Live&lt;/code&gt; value as pointed to by the 2nd arrow, &lt;code&gt;Header Length&lt;/code&gt; as pointed to by the 1st arrow, and &lt;code&gt;Destination Address&lt;/code&gt; of the packet as pointed to by the 3rd arrow specified in the &lt;code&gt;Internet Protocol Version 4&lt;/code&gt; subtree.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flk1p62jxzeqfn146yg8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flk1p62jxzeqfn146yg8u.png" alt="Image description" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and the &lt;code&gt;Frame Length&lt;/code&gt; as pointed to by the 2nd arrow specified in the &lt;code&gt;Frame&lt;/code&gt; subtree of the packet subtree in the &lt;code&gt;detailed pane&lt;/code&gt; as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qoaxl2g8kapt5hvwjwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qoaxl2g8kapt5hvwjwc.png" alt="Image description" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's also enter the query below to select &lt;code&gt;TCP packet&lt;/code&gt; data that contains specific text data.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;wireshark&lt;br&gt;
tcp contains "curl"&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Click the &lt;code&gt;Hypertext Transfer Protocol&lt;/code&gt; subtree in the &lt;code&gt;detailed pane&lt;/code&gt; as pointed to by the 2nd arrow. The 3rd arrow points to the &lt;code&gt;user-agent&lt;/code&gt;, which contains the text &lt;code&gt;curl&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3dne43m8imrdcukhhs4h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3dne43m8imrdcukhhs4h.png" alt="Image description" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Seeing &lt;code&gt;curl&lt;/code&gt; in the &lt;code&gt;User-Agent&lt;/code&gt; string during a security investigation or analysis indicates that a request to the server was made using the &lt;code&gt;curl command-line tool&lt;/code&gt;, not a standard web browser like Chrome or Firefox. Attackers, researchers, or bots often use &lt;code&gt;curl&lt;/code&gt; in scripts to send automated requests. Sometimes, the &lt;code&gt;curl&lt;/code&gt; is often used to bypass browser protections, headers, or cookies.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The curl command-line tool is used for both legitimate and malicious purposes. Therefore, the context used matters a lot. For example, check if curl requests are hitting sensitive endpoints like &lt;code&gt;/login&lt;/code&gt;, &lt;code&gt;/admin&lt;/code&gt;, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summary.
&lt;/h2&gt;

&lt;p&gt;This article describes the process of analysing network packet data using Wireshark. It begins with opening a packet capture file (&lt;code&gt;.pcap&lt;/code&gt;) in Wireshark and exploring the basic Graphical User Interface. We then guide through applying filters to select specific packets based on criteria such as &lt;code&gt;IP address&lt;/code&gt;, &lt;code&gt;MAC address&lt;/code&gt;, or &lt;code&gt;protocol&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It also explains how to inspect individual packets in detail, showing how to examine different protocol layers (&lt;code&gt;Ethernet, IP, TCP&lt;/code&gt;) and their data. It further demonstrates how to filter and inspect specific types of traffic, like DNS or TCP traffic, and how to search for specific text within packet payloads.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/analyse-packets-with-wireshark" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/analyse-packets-with-wireshark&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>network</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Analyse Packets with tcpdump.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Fri, 20 Jun 2025 06:35:11 +0000</pubDate>
      <link>https://forem.com/agbuenoch/analyse-packets-with-tcpdump-4jbn</link>
      <guid>https://forem.com/agbuenoch/analyse-packets-with-tcpdump-4jbn</guid>
      <description>&lt;p&gt;This project used the command-line tool &lt;code&gt;tcpdump&lt;/code&gt; to capture and analyse live network traffic from a Linux virtual machine. It identifies &lt;code&gt;network interfaces&lt;/code&gt; to capture network packet data. It uses &lt;code&gt;tcpdump&lt;/code&gt; to filter live network traffic and capture network traffic using tcpdump. Lastly, it filters the captured packet data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Identify Network Interfaces.
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;pwd&lt;/code&gt; to print the current working directory as pointed to by the 1st arrow. To list all files and directories in the current working directory, run &lt;code&gt;ls -l&lt;/code&gt;, which lists all the directory contents, as pointed to by the 2nd arrow. There is only one file &lt;code&gt;sample.pcap&lt;/code&gt; in the &lt;code&gt;/home/analyst directory&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0xe7xbelog9l7sg6km3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0xe7xbelog9l7sg6km3.png" alt="Image description" width="663" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We must first of all identify the network interfaces that can be used to capture network packet data. Run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ifconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to identify the available interfaces. The 1st and 2nd arrows point to the &lt;code&gt;eth0&lt;/code&gt; and &lt;code&gt;lo&lt;/code&gt; network interfaces, respectively. The Ethernet network interface is identified by the entry with the eth prefix.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb29vz4s76lc4i5ryt80s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb29vz4s76lc4i5ryt80s.png" alt="Image description" width="664" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, we can use &lt;code&gt;tcpdump&lt;/code&gt; to identify the interface options available for packet capture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tcpdump -D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command may be useful on systems that do not include the &lt;code&gt;ifconfig&lt;/code&gt; command. The screenshot below lists all available network interfaces we can use to capture packets, as pointed out by the arrow. The network interfaces include &lt;code&gt;eth0, any, lo, nflog, nfqueue&lt;/code&gt;. Notice that &lt;code&gt;eth0&lt;/code&gt; and &lt;code&gt;any&lt;/code&gt; network interfaces are up and running.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqe7agrqag5vvtpksh790.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqe7agrqag5vvtpksh790.png" alt="Image description" width="692" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tcpdump = This is a command-line packet capture tool.&lt;/li&gt;
&lt;li&gt;-D = This will display a numbered list of all available interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What does the "any" interface mean?&lt;/strong&gt;&lt;br&gt;
The "any" interface is neither a physical nor a virtual network adapter. It is a special pseudo-interface used by tcpdump to listen on all available interfaces simultaneously.&lt;/p&gt;

&lt;p&gt;When you are not sure which interface traffic will come through (e.g., &lt;code&gt;eth0, wlan0, lo&lt;/code&gt;), you can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tcpdump -i any
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will capture traffic across all interfaces, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;eth0&lt;/code&gt;: Ethernet&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wlan0&lt;/code&gt;: Wireless&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lo&lt;/code&gt;: Loopback&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker0&lt;/code&gt; or &lt;code&gt;br-xxxx&lt;/code&gt;: Docker or bridge interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The limitation is, it cannot capture the link-layer header (e.g., Ethernet headers). So, if you need to inspect Ethernet frames, use a specific interface (e.g., &lt;code&gt;-i eth0&lt;/code&gt;) instead. Another limitation is that you won’t see MAC addresses when capturing on &lt;code&gt;any&lt;/code&gt; interface.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tcpdump -i any port 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This captures all &lt;code&gt;HTTP traffic&lt;/code&gt; on all interfaces. This is great for general network monitoring or troubleshooting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Inspect the network traffic of a network interface with tcpdump.
&lt;/h2&gt;

&lt;p&gt;The command-line tool &lt;code&gt;tcpdump&lt;/code&gt; is used to filter live network packet traffic on an interface. Let us filter live network packet data from the &lt;code&gt;eth0&lt;/code&gt; interface with &lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tcpdump -i eth0 -v -c5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;tcpdump&lt;/code&gt; with the following options or flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-i eth0&lt;/code&gt;: Capture data specifically from the eth0 interface.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v&lt;/code&gt;: Display detailed packet data.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-c5&lt;/code&gt;: Capture 5 packets of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fod6xkfwhcsgar8j0njkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fod6xkfwhcsgar8j0njkp.png" alt="Image description" width="722" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's take a detailed look at the packet information that this command has returned. Five packets were captured as pointed to by the numbered arrows, with each packet starting with a &lt;code&gt;time stamp&lt;/code&gt; (in Hours, Minutes, and Seconds, e.g. 06:37:28.000526), followed by the protocol type, &lt;code&gt;IP&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At the start of the packet output, tcpdump reported that it was listening on the &lt;code&gt;eth0&lt;/code&gt; interface, and it provided information on the &lt;code&gt;link type&lt;/code&gt; and the capture size in &lt;code&gt;bytes&lt;/code&gt;:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faiz2gjo3f5eespq6j1ic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faiz2gjo3f5eespq6j1ic.png" alt="Image description" width="674" height="35"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the first packet, which is highlighted in Red-Orange as pointed to by the 1st arrow, the first field is the packet's &lt;code&gt;timestamp&lt;/code&gt;, followed by the protocol type, &lt;code&gt;IP&lt;/code&gt;. The verbose option, &lt;code&gt;-v&lt;/code&gt;, has provided more details about the IP packet fields, such as &lt;code&gt;TOS, TTL, offset, flags&lt;/code&gt;, internal protocol type (in this case, &lt;code&gt;TCP (6)&lt;/code&gt;), and the &lt;code&gt;length&lt;/code&gt; of the outer IP packet in bytes:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0unsivf47e2rfyjbb8rk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0unsivf47e2rfyjbb8rk.png" alt="Image description" width="709" height="37"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The specific details about these fields are beyond the scope of this article. But you should know that these are properties that relate to the IP network packet. &lt;/p&gt;

&lt;p&gt;In the next section, the data shows the systems that are communicating with each other:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0bejaghellf1adhrgkf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0bejaghellf1adhrgkf.png" alt="Image description" width="667" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, &lt;code&gt;tcpdump&lt;/code&gt; will convert &lt;code&gt;IP addresses&lt;/code&gt; into &lt;code&gt;names&lt;/code&gt;, as in the screenshot. The name of your Linux virtual machine, also included in the command prompt, appears here as the source for one packet and the destination for the second packet. In your live data, the name will be a different set of letters and numbers.&lt;/p&gt;

&lt;p&gt;The direction of the arrow &lt;code&gt;&amp;gt;&lt;/code&gt; indicates the direction of the traffic flow in this packet. Each system name includes a suffix with the port number (&lt;code&gt;.5000&lt;/code&gt; in the screenshot), which is used by the source and the destination systems for this packet.&lt;/p&gt;

&lt;p&gt;The remaining data filters the header data for the inner TCP packet:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmk1r5suerf3wix1u50j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmk1r5suerf3wix1u50j1.png" alt="Image description" width="679" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;flags&lt;/code&gt; field identifies &lt;code&gt;TCP flags&lt;/code&gt;. In this case, the &lt;code&gt;P&lt;/code&gt; represents the &lt;code&gt;push&lt;/code&gt; flag, and the period &lt;code&gt;.&lt;/code&gt; indicates it's an &lt;code&gt;ACK&lt;/code&gt; flag. This means the packet is pushing out data.&lt;/p&gt;

&lt;p&gt;The next field is the &lt;code&gt;TCP checksum value&lt;/code&gt;, which is used for detecting errors in the data.&lt;/p&gt;

&lt;p&gt;This section also includes the &lt;code&gt;sequence&lt;/code&gt; and &lt;code&gt;acknowledgement numbers&lt;/code&gt;, the window &lt;code&gt;win&lt;/code&gt; size, and the &lt;code&gt;length&lt;/code&gt; of the inner TCP packet in bytes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Capture network traffic with tcpdump.
&lt;/h2&gt;

&lt;p&gt;Let's use &lt;code&gt;tcpdump&lt;/code&gt; to save the captured network data to a packet capture file.&lt;/p&gt;

&lt;p&gt;In the previous command, we used tcpdump to stream all network traffic. Here, we will use a filter and other tcpdump configuration options to save a small sample that contains only web &lt;code&gt;TCP port 80&lt;/code&gt; network packet data.&lt;/p&gt;

&lt;p&gt;Capture packet data into a file called &lt;code&gt;networktraffic.pcap&lt;/code&gt; using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tcpdump -i eth0 -nn -c9 port 80 -w networktraffic.pcap &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press the &lt;code&gt;ENTER&lt;/code&gt; key to get your command prompt back after running this command. Let us first of all run &lt;code&gt;ls -l&lt;/code&gt; to list out the files and directories currently in the home directory, as pointed out by the 1st arrow, there is only &lt;code&gt;sample.pcap&lt;/code&gt;. This command runs in the background, but some output text will appear in your terminal as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpg8l9z7lk84143n4rlc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpg8l9z7lk84143n4rlc.png" alt="Image description" width="720" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command will run tcpdump in the background with the following options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-i eth0&lt;/code&gt;: Capture data from the eth0 interface.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-nn&lt;/code&gt;: Do not attempt to resolve IP addresses or ports to names. This is best practice from a security perspective, as the lookup data may not be valid. It also prevents malicious actors from being alerted to an investigation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-c9&lt;/code&gt;: Capture 9 packets of data and then exit.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;port 80&lt;/code&gt;: Filter only port 80 traffic. This is the default HTTP port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-w networktraffic.pcap&lt;/code&gt;: Save the captured data to the named file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&lt;/code&gt;: This is an instruction to the Bash shell to run the command in the background.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notice that the &lt;code&gt;networktraffic.pcap&lt;/code&gt; file has been created as pointed to by the 3rd arrow above, but the file at this stage is empty because we have not currently generated any web traffic that will be captured into the file; this is why the &lt;code&gt;value&lt;/code&gt; of &lt;code&gt;networktraffic.pcap file length is currently&lt;/code&gt;empty&lt;code&gt;or&lt;/code&gt;zero 0&lt;code&gt;, circled in&lt;/code&gt;yellow&lt;code&gt;. Remember, the command above is an instruction for web traffic (&lt;/code&gt;port 80&lt;code&gt;) to be captured from the&lt;/code&gt;eth0&lt;code&gt;network interface into&lt;/code&gt;networktraffic.pcap` file.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;curl&lt;/code&gt; to generate some HTTP (&lt;code&gt;port 80&lt;/code&gt;) traffic. When the curl command&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
curl kc7cyber.com&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;is used like this to open a website; it generates some HTTP (&lt;code&gt;TCP port 80&lt;/code&gt;) traffic that can be captured as pointed to by the 4th arrow.&lt;/p&gt;

&lt;p&gt;To verify that packet data has been captured after running &lt;code&gt;curl kc7cyber.com&lt;/code&gt;, run the command &lt;code&gt;ls -l capture.pcap&lt;/code&gt; and this will return the output pointed to by the fifth arrow above, but notice that the value &lt;code&gt;zero 0&lt;/code&gt; circled in &lt;code&gt;yellow colour&lt;/code&gt; as pointed to by the third arrow has now changed to &lt;code&gt;977&lt;/code&gt; circled in &lt;code&gt;blue colour&lt;/code&gt;, this implies that the command &lt;code&gt;curl kc7cyber.com&lt;/code&gt; generated some HTTP (&lt;code&gt;port 80&lt;/code&gt;) traffic and was captured into our &lt;code&gt;networktraffic.pcap&lt;/code&gt; file that is running in the background: &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Filter the captured packet data.
&lt;/h2&gt;

&lt;p&gt;Let's use tcpdump to filter data from the packet capture file we saved previously in &lt;code&gt;Step 3 above&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use the tcpdump command, this time without the option &lt;code&gt;-v&lt;/code&gt;, i.e. verbose.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
sudo tcpdump -nn -r networktraffic.pcap&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to filter the packet header data from the &lt;code&gt;networktraffic.pcap&lt;/code&gt; capture file. You will notice that no detailed information about IP is presented here, and the output return is a bit less compared to when we use the &lt;code&gt;-v&lt;/code&gt; option/flag. As pointed to by the 1st arrow, tcpdump is reading the packets from the packets saved in &lt;code&gt;networktraffic.pcap&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fov1z754er11g9li7ps3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fov1z754er11g9li7ps3e.png" alt="Image description" width="714" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command will run tcpdump with the following options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-nn&lt;/code&gt;: Disable port and protocol name lookup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-r&lt;/code&gt;: Read capture data from the named file, i.e. networktraffic.pcap.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the &lt;code&gt;-v&lt;/code&gt; option was included, it would have displayed detailed packet data.&lt;/p&gt;

&lt;p&gt;You must specify the &lt;code&gt;-nn&lt;/code&gt; switch again here, as you want to make sure tcpdump does not perform name lookups of either &lt;code&gt;IP addresses&lt;/code&gt; or &lt;code&gt;ports&lt;/code&gt;, since this can alert threat actors.&lt;/p&gt;

&lt;p&gt;Use the tcpdump command &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
sudo tcpdump -nn -r capture.pcap -X&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to filter the extended packet data as pointed to by the 3rd arrow from the &lt;code&gt;networktraffic.pcap&lt;/code&gt; capture file.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ful59cf321fmayq3bpged.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ful59cf321fmayq3bpged.png" alt="Image description" width="711" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command will run tcpdump with the following options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-nn&lt;/code&gt;: Disable port and protocol name lookup.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-r&lt;/code&gt;: Read capture data from the named file i.e &lt;code&gt;networktraffic.pcap&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-X&lt;/code&gt;: Display the hexadecimal and ASCII output format packet data. Security analysts can analyse hexadecimal and ASCII output to detect patterns or anomalies during malware analysis or forensic analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Hexadecimal, also known as hex or base 16, uses 16 symbols to represent values, including the digits 0-9 and letters A, B, C, D, E, and F. American Standard Code for Information Interchange (ASCII) is a character encoding standard that uses a set of characters to represent text in digital form.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summary.
&lt;/h2&gt;

&lt;p&gt;This article explains how to use the network protocol analyser command line tool &lt;code&gt;tcpdump&lt;/code&gt; to capture and analyse network traffic. First, we identify a network interface, then use tcpdump to filter and capture live network traffic. We explain the tcpdump command and its options, and how to interpret the output. Lastly, we explain how to save captured network data to a file and filter the data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/analyse-packets-with-tcpdump" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/analyse-packets-with-tcpdump&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>security</category>
      <category>network</category>
    </item>
    <item>
      <title>Kali Linux Users Account Management.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Mon, 16 Jun 2025 09:58:23 +0000</pubDate>
      <link>https://forem.com/agbuenoch/kali-linux-users-account-management-3nbl</link>
      <guid>https://forem.com/agbuenoch/kali-linux-users-account-management-3nbl</guid>
      <description>&lt;p&gt;This project implements how to securely manage user accounts in Kali, including changing login credentials, creating new users, switching between shells and users, renaming users, deleting users, and locking/unlocking passwords and login shells.&lt;/p&gt;

&lt;p&gt;User account management is a foundational skill for anyone working with Kali Linux, whether you're a cybersecurity student, penetration tester, or ethical hacker. This project explores how to securely manage user accounts in Kali, from creating and renaming users to disabling logins and deleting users. While Kali is built for offensive security, proper user control is essential to maintain a secure and organised environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: How to Change Login Credentials.
&lt;/h2&gt;

&lt;p&gt;The default username and password that come preinstalled with the Kali Linux pre-built image are kali and kali, respectively. Let's change the password to something more secure while we maintain the username kali.&lt;/p&gt;

&lt;p&gt;Open the Kali Linux terminal by clicking on the terminal as pointed to by the 1st arrow. The username and host/machine name is &lt;code&gt;kali&lt;/code&gt; and &lt;code&gt;kali&lt;/code&gt; as pointed to by the 2nd and 3rd arrow, respectively. Run &lt;code&gt;whoami&lt;/code&gt; to check/view the current user logged in as pointed to by the 4th arrow.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;passwd&lt;/code&gt; to change the kali username password by providing the current password and then the new password. The 5th arrow points out that the password was changed successfully.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv347hq4y32sc3rwkiszk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv347hq4y32sc3rwkiszk.png" alt="Image description" width="694" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The password for the kali username is now changed from &lt;code&gt;kali&lt;/code&gt; to the new password we provided.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check if the current user can elevate to root privileges.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run either the commands &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;groups&lt;/code&gt;, or &lt;code&gt;groups kali&lt;/code&gt;. You'll see something like this below as pointed to by the 1st arrow:&lt;br&gt;&lt;br&gt;
&lt;code&gt;uid=1000(kali) gid=1000(kali) groups=1000(kali),27(sudo)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uid=0 refers to a root user.&lt;/li&gt;
&lt;li&gt;uid=1000 and above refers to a regular user.
But if &lt;code&gt;sudo&lt;/code&gt; appears in the groups as pointed to by the 2nd arrow, it means this regular user can elevate its privileges, i.e it can use the &lt;code&gt;sudo&lt;/code&gt; command and operate with root privileges.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdl1a8h2wmv8x4zlrz1sw.png" alt="Image description" width="800" height="240"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Create New Users.
&lt;/h2&gt;

&lt;p&gt;Let's view the current list of all users before we create new ones. Run &lt;code&gt;ls /home&lt;/code&gt; to print out a list of all users in this Kali Linux system. As pointed out by the 1st arrow, there is currently only one user, which is &lt;code&gt;kali&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcxkopsixhevjk17gkgkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcxkopsixhevjk17gkgkc.png" alt="Image description" width="689" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, we can run &lt;code&gt;cat /etc/passwd&lt;/code&gt; to view detailed user information like the group and shells they belong to, compared to just listing the username as shown above. In Kali Linux, like all Linux distributions, all local users are listed in the system file.&lt;/p&gt;

&lt;p&gt;The path &lt;code&gt;/etc/passwd&lt;/code&gt; contains the list of all users. This file contains a record of every user account on the system. From the screenshot below, the 1st arrow points to three user account &lt;code&gt;root, daemon, and bin&lt;/code&gt;. As underlined, the &lt;code&gt;root&lt;/code&gt; user's home directory is &lt;code&gt;/root&lt;/code&gt; and uses &lt;code&gt;zsh&lt;/code&gt; as its login shell (this is one among many shell types like &lt;code&gt;bash, fsh, and ksh&lt;/code&gt;). Where you see &lt;code&gt;/nologin&lt;/code&gt; means that the user's login shell has been locked or disabled and cannot log in to the system.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp5b986z8xyse20qd13i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp5b986z8xyse20qd13i.png" alt="Image description" width="708" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 2nd arrow points to another user called &lt;code&gt;kali&lt;/code&gt;, the 3rd and 4th arrows point to the kali home directory and default login shell, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2el71jri47czc04qxmj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2el71jri47czc04qxmj8.png" alt="Image description" width="800" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each user is on a separate line with fields separated by colons &lt;code&gt;:&lt;/code&gt; in this format below.&lt;br&gt;&lt;br&gt;
&lt;code&gt;username : password : UID : GID : comment : home_directory : login_shell&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The table below explains the components of the kali username information above as pointed to by the 2nd, 3rd and 4th arrows.&lt;br&gt;&lt;br&gt;
| &lt;strong&gt;Fields&lt;/strong&gt; | &lt;strong&gt;Descriptions&lt;/strong&gt; |&lt;br&gt;
|------------|------------------|&lt;br&gt;
| kali       | Username         |&lt;br&gt;
| x          | Password placeholder (actual password is in /etc/shadow) |&lt;br&gt;
| 1000       | UID (If user ID = 0, it’s a root user, if ID=1000+ it’s a normal/regular user), 1000  GID (Group ID) |&lt;br&gt;
| ,,,        | Description/Comment (optional) |&lt;br&gt;
| /home/kali | Home directory |&lt;br&gt;
| /bin/zsh           | Default login shell |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Kali recently switched its default shell from &lt;code&gt;bash&lt;/code&gt; to &lt;code&gt;zsh&lt;/code&gt; to give users more power and flexibility.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fninh4lvgfy3x0zrgdq6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fninh4lvgfy3x0zrgdq6v.png" alt="Image description" width="604" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8t90o960cusb88jhw8t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8t90o960cusb88jhw8t.png" alt="Image description" width="604" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can switch between shells at any time.&lt;/strong&gt;&lt;br&gt;
Let's use the &lt;code&gt;demouser&lt;/code&gt; to switch between the shells. Run &lt;code&gt;echo $SHELL&lt;/code&gt; to view the &lt;code&gt;demouser&lt;/code&gt; login shell as pointed to by the 1st arrow. Run &lt;code&gt;chsh -s /bin/zsh&lt;/code&gt; to change the &lt;code&gt;demouser&lt;/code&gt; login shell from &lt;code&gt;bash&lt;/code&gt; to &lt;code&gt;zsh&lt;/code&gt; as pointed to by the 2nd arrow, and you will be prompted for the &lt;code&gt;demouser&lt;/code&gt; password.&lt;/p&gt;

&lt;p&gt;To apply the changes, log out from the &lt;code&gt;demouser&lt;/code&gt; as pointed by the 3rd arrow. The 4th arrow points to &lt;code&gt;kali&lt;/code&gt; user after logging out from the &lt;code&gt;demouser&lt;/code&gt;. Let’s log back in to &lt;code&gt;demouser&lt;/code&gt; as pointed to by the 5th arrow. The 6th arrow points to the &lt;code&gt;demouser&lt;/code&gt; currently logged in. Run &lt;code&gt;echo $SHELL&lt;/code&gt; again to view that the shell has been changed successfully as pointed to by the 7th arrow&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwxwtitpmo825k2u7nu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwxwtitpmo825k2u7nu8.png" alt="Image description" width="796" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, the &lt;code&gt;demouser&lt;/code&gt; login shell is  &lt;code&gt;zsh&lt;/code&gt; as pointed to by the 1st arrow. Run &lt;code&gt;chsh -s /bin/bash&lt;/code&gt; to change the shell to &lt;code&gt;bash&lt;/code&gt;, the rest of the steps are similar to the steps just explained above. Logout by running &lt;code&gt;exit&lt;/code&gt; and re-log in to the &lt;code&gt;demouser&lt;/code&gt;, run &lt;code&gt;echo $SHELL&lt;/code&gt; to confirm the changes have been applied.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpu6p3rh5rb0m0w4gnb1j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpu6p3rh5rb0m0w4gnb1j.png" alt="Image description" width="768" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where Are Passwords Stored?&lt;/strong&gt;&lt;br&gt;
Passwords are not stored in &lt;code&gt;/etc/passwd&lt;/code&gt; for security. Instead, they’re kept in &lt;code&gt;/etc/shadow&lt;/code&gt;, readable only by the &lt;code&gt;root&lt;/code&gt; user. To view it, run &lt;code&gt;sudo cat /etc/shadow&lt;/code&gt;, you’ll see encrypted password hashes.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl78r5cs0iq5n9ck6x7yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl78r5cs0iq5n9ck6x7yu.png" alt="Image description" width="603" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, let's create two new users, &lt;code&gt;demouser&lt;/code&gt; and &lt;code&gt;adminuser&lt;/code&gt; and add &lt;code&gt;adminuser&lt;/code&gt; to the &lt;code&gt;sudo&lt;/code&gt; group, making it an admin/super user. By this, &lt;code&gt;adminuser&lt;/code&gt; can use the &lt;code&gt;sudo&lt;/code&gt; command and root user privileges. Ensure the usernames are spelt in lowercase letters.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo adduser &amp;lt;username&amp;gt;&lt;/code&gt; to create a new user. Each new user created would be assigned a User ID (&lt;code&gt;UID&lt;/code&gt;) and Group ID (&lt;code&gt;GID&lt;/code&gt;) ranging between &lt;code&gt;1000&lt;/code&gt; and &lt;code&gt;59999&lt;/code&gt;, as pointed to by the 1st arrow. A home directory of &lt;code&gt;/home/&amp;lt;username&amp;gt;&lt;/code&gt; would be created for the new user as pointed to by the 2nd arrow. You will be prompted to set a password for the user as pointed to by the 3rd arrow. You have other information like the user's full name, which is optional, and you can press the &lt;code&gt;ENTER&lt;/code&gt; key as pointed to by the 4th arrow to skip each entry.&lt;/p&gt;

&lt;p&gt;For every new user created, a group bearing the same name as the username will be created, and the new user will be added to that group and also to an additional group called &lt;code&gt;users&lt;/code&gt;. Therefore, &lt;code&gt;demouser&lt;/code&gt; is added to a group called &lt;code&gt;demouser&lt;/code&gt; and &lt;code&gt;users&lt;/code&gt;, as pointed to by the 5th and 6th arrows, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9gr4rgso8iev2fr4s4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9gr4rgso8iev2fr4s4i.png" alt="Image description" width="799" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apply the same step above to create &lt;code&gt;adminuser&lt;/code&gt;, and notice that &lt;code&gt;adminuser&lt;/code&gt; is added to a group called &lt;code&gt;adminuser&lt;/code&gt; and &lt;code&gt;users&lt;/code&gt;, as pointed to by the 5th arrow and 6th arrows, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9yygcl8ve33es0fl51n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9yygcl8ve33es0fl51n.png" alt="Image description" width="778" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo cat /etc/passwd&lt;/code&gt; to view the two new users we created above. The 1st arrow points to the users we created, and the underlined &lt;code&gt;/bash&lt;/code&gt; is the default login shell for the users.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foptd2y3fxyrgav2tuw7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foptd2y3fxyrgav2tuw7l.png" alt="Image description" width="718" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the screenshot below, we are currently operating as &lt;code&gt;kali&lt;/code&gt; user. Run &lt;code&gt;echo $SHELL&lt;/code&gt; to view the user login shell, which is &lt;code&gt;zsh&lt;/code&gt; as pointed to by the 1st arrow.&lt;/p&gt;

&lt;p&gt;The 2nd and 3rd arrows point to all the groups user kali is a member of, among the groups is &lt;code&gt;sudo&lt;/code&gt;, which means user &lt;code&gt;kali&lt;/code&gt; can switch to a root user capability.&lt;/p&gt;

&lt;p&gt;The 4th and 5th arrows point to the groups &lt;code&gt;demouser&lt;/code&gt; is a member of. Because &lt;code&gt;sudo&lt;/code&gt; is not listed, the user &lt;code&gt;demouser&lt;/code&gt; cannot use &lt;code&gt;sudo&lt;/code&gt; command or switch to a root user capability.&lt;/p&gt;

&lt;p&gt;The 6th and 7th arrows point to the groups the &lt;code&gt;adminuser&lt;/code&gt; is a member of. At the moment, it cannot assume a &lt;code&gt;root&lt;/code&gt; capability or privileges because it does not belong to the &lt;code&gt;sudo&lt;/code&gt; group. Notice that the group called &lt;code&gt;sudo&lt;/code&gt; is not listed among the groups.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91mtcsifi563z67cpk61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91mtcsifi563z67cpk61.png" alt="Image description" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can run the command &lt;code&gt;groups&lt;/code&gt; to see all the groups the current user &lt;code&gt;kali&lt;/code&gt; belongs to, as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyrbos3qaio61awswfdo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyrbos3qaio61awswfdo.png" alt="Image description" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s make &lt;code&gt;adminuser&lt;/code&gt; a root user. This will enable the &lt;code&gt;adminuser&lt;/code&gt; to be able to assume a super/root user capability, which is to be able to run the &lt;code&gt;sudo&lt;/code&gt; command, so let's add the &lt;code&gt;adminuser&lt;/code&gt; to the &lt;code&gt;sudo&lt;/code&gt; group. As pointed by the 1st arrow, provide the password of the user &lt;code&gt;kali&lt;/code&gt; running the &lt;code&gt;sudo&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;After adding &lt;code&gt;adminuser&lt;/code&gt; to the &lt;code&gt;sudo&lt;/code&gt; group, run &lt;code&gt;groups adminuser&lt;/code&gt;, notice the &lt;code&gt;sudo&lt;/code&gt; group have been added to the list of groups it belongs to, as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqes946wtlzugqtkviki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqes946wtlzugqtkviki.png" alt="Image description" width="737" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Command Breakdown:&lt;br&gt;
&lt;code&gt;sudo&lt;/code&gt; means run the command as a superuser (admin privileges).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;usermod&lt;/code&gt; stands for user modify – it lets you change user account settings.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-a&lt;/code&gt; means append (don’t remove them from other groups). &lt;code&gt;-G&lt;/code&gt; means Group (you’re specifying the group(s) the user should belong to).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; The group you're adding the user to — on Debian-based systems like Kali, the &lt;code&gt;sudo&lt;/code&gt; group permits its members to run sudo commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;adminuser&lt;/code&gt; This is the username of the account you're giving sudo access to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Switch between users.
&lt;/h2&gt;

&lt;p&gt;Run the command &lt;code&gt;su - &amp;lt;username&amp;gt;&lt;/code&gt; to switch between users. You'll be prompted for that user’s password. The dash &lt;code&gt;-&lt;/code&gt; loads the user’s full environment (like their shell settings).&lt;/p&gt;

&lt;p&gt;Run the command &lt;code&gt;sudo su -&lt;/code&gt; or &lt;code&gt;sudo -i&lt;/code&gt; to switch from any user that has root privileges to the &lt;code&gt;default root user&lt;/code&gt; (which always appears in &lt;code&gt;red&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;But switching to the &lt;code&gt;default root user&lt;/code&gt; from a &lt;code&gt;regular user&lt;/code&gt; who does not have root privileges (i.e does not belong to the &lt;code&gt;sudo&lt;/code&gt; group), just run &lt;code&gt;su -&lt;/code&gt;, and you will be required to provide the &lt;code&gt;default root user&lt;/code&gt; password, which by default does not exist unless you set it. Therefore, we will stick to this command: &lt;code&gt;sudo su -&lt;/code&gt; or &lt;code&gt;sudo -i&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;To switch to a &lt;code&gt;default root user&lt;/code&gt;, you will be prompted for the current user password and NOT the &lt;code&gt;default root user&lt;/code&gt; password because it has no password set by default.&lt;/p&gt;

&lt;p&gt;Let's switch to the user called &lt;code&gt;root&lt;/code&gt; (i.e the &lt;code&gt;default root user&lt;/code&gt;). As pointed to by the 1st arrow, you’ll be prompted for the &lt;code&gt;kali&lt;/code&gt; user's password, not &lt;code&gt;root's&lt;/code&gt; password (because root may not have a password set by default). A super/root privilege is required, hence, we must use sudo to run &lt;code&gt;su -&lt;/code&gt;, as shown below. And because the user &lt;code&gt;kali&lt;/code&gt; belongs to the &lt;code&gt;sudo&lt;/code&gt; group, the &lt;code&gt;sudo&lt;/code&gt; command can be used by the kali user.&lt;/p&gt;

&lt;p&gt;After switching to the &lt;code&gt;default root user&lt;/code&gt;, run the &lt;code&gt;pwd&lt;/code&gt; to print the working directory, which is now &lt;code&gt;/root&lt;/code&gt; as pointed to by the 2nd arrow.&lt;/p&gt;

&lt;p&gt;To switch back to a regular user, run &lt;code&gt;su - &amp;lt;username&amp;gt;&lt;/code&gt;, as pointed to by the 4th arrow, we are back to the &lt;code&gt;kali&lt;/code&gt; user.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwd4cnb9ijlwnskdr0pq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwd4cnb9ijlwnskdr0pq.png" alt="Image description" width="735" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, Kali does not enable the &lt;code&gt;default root&lt;/code&gt; account with a password anymore. Therefore, if you try switching to &lt;code&gt;default root user&lt;/code&gt; by running the command &lt;code&gt;su -&lt;/code&gt; as pointed out by the 1st arrow, you will be asked for the `&lt;code&gt;default root user&lt;/code&gt; password as pointed out by the 2nd arrow, which is NOT enabled by default. Therefore, the authentication will fail as pointed out by the 3rd arrow, since there is no password previously set for it.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l6otarh44d124s6gsvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l6otarh44d124s6gsvg.png" alt="Image description" width="769" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can manually set the &lt;code&gt;default root user&lt;/code&gt; password using &lt;code&gt;sudo passwd root&lt;/code&gt;, You’ll be prompted to enter and confirm a new root password. After that, we can switch to the &lt;code&gt;default root user&lt;/code&gt; by running &lt;code&gt;su -&lt;/code&gt; without using sudo. But this is not recommended for daily use. The best practice is to use &lt;code&gt;sudo&lt;/code&gt; with a regular user instead of logging in as root directly, for security and auditing.&lt;/p&gt;

&lt;p&gt;On this premise, because the &lt;code&gt;kali&lt;/code&gt; user has &lt;code&gt;sudo&lt;/code&gt; privileges (belongs to the &lt;code&gt;sudo&lt;/code&gt; group), for best security practice, we will use &lt;code&gt;sudo&lt;/code&gt; to switch or log in to the &lt;code&gt;default root user&lt;/code&gt; by running &lt;code&gt;sudo su -&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So far, from the users we created, we can only switch to the &lt;code&gt;default root user&lt;/code&gt; from the &lt;code&gt;kali&lt;/code&gt; and &lt;code&gt;adminuser&lt;/code&gt; users using &lt;code&gt;sudo&lt;/code&gt; because they belong to the &lt;code&gt;sudo&lt;/code&gt; group.&lt;/p&gt;

&lt;p&gt;But once we've set a password for the &lt;code&gt;default root&lt;/code&gt; account (which is not recommended), we can absolutely use just &lt;code&gt;su -&lt;/code&gt; command from any regular user account to switch to the &lt;code&gt;default root user&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you’re logged in as one user and want to go back to your previous user session, just run &lt;code&gt;exit&lt;/code&gt; to log out or &lt;code&gt;su - &amp;lt;username&amp;gt; without logging out from the current user session. The&lt;/code&gt;-` loads the user’s full environment (like their shell settings).&lt;/p&gt;

&lt;p&gt;Alternatively, you can switch to the &lt;code&gt;default root user&lt;/code&gt; with &lt;code&gt;sudo -i&lt;/code&gt; as pointed to by the 1st arrow. After providing the current user password, we are logged in as the root user, which appears in red. Exit the &lt;code&gt;default root user&lt;/code&gt; by running &lt;code&gt;exit&lt;/code&gt; as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonif8vtt8ouojpdcmrbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonif8vtt8ouojpdcmrbp.png" alt="Image description" width="658" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's verify that the &lt;code&gt;adminuser&lt;/code&gt; now has &lt;code&gt;sudo&lt;/code&gt; privileges. As pointed out by the 1st arrow, switch to the &lt;code&gt;adminuser&lt;/code&gt;. Remember that &lt;code&gt;adminuser&lt;/code&gt; is a regular user who can elevate to &lt;code&gt;root&lt;/code&gt; user/privilege. Therefore, if you run just &lt;code&gt;whoami&lt;/code&gt;, it will return the regular username &lt;code&gt;adminuser&lt;/code&gt; as pointed to by the 2nd and 3rd arrows. The command &lt;code&gt;pwd&lt;/code&gt; will print the current working directory as pointed out by the 4th arrow. Meanwhile, if you run &lt;code&gt;sudo whoami&lt;/code&gt;, it will return the &lt;code&gt;root&lt;/code&gt; username as pointed to by the 5th arrow. Therefore, it is confirmed that &lt;code&gt;adminuser&lt;/code&gt; can elevate to a &lt;code&gt;root&lt;/code&gt; user/privileges.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zzcmr3oa69cenmh4ra7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zzcmr3oa69cenmh4ra7.png" alt="Image description" width="760" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember the user &lt;code&gt;kali&lt;/code&gt; is a regular user as pointed to  by the 2nd arrow, who is also a member of &lt;code&gt;sudo&lt;/code&gt; group as pointed to by the 1st arrow, which means it can elevate to a &lt;code&gt;root&lt;/code&gt; user/privileges as pointed to  by the 3rd arrow, just like the &lt;code&gt;adminuser&lt;/code&gt; we created above.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqckw4vop1wssje22m4d0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqckw4vop1wssje22m4d0.png" alt="Image description" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s try using a root user privilege like running the command &lt;code&gt;sudo&lt;/code&gt; with a user that is &lt;strong&gt;NOT&lt;/strong&gt; in a &lt;code&gt;sudo&lt;/code&gt; group, like &lt;code&gt;demouser&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Switch to the &lt;code&gt;demouser&lt;/code&gt; as pointed to by the 1st arrow. We run &lt;code&gt;pwd&lt;/code&gt; to see the current user we are operating as, pointed to by the 2nd arrow. The 3rd arrow points to the group &lt;code&gt;demouser&lt;/code&gt; is a member of; notice &lt;code&gt;sudo&lt;/code&gt; is not listed. As pointed out by the 4th arrow, we tried using &lt;code&gt;sudo&lt;/code&gt; command but because the current user &lt;code&gt;demouser&lt;/code&gt; is not a member of the &lt;code&gt;sudo&lt;/code&gt; group, we get the warning message pointed to by the 5th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6cgymsmtm749m2qflhls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6cgymsmtm749m2qflhls.png" alt="Image description" width="779" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Renaming a user.
&lt;/h2&gt;

&lt;p&gt;We can change the &lt;code&gt;adminuser&lt;/code&gt; name to something else, but it involves more than just renaming the user. We also need to update the home directory and permissions properly to avoid login issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s go step-by-step to safely rename the adminuser to myadmin.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;⚠️ Important:&lt;/strong&gt; Don’t do this while logged in as the &lt;code&gt;adminuser&lt;/code&gt; user. First, create another temporary admin user called &lt;code&gt;tmpadmin&lt;/code&gt;, and log in as &lt;code&gt;tmpadmin&lt;/code&gt; to perform the renaming.&lt;/p&gt;

&lt;p&gt;Create a new user, &lt;code&gt;tmpadmin&lt;/code&gt;, following the same steps as done in &lt;strong&gt;Step 2 above&lt;/strong&gt;. The &lt;code&gt;tmpadmin&lt;/code&gt; user will be placed inside both the &lt;code&gt;tmpadmin&lt;/code&gt; and &lt;code&gt;users&lt;/code&gt; groups as pointed to by the 3rd and 7th arrows.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxwmprub7tgr722co3v8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxwmprub7tgr722co3v8.png" alt="Image description" width="778" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the new user, &lt;code&gt;tmpadmin&lt;/code&gt;, run &lt;code&gt;sudo cat /etc/passwd&lt;/code&gt; to verify the user &lt;code&gt;adminuser&lt;/code&gt; is listed as pointed to by the 1st arrow with the home directory and default login shell underlined.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7o3wwhothd90ubayttl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7o3wwhothd90ubayttl.png" alt="Image description" width="737" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;tmpadmin&lt;/code&gt; created above is a regular user; let's add it to the &lt;code&gt;sudo&lt;/code&gt; group so that it can be able to run the &lt;code&gt;sudo&lt;/code&gt; command and elevate to &lt;code&gt;root&lt;/code&gt; user/privileges. Run &lt;code&gt;sudo usermod -aG sudo tmpadmin&lt;/code&gt; as pointed to by the 1st arrow. Notice that &lt;code&gt;sudo&lt;/code&gt; is now listed among the groups, &lt;code&gt;tmpadmin&lt;/code&gt; is a member of, as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu31xul6pns7pucv1gnzf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu31xul6pns7pucv1gnzf.png" alt="Image description" width="644" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s run &lt;code&gt;whoami&lt;/code&gt; and &lt;code&gt;pwd&lt;/code&gt; to show the &lt;code&gt;adminuser&lt;/code&gt; username and home directory, respectively, before renaming. First, let’s switch to the &lt;code&gt;adminuser&lt;/code&gt; as pointed to by the 1st arrow to provide its password. We have successfully switched to the &lt;code&gt;adminuser&lt;/code&gt; as pointed to by the 2nd arrow. Because &lt;code&gt;adminuser&lt;/code&gt; is a regular user and can elevate to a &lt;code&gt;root&lt;/code&gt; user/privileges, when you run &lt;code&gt;whoami&lt;/code&gt; and &lt;code&gt;sudo whoami&lt;/code&gt;, it will return the username &lt;code&gt;adminuser&lt;/code&gt; (i.e the regular username) and &lt;code&gt;root&lt;/code&gt; (i.e the &lt;code&gt;root&lt;/code&gt; username) respectively as pointed to by the 3rd and 4th arrow. &lt;code&gt;pwd&lt;/code&gt; will print the regular username &lt;code&gt;adminuser&lt;/code&gt; working directory as pointed to by the 5th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5qernns8vyu5fjr02er.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5qernns8vyu5fjr02er.png" alt="Image description" width="694" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Completely log out from the &lt;code&gt;adminuser&lt;/code&gt; by running &lt;code&gt;exit&lt;/code&gt; as pointed to by the 1st arrow, before switching or logging in to &lt;code&gt;tmpadmin&lt;/code&gt;. Run &lt;code&gt;ls /home&lt;/code&gt; to print out all the current users on the Kali Linux system as pointed to by the 2nd arrow. Let’s log in to the temporary admin we created, &lt;code&gt;tmpadmin&lt;/code&gt;, as pointed to by the 3rd arrow. Notice we switch to &lt;code&gt;tmpadmin&lt;/code&gt; using &lt;code&gt;su - tmpadmin&lt;/code&gt; without using the &lt;code&gt;sudo&lt;/code&gt; command, this is because the &lt;code&gt;tmpadmin&lt;/code&gt;, unlike the &lt;code&gt;default root user&lt;/code&gt; that came with Kali Linux, has a password set for it when we were creating it. After running the command, we are prompted for the &lt;code&gt;tmpadmin&lt;/code&gt; password. As pointed out by the 4th and 5th arrow, run &lt;code&gt;whoami&lt;/code&gt; and &lt;code&gt;sudo whoami&lt;/code&gt; to view the regular and root username, which are &lt;code&gt;tmpadmin&lt;/code&gt; and &lt;code&gt;root&lt;/code&gt;, respectively.&lt;/p&gt;

&lt;p&gt;The goal is to rename the underlined username &lt;code&gt;adminuser&lt;/code&gt; pointed to by the 2nd arrow to &lt;code&gt;myadmin&lt;/code&gt; and move/rename the home directory from &lt;code&gt;/home/adminuser&lt;/code&gt; to &lt;code&gt;/home/myadmin&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb82v9e5rbe7oty3vbbo4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb82v9e5rbe7oty3vbbo4.png" alt="Image description" width="768" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo usermod -l myadmin adminuser&lt;/code&gt; to rename the username &lt;code&gt;adminuser&lt;/code&gt; to &lt;code&gt;myadmin&lt;/code&gt; as pointed to by the 1st arrow. Run &lt;code&gt;sudo mv /home/adminuser /home/myadmin&lt;/code&gt; to move the username adminuser's home directory &lt;code&gt;/home/adminuser&lt;/code&gt; to myadmin's home directory &lt;code&gt;/home/myadmin&lt;/code&gt; as pointed to by the 2nd arrow, and update the home directory Info for the user by running &lt;code&gt;sudo usermod -d /home/myadmin -m myadmin&lt;/code&gt; as pointed to by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ti7twxw4ms9wtwd1b5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ti7twxw4ms9wtwd1b5z.png" alt="Image description" width="762" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-d&lt;/code&gt; = new home directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-m&lt;/code&gt; = move contents from the old home.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After applying all the changes, verify everything works. Run &lt;code&gt;ls /home&lt;/code&gt; to list all the usernames. As pointed out by the 1st arrow, the &lt;code&gt;adminuser&lt;/code&gt; has been renamed to &lt;code&gt;myadmin&lt;/code&gt; as shown underlined. The command &lt;code&gt;id &amp;lt;username&amp;gt;&lt;/code&gt; confirmed all the changes have been applied correctly, as shown underlined and pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F752l9cw829mlgsqbyfdn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F752l9cw829mlgsqbyfdn.png" alt="Image description" width="764" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;exit&lt;/code&gt; to log out from &lt;code&gt;tmpadmin&lt;/code&gt; as pointed to by the 1st arrow, this returns us to the previous user session, which is &lt;code&gt;kali&lt;/code&gt; as pointed to by the &lt;code&gt;A arrow&lt;/code&gt;, since it was from &lt;code&gt;kali&lt;/code&gt; we previously moved to &lt;code&gt;tmpadmin&lt;/code&gt;. Log in to &lt;code&gt;myadmin&lt;/code&gt; as pointed to by the 2nd arrow, the &lt;code&gt;B arrow&lt;/code&gt; shows we are now logged in as &lt;code&gt;myadmin&lt;/code&gt;. Run &lt;code&gt;whoami&lt;/code&gt; to confirm the username &lt;code&gt;adminuser&lt;/code&gt; has changed to &lt;code&gt;myadmin&lt;/code&gt; and &lt;code&gt;sudo whoami&lt;/code&gt; to ensure it still returns &lt;code&gt;root&lt;/code&gt; as pointed to by the 3rd and 4th arrow, respectively. Run &lt;code&gt;pwd&lt;/code&gt; as pointed to by the 5th arrow to confirm the home directory has also been moved/renamed to &lt;code&gt;/home/myadmin&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13chm8dywofhm0xx3ypw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13chm8dywofhm0xx3ypw.png" alt="Image description" width="770" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Delete a user.
&lt;/h2&gt;

&lt;p&gt;Let’s remove or delete the temporary admin user, &lt;code&gt;tmpadmin&lt;/code&gt;, that we created above in &lt;code&gt;Step 4&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo deluser --remove-home &amp;lt;username&amp;gt;&lt;/code&gt; to delete any specified user. The 1st arrow points to the info removing the &lt;code&gt;tmpadmin&lt;/code&gt; user. Run &lt;code&gt;ls /home&lt;/code&gt; to list all users, and as pointed to by the 2nd arrow, the &lt;code&gt;tmpadmin&lt;/code&gt; user is no longer listed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dgl53mctbm19vpi07dg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dgl53mctbm19vpi07dg.png" alt="Image description" width="687" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reboot to Apply all the Changes.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run &lt;code&gt;sudo reboot&lt;/code&gt; and wait for a few seconds to reboot the system as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmk8rh1j9j1w07b5y5dk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmk8rh1j9j1w07b5y5dk.png" alt="Image description" width="674" height="181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Lock a user.
&lt;/h2&gt;

&lt;p&gt;Locking a user account in Linux (including Kali) prevents a user from logging in, without deleting the user or their files. This is useful for suspending access temporarily.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo usermod -L &amp;lt;username&amp;gt;&lt;/code&gt; to lock/disable a user account/password. This will prepend an exclamation mark ! to the password hash in /etc/shadow.&lt;/p&gt;

&lt;p&gt;Let's view the &lt;code&gt;/etc/shadow&lt;/code&gt; before locking the demouser account. We are currently operating as a &lt;code&gt;Kali&lt;/code&gt; user. Run the command &lt;code&gt;sudo cat/etc/shadow&lt;/code&gt; and provide the &lt;code&gt;sudo&lt;/code&gt; password for &lt;code&gt;Kali&lt;/code&gt;, as pointed to by the first arrow, to view hashed passwords for all users. The 2nd arrow points to the &lt;code&gt;demouser's&lt;/code&gt; hashed password. Notice there is no exclamation mark &lt;code&gt;!&lt;/code&gt; placed at the beginning of the hashed password in &lt;code&gt;field 2&lt;/code&gt;, immediately after &lt;code&gt;kali:&lt;/code&gt; in &lt;code&gt;field 1&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdmkjdcin5r42mg6doel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdmkjdcin5r42mg6doel.png" alt="Image description" width="714" height="190"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0nbkhrw87oknig4zw4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0nbkhrw87oknig4zw4s.png" alt="Image description" width="800" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us have a peek at a sample entry format from &lt;code&gt;/etc/shadow&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;username : $id$hashed-password : lastchg : min : max : warn : inactive : expire : reserved&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;View: &lt;a href="//screenshots/step6A3.png"&gt;step6A3&lt;/a&gt;&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;View: &lt;a href="//screenshots/step6A4.png"&gt;step6A4&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Field&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;username&lt;/td&gt;
&lt;td&gt;The login name of the user (e.g., kali)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hashed-password&lt;/td&gt;
&lt;td&gt;The user's hashed password.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lastchg&lt;/td&gt;
&lt;td&gt;Days since January 1, 1970, that the password was last changed (e.g., 20432 days)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;min&lt;/td&gt;
&lt;td&gt;Minimum number of days between password changes (e.g., 0)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;td&gt;Maximum number of days the password is valid (e.g., 99999 = 273 years = "never expire")&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;warn&lt;/td&gt;
&lt;td&gt;Number of days before the password expires that the user gets warned (e.g., 7 days)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;inactive&lt;/td&gt;
&lt;td&gt;Days after the password expires before the account is disabled (blank or -1 means disabled immediately)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;expire&lt;/td&gt;
&lt;td&gt;Days since Jan 1, 1970, when the account will be disabled (blank = never expires)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reserved&lt;/td&gt;
&lt;td&gt;Reserved for future use (usually empty)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Password Field Special Cases (Field 2):&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$6$...&lt;/code&gt;: Encrypted password (SHA-512 hash)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!&lt;/code&gt;: Account is locked&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt;: No password set (This cannot be used for login)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&lt;/code&gt;: A blank space means the password login is disabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run &lt;code&gt;sudo usermod -L &amp;lt;username&amp;gt;&lt;/code&gt; or &lt;code&gt;sudo passwd -l &amp;lt;username&amp;gt;&lt;/code&gt; to lock the &lt;code&gt;demouser&lt;/code&gt;. Note that if you use the latter option, you will receive a response that the &lt;code&gt;passwd: password changed&lt;/code&gt;, which means the user has been locked. After executing the command as pointed to by the 1st arrow, if successful, you will be directed to the next prompt.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe0fxoxywl3m44pg3dpe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe0fxoxywl3m44pg3dpe.png" alt="Image description" width="678" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After locking the user, notice the exclamation mark &lt;code&gt;!&lt;/code&gt; placed at the beginning of the hashed password as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favz4k5xve6o4ghxjon3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favz4k5xve6o4ghxjon3o.png" alt="Image description" width="800" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because the &lt;code&gt;demouser&lt;/code&gt; password has been locked, it cannot log in to the system as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg8uygdsx6nwaa9mkb4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg8uygdsx6nwaa9mkb4y.png" alt="Image description" width="641" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though the &lt;code&gt;demouser&lt;/code&gt; password has been locked, its &lt;code&gt;login shell&lt;/code&gt; is still operational, which is why, with a &lt;code&gt;root&lt;/code&gt; user privilege as pointed to by the 1st arrow, you can &lt;code&gt;bypass&lt;/code&gt; and log in to the &lt;code&gt;demouser&lt;/code&gt; account. As pointed out by the 2nd arrow, we successfully log in to the &lt;code&gt;demouser&lt;/code&gt; account directly without providing a password. Look at &lt;code&gt;Step 7&lt;/code&gt; below on how to completely disable any user &lt;code&gt;login shell&lt;/code&gt; to completely disable anyone from logging in to a particular user account.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwvhhynr637i3gq8hmzf5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwvhhynr637i3gq8hmzf5.png" alt="Image description" width="611" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;code&gt;root&lt;/code&gt; user can bypass and log in directly to any (both &lt;code&gt;root&lt;/code&gt; and &lt;code&gt;regular&lt;/code&gt;) user account, &lt;strong&gt;EXCEPT&lt;/strong&gt; if the login shell of the user is disabled; otherwise, the &lt;code&gt;root&lt;/code&gt; user will only be authenticated to provide its own &lt;code&gt;root&lt;/code&gt; user password to prove it's a &lt;code&gt;root&lt;/code&gt; user.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;To Unlock the User.&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
Run the command &lt;code&gt;sudo usermod -U &amp;lt;username&amp;gt;&lt;/code&gt; or &lt;code&gt;sudo passwd -u &amp;lt;username&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note that if you use the latter option, you will receive a response that the &lt;code&gt;passwd: password changed&lt;/code&gt;, which means the user has been unlocked. If the unlocking command is executed successfully as pointed to by the 1st arrow, you will be directed to the next prompt.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7gabjiitpxdozewrii2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7gabjiitpxdozewrii2.png" alt="Image description" width="618" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As pointed out by the 2nd arrow below, the exclamation mark &lt;code&gt;!&lt;/code&gt; has been removed; therefore, the &lt;code&gt;demouser&lt;/code&gt; has been unlocked.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqbzv7sbusqxlhwxmjrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqbzv7sbusqxlhwxmjrs.png" alt="Image description" width="800" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check User Password Status.&lt;br&gt;
Run the command pointed to by the 1st arrow. The option/flag -l will list the account ageing information.&lt;/p&gt;

&lt;p&gt;Run the command sudo change -l  as pointed to by the 1st arrow to view a user's password status. The option/flag -l will list the account ageing information.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkso87hw1ogmxbbbaihar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkso87hw1ogmxbbbaihar.png" alt="Image description" width="666" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locking does not affect processes already running under that user. &lt;/li&gt;
&lt;li&gt;If you're using key-based authentication (SSH), locking the password/user account might not stop the user from logging in — you'll need to disable their shell or revoke their SSH key too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: Disable a User's Shell in Kali/Linux.
&lt;/h2&gt;

&lt;p&gt;Disabling a user’s shell is a smart way to block interactive logins, even if they use &lt;code&gt;SSH&lt;/code&gt; with key-based authentication. This method is especially useful in hardening systems or disabling dormant accounts without deleting them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Set Shell to /usr/sbin/nologin (Preferred method).
&lt;/h3&gt;

&lt;p&gt;Run the command&lt;br&gt;
&lt;code&gt;`&lt;br&gt;
sudo cat /etc/passwd&lt;br&gt;
`&lt;/code&gt;&lt;br&gt;
As pointed out by the 1st arrow, to view all users. The 2nd arrow points to the &lt;code&gt;demouser&lt;/code&gt; and the &lt;code&gt;demouser&lt;/code&gt; login shell &lt;code&gt;bash&lt;/code&gt;, is underlined.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2dmc8c5vv8ebyn2d0kn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2dmc8c5vv8ebyn2d0kn.png" alt="Image description" width="680" height="176"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foso7k7ywxqqtu7tiqpag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foso7k7ywxqqtu7tiqpag.png" alt="Image description" width="722" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;code&gt;`&lt;br&gt;
sudo usermod -s /usr/sbin/nologin &amp;lt;username&amp;gt;&lt;br&gt;
`&lt;/code&gt;&lt;br&gt;
will disable the &lt;code&gt;demouser&lt;/code&gt; login shell as pointed to by the 1st arrow. Run the command &lt;code&gt;sudo cat /etc/passwd&lt;/code&gt; to view the users list again. As pointed to by the 3rd arrow, the &lt;code&gt;demouser&lt;/code&gt; login shell has changed from &lt;code&gt;/bin/bash&lt;/code&gt; to &lt;code&gt;/usr/sbin/nologin&lt;/code&gt;, hence &lt;code&gt;demouser&lt;/code&gt; cannot use or log in to its login shell &lt;code&gt;bash&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxrpzfs17zawqvpk42gf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxrpzfs17zawqvpk42gf.png" alt="Image description" width="641" height="93"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywlfn6ziwokywjxnu3ay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywlfn6ziwokywjxnu3ay.png" alt="Image description" width="734" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because the &lt;code&gt;demouser&lt;/code&gt; login shell &lt;code&gt;/usr/sbin/nologin&lt;/code&gt; has been disabled, it cannot log in to the system as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlcot6l95163dt37so1h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnlcot6l95163dt37so1h.png" alt="Image description" width="674" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not even a &lt;code&gt;root&lt;/code&gt; user can access or log in to the &lt;code&gt;demouser&lt;/code&gt; account as pointed to by the 3rd and 4th arrow below, because the &lt;code&gt;login shell - bash&lt;/code&gt; has been completely disabled.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2sd640qw1ulcf3w6iis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2sd640qw1ulcf3w6iis.png" alt="Image description" width="721" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Set Shell to /bin/false (Alternative method)
&lt;/h3&gt;

&lt;p&gt;Run the command&lt;br&gt;
&lt;code&gt;`&lt;br&gt;
sudo usermod -s /bin/false &amp;lt;username&amp;gt;&lt;br&gt;
`&lt;/code&gt;&lt;br&gt;
As pointed by the 1st arrow to disable the login shell. If successful, you will be directed to the next prompt, where we run a command as pointed to by the 2nd arrow to view the list of all users.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrrklf01pp41j29mvo76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrrklf01pp41j29mvo76.png" alt="Image description" width="687" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 3rd arrow in the screenshot below points to the &lt;code&gt;demouser&lt;/code&gt;, and the &lt;code&gt;demouser's&lt;/code&gt; login shell &lt;code&gt;/bin/bash&lt;/code&gt; changed to &lt;code&gt;/bin/false&lt;/code&gt;, shown underlined. After locking the &lt;code&gt;demouser&lt;/code&gt;, try switching to the &lt;code&gt;demouser&lt;/code&gt; as pointed to by the 4th arrow to provide the &lt;code&gt;demouser&lt;/code&gt; password, you can see the log in or switching fails because we were redirected back to the &lt;code&gt;kali&lt;/code&gt; user as pointed to by the 5th arrow, and &lt;strong&gt;NOT&lt;/strong&gt; &lt;code&gt;demouser&lt;/code&gt; as expected. Not even the &lt;code&gt;root&lt;/code&gt; user can log in, just as demonstrated in &lt;code&gt;Option 1 above&lt;/code&gt;, because the login shell has been set to false.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To Re-enable Login.&lt;/strong&gt;&lt;br&gt;
Run the command&lt;br&gt;
&lt;code&gt;`&lt;br&gt;
sudo usermod -s /bin/bash &amp;lt;username&amp;gt;&lt;br&gt;
`&lt;/code&gt;&lt;br&gt;
to unlock the &lt;code&gt;demouser&lt;/code&gt; as pointed to by the 6th arrow, and run &lt;code&gt;sudo cat /etc/passwd&lt;/code&gt; to print the list of all users as pointed to by the 7th arrow to confirm it. The 8th arrow points to the &lt;code&gt;demouser&lt;/code&gt; and shows that its login shell has changed from &lt;code&gt;/bin/false&lt;/code&gt; to &lt;code&gt;/bin/bash&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjmnbqf97zb2ydy8hzpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqjmnbqf97zb2ydy8hzpn.png" alt="Image description" width="780" height="205"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvt38er9rqp0o1zwqjjh0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvt38er9rqp0o1zwqjjh0.png" alt="Image description" width="737" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can now log in or switch to the &lt;code&gt;demouser&lt;/code&gt; account.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/kali-linux-users-account-management" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/kali-linux-users-account-management&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>linux</category>
      <category>security</category>
    </item>
    <item>
      <title>Ubuntu Server Security Hardening with Ubuntu Security Guide (USG).</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Fri, 13 Jun 2025 09:52:59 +0000</pubDate>
      <link>https://forem.com/agbuenoch/ubuntu-server-security-hardening-with-ubuntu-security-guide-usg-2jnd</link>
      <guid>https://forem.com/agbuenoch/ubuntu-server-security-hardening-with-ubuntu-security-guide-usg-2jnd</guid>
      <description>&lt;p&gt;In this Project &lt;a href="https://dev.to/agbuenoch/cybersecurity-home-lab-installs-ubuntu-server-on-vmware-workstation-pro-46g"&gt;Cybersecurity Home Lab: Installs Ubuntu Server On VMware Workstation Pro&lt;/a&gt;, I walked through installing Ubuntu Server on VMware Workstation Pro. This project will guide you through the fundamental steps to secure the Ubuntu server before using it for log analysis, Wazuh management, or as a monitored endpoint.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.cisecurity.org/" rel="noopener noreferrer"&gt;Centre for Internet Security (CIS)&lt;/a&gt; benchmark has provided hundreds of configuration recommendations, but manually hardening and auditing a Linux system can be tedious and error-prone. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://ubuntu.com/security/certifications/docs/usg" rel="noopener noreferrer"&gt;Ubuntu Security Guide (USG)&lt;/a&gt; is a new and automated cybersecurity tool available with Ubuntu 20.04 LTS. It is part of &lt;a href="https://ubuntu.com/pro" rel="noopener noreferrer"&gt;Ubuntu Pro Service&lt;/a&gt; and installed using the “Ubuntu Pro client.” With USG, hardening an Ubuntu system becomes much easier. USG is used to harden and audit Ubuntu systems to check if they are still compliant with the CIS Benchmark.&lt;/p&gt;

&lt;p&gt;The Ubuntu Pro client is a tool designed to automate access to Ubuntu Pro services like Extended Security Maintenance (ESM), Ubuntu Security Guide (USG), Federal Information Processing Standards (FIPS), and more.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It is recommended to apply the security hardening on a freshly installed Ubuntu and not on a production system.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pre-requisite: You must have or enable &lt;code&gt;Ubuntu Pro&lt;/code&gt; as a prerequisite for using Ubuntu Security Guide (USG), this is because &lt;code&gt;USG&lt;/code&gt; is one of the services of “Ubuntu Pro”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you need help on how to install any command in Bash, and you have no idea how to do it, just type:&lt;br&gt;
&lt;code&gt;&amp;lt;command name&amp;gt;&lt;/code&gt;&lt;br&gt;
or &lt;br&gt;
&lt;code&gt;&amp;lt;command name&amp;gt; --help&lt;/code&gt;&lt;br&gt;
Replace &lt;code&gt;&amp;lt;command name&amp;gt;&lt;/code&gt; with the actual command you want to install and press &lt;code&gt;ENTER&lt;/code&gt;. The terminal will provide you with the official/appropriate name and command to install it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Register for Ubuntu Pro and attach it to your Ubuntu Server.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go to: &lt;a href="https://ubuntu.com/pro/subscribe" rel="noopener noreferrer"&gt;https://ubuntu.com/pro/subscribe&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Sign in or create a free Ubuntu One account.&lt;/li&gt;
&lt;li&gt;Generate your free personal-use token (valid for up to 5 machines).&lt;/li&gt;
&lt;li&gt;Copy the token. This is used when attaching Ubuntu Pro to the Ubuntu server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above step has been explicitly explained in the project &lt;a href="https://dev.to/agbuenoch/cybersecurity-home-lab-installs-ubuntu-server-on-vmware-workstation-pro-46g"&gt;Cybersecurity Home Lab: Installs Ubuntu Server On VMware Workstation Pro&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Update and Upgrade Your System.
&lt;/h2&gt;

&lt;p&gt;Run the green command to update and upgrade the Ubuntu server. As the arrow indicates, provide the Ubuntu server user password.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtgcymuyadrpln26uhqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtgcymuyadrpln26uhqz.png" alt="Image description" width="665" height="234"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Install “Ubuntu Pro Client”.
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Ubuntu Pro client&lt;/code&gt; is a command-line utility (pro) that connects your Ubuntu machine to Ubuntu Pro services like Extended Security Maintenance (ESM), Compliance tools like &lt;code&gt;USG (Ubuntu Security Guide)&lt;/code&gt;, &lt;code&gt;Federal Information Processing Standards (FIPS)&lt;/code&gt; 140-2 certified cryptographic modules (for enterprise/government compliance), and more.&lt;/p&gt;

&lt;p&gt;Run the command in green and provide the Ubuntu server user password when prompted, as pointed to by the 1st arrow. The 2nd, 3rd and 4th arrows point to the sequential steps for the installation of the Ubuntu Pro Client.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwahbh4cg3l501t3i7hb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwahbh4cg3l501t3i7hb.png" alt="Image description" width="634" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After it successfully installs the &lt;code&gt;pro&lt;/code&gt; command-line tool. Let's verify/confirm that the &lt;code&gt;pro&lt;/code&gt; command is installed in our terminal.&lt;/p&gt;

&lt;p&gt;As pointed out by the 1st arrow, if the command is installed, the terminal will present you with the usage guide on how to use the command, and other vital information about the command as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw3bmyl8kh9942jmjczj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw3bmyl8kh9942jmjczj.png" alt="Image description" width="571" height="187"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Verify and view all Ubuntu Pro Services.
&lt;/h2&gt;

&lt;p&gt;Let's view all the &lt;code&gt;Ubuntu Pro services&lt;/code&gt; that &lt;code&gt;Ubuntu Pro clients&lt;/code&gt; can access by running the command in green. As pointed to by the 1st arrow, the &lt;code&gt;esm-apps&lt;/code&gt; service is enabled (This was done by completing &lt;code&gt;Step 1&lt;/code&gt; above), which offers the Ubuntu system an extended 10+ years of security maintenance. The USG service is currently disabled as pointed to by the 2nd arrow. The 3rd arrow shows how to enable any of the Ubuntu Pro services, which can be achieved by using the Ubuntu Pro client (i.e pro command). This must be enabled so that we can use the service to perform an &lt;code&gt;audit&lt;/code&gt; and &lt;code&gt;fix&lt;/code&gt; our Ubuntu system following the CIS benchmark security. The 4th arrow points to the statement that we are using or subscribed to Ubuntu Pro on this Ubuntu system.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vtd4izxksmc9kua1rfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vtd4izxksmc9kua1rfe.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ensure &lt;code&gt;esm&lt;/code&gt; and &lt;code&gt;usg&lt;/code&gt; are available or enabled.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Enable and install the USG Tool.
&lt;/h2&gt;

&lt;p&gt;From the screenshot above, you can see that the &lt;code&gt;usg&lt;/code&gt; Ubuntu Pro service is disabled as pointed to by the 2nd arrow. Let’s enable the &lt;code&gt;usg&lt;/code&gt; service.&lt;/p&gt;

&lt;p&gt;Run the command in green, and provide the Ubuntu server user password when prompted, as pointed to by the 1st arrow. The 2nd arrow points to the statement that confirms USG (Ubuntu Security Guide) is enabled.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh21v2smcw3mwmxetfqvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh21v2smcw3mwmxetfqvw.png" alt="Image description" width="613" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will enable the Ubuntu Security Guide (USG) utility. Checking the Ubuntu Pro Services again this time shows that the USG service is enabled as pointed to by the arrows below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb0svj108tanjqf4d53o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb0svj108tanjqf4d53o.png" alt="Image description" width="610" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But I do not currently have the &lt;code&gt;usg&lt;/code&gt; command installed yet on my Ubuntu server terminal, this will result in an error if you try to use the command.&lt;/p&gt;

&lt;p&gt;Let’s first confirm if the “usg” command is NOT installed. As pointed to by the 1st arrow, the command is not found; meanwhile, the 2nd arrow points to the statement that provides the command to install the intended command, i.e usg.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqpng5s51j9ysx8vo8z06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqpng5s51j9ysx8vo8z06.png" alt="Image description" width="532" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the command in green to install the “usg” command. As pointed by the 1st arrow, provide the Ubuntu server password when prompted.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iggd4djzg14qlsy730d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iggd4djzg14qlsy730d.png" alt="Image description" width="633" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s verify it is installed. As pointed by the 1st and 2nd arrow, the usage and additional information provided about the usg command imply that it is installed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folp683sx439kdip9a3hf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folp683sx439kdip9a3hf.png" alt="Image description" width="597" height="205"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 6: Audit Your Ubuntu Server Against CIS Benchmark.
&lt;/h2&gt;

&lt;p&gt;Run the command in green to audit the Ubuntu server system against the CIS security benchmark. This process will take a couple of minutes to perform the system audit.&lt;/p&gt;

&lt;p&gt;Each audit is presented as Title, Rule, and Result. The audit result for each rule will either be pass or fail, as shown below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flp5p9j5067zuf1owg3n6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flp5p9j5067zuf1owg3n6.png" alt="Image description" width="593" height="122"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonigzh39t8bipbkof08f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonigzh39t8bipbkof08f.png" alt="Image description" width="611" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After it successfully performed the audit, the audit report can be found in the path I highlighted in yellow. Note also that the report is given in two formats, as &lt;code&gt;.html&lt;/code&gt; and &lt;code&gt;.XML&lt;/code&gt;, as pointed to by the 1st and 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fskp3nhei98huxhr51v4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fskp3nhei98huxhr51v4r.png" alt="Image description" width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 7: Access and open the Audit Report.
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;/var/lib/&lt;/code&gt; directory is owned by system services, so most subfolders require sudo or completely switch to a &lt;code&gt;root user&lt;/code&gt; for you to be able to access the subfolders in &lt;code&gt;/var/lib&lt;/code&gt;, where the audit and fix reports are saved. &lt;/p&gt;

&lt;p&gt;Let's temporarily switch to a root user and navigate to the &lt;code&gt;/usg/&lt;/code&gt; folder by running &lt;code&gt;cd /var/lib/usg/&lt;/code&gt; to view our audit reports, which are highlighted in yellow and pink below. Type &lt;code&gt;exit&lt;/code&gt; to switch back to a regular user at any time.&lt;/p&gt;

&lt;p&gt;A regular user prompt is signified with a dollar sign &lt;code&gt;$&lt;/code&gt; as pointed to by the 1st arrow. When we switch to a root user by running &lt;code&gt;sudo -i&lt;/code&gt;, the prompt symbol changes to a hash sign &lt;code&gt;#&lt;/code&gt; as pointed by the 3rd arrow. When we try to print the working directory &lt;code&gt;pwd&lt;/code&gt;, you can see that it is &lt;code&gt;/root&lt;/code&gt; as pointed by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72m9ujo7q39s3tam18hb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72m9ujo7q39s3tam18hb.png" alt="Image description" width="596" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, we can copy all the reports to the home directory for easier viewing without switching to the root user. We can then work with it later or copy the files from the home directory to our host machine. Since I am logged in as a root user, there is no need to use sudo in the command below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; /var/lib/usg/&lt;span class="k"&gt;*&lt;/span&gt;.&lt;span class="k"&gt;*&lt;/span&gt; ~/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; means all file names with zero or more characters length, followed by a period &lt;code&gt;.&lt;/code&gt;, and then all file extensions with zero or more characters length. This will copy all files that are in the &lt;code&gt;/var/lib/usg/&lt;/code&gt; folder that satisfy the regular expression &lt;code&gt;*.*&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;~/&lt;/code&gt; means home directory (in my case, it is &lt;code&gt;/home/agbuenoch&lt;/code&gt;).  Navigate to the home directory, and you will see all the files copied from the &lt;code&gt;/var/lib/usg/&lt;/code&gt; directory in the home directory.&lt;/p&gt;

&lt;p&gt;The 1st arrow points to the dollar sign &lt;code&gt;$&lt;/code&gt;, implying we are currently operating as a regular user. Run &lt;code&gt;whoami&lt;/code&gt; to print out the current username as pointed to by the 2nd arrow. The command &lt;code&gt;pwd&lt;/code&gt; will print the current directory of the regular user, which is pointed to by the 3rd arrow.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;sudo -i&lt;/code&gt; will switch the regular user to the root user as pointed to by the arrow immediately below the line where we run the sudo command. The hash symbol pointed to by the 4th arrow indicates we are now operating as the root user, and when you run &lt;code&gt;pwd&lt;/code&gt;, it prints out that we are in the root directory, as pointed out by the 5th arrow. &lt;/p&gt;

&lt;p&gt;Still operating as the root user, we change the directory to &lt;code&gt;/var/lib/usg/&lt;/code&gt;, and we run &lt;code&gt;ls -l&lt;/code&gt; to print out all files and directories within the current directory &lt;code&gt;/var/lib/usg/&lt;/code&gt;. The 6th arrow points to the files residing in the &lt;code&gt;/usg/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;cp ./*.* ~/&lt;/code&gt; copied all the files &lt;code&gt;*.*&lt;/code&gt; from the current directory &lt;code&gt;./&lt;/code&gt; to the home directory &lt;code&gt;~/&lt;/code&gt;. Run exit to log out the root user as pointed to by the 7th arrow, back to the regular user as pointed to by the 8th arrow, which now shows a dollar sign. At this point, we run whoami and pwd, and it prints the regular username &lt;code&gt;agbuenoch&lt;/code&gt; and current directory &lt;code&gt;/home/agbuenoch&lt;/code&gt; pointed by the 9th arrow, respectively.&lt;/p&gt;

&lt;p&gt;Therefore, when we run &lt;code&gt;ls -l&lt;/code&gt;, we can see the files we copied from &lt;code&gt;/var/lib/usg/&lt;/code&gt; as the root user in the home directory as pointed to by the 10th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5gdgkp2b9toxvvhgcyg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5gdgkp2b9toxvvhgcyg.png" alt="Image description" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Option A: How to view the .html file audit report.
&lt;/h3&gt;

&lt;p&gt;Ubuntu Server is CLI-based; it does not have a GUI (Graphical User Interface) or a DISPLAY environment to launch GUI apps. To view the report, both files &lt;code&gt;.html&lt;/code&gt; and &lt;code&gt;.xml&lt;/code&gt; can be copied to the host machine (the computer running VMware) or to another Windows client virtual machine.&lt;/p&gt;

&lt;p&gt;The two audit report files generated are pointed to by the 1st and 2nd arrows.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleex8yutq1ghxyglll1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleex8yutq1ghxyglll1u.png" alt="Image description" width="800" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have a Windows Subsystem for Linux (WSL) running on a Windows client machine, with SSH installed and enabled, run the command below on your Ubuntu server terminal to copy the &lt;code&gt;.html&lt;/code&gt; and &lt;code&gt;.xml&lt;/code&gt; file report to the Windows client machine so you can view it in a browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;scp /ubuntu-server/path/to/filename &amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:&lt;span class="s2"&gt;"/mnt/c/Users/windows-nameofuser/.../destination/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fle9vtqqz388bwix9ih9k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fle9vtqqz388bwix9ih9k.png" alt="Image description" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The article: &lt;a href="https://www.linkedin.com/pulse/file-sharing-using-scp-rsync-enoch-agbu-yeynf" rel="noopener noreferrer"&gt;File Sharing using scp and rsync&lt;/a&gt; explains how to copy/share files between an Ubuntu server and a Windows client machine.&lt;/p&gt;

&lt;p&gt;After running the command, you will be authenticated to provide the source system (Ubuntu server VM) user password as pointed to by the 1st arrow. You will also be authenticated against the Windows client machine (the destination system) you want to copy to, as pointed to by the 2nd arrow. The &lt;code&gt;.html&lt;/code&gt; file was successfully copied to the Windows client machine as pointed to by the 3rd arrow and the 4th arrow, showing that the file was copied 100%.&lt;/p&gt;

&lt;p&gt;Voila! The USG report file copied to the Windows client machine desktop is opened from the desktop as pointed to by the 1st arrow, using the Chrome browser.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78p64zq1wvj91u8d6p9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78p64zq1wvj91u8d6p9f.png" alt="Image description" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll through to view the security checks that passed and/or failed, including other security statistics. The 1st arrow points to the target system that was audited, and the 2nd arrow points to the username that performed the audit.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbcu5xxwcbbwgmp4257ah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbcu5xxwcbbwgmp4257ah.png" alt="Image description" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scrolling further down is the compliance and scoring. The Ubuntu server failed to satisfy the conditions of 124 rules. 224 conditions rules were passed, and 124 failed, with a 70.87% pass rate as pointed by the 4th arrow. This report will be compared with the subsequent report generated after applying the CIS benchmark security.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhpog940i9ptg3wvwe1h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhpog940i9ptg3wvwe1h.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Option B: How to view the &lt;code&gt;.xml&lt;/code&gt; file audit report.
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.xml&lt;/code&gt; file can be copied to and viewed on the host machine with any browser or code editor like &lt;code&gt;VS Code Studio&lt;/code&gt; or &lt;code&gt;Sublime&lt;/code&gt;. To copy the &lt;code&gt;.xml&lt;/code&gt; file, run exactly the above command shown in the screenshot above, replacing the &lt;code&gt;.html&lt;/code&gt; file name with the &lt;code&gt;.xml&lt;/code&gt; file name.&lt;/p&gt;

&lt;p&gt;Viewing the &lt;code&gt;.xml&lt;/code&gt; file in VS Code.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2d8vqbtlzwm9joz7r6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2d8vqbtlzwm9joz7r6g.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can view the &lt;code&gt;.xml&lt;/code&gt; file right in the Ubuntu server terminal like any text file, although it may look unreadable/unorganised.&lt;/p&gt;

&lt;p&gt;Scroll through the file neatly by using the “less” command, press &lt;code&gt;ENTER&lt;/code&gt; to keep reading through each page, and press &lt;code&gt;CTRL+Z&lt;/code&gt; to opt out of the reading.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoz2jodvrjdmkcoicr9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoz2jodvrjdmkcoicr9h.png" alt="Image description" width="739" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the command above, below is a snippet of the &lt;code&gt;.xml&lt;/code&gt; file contents.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8fy0xhw620naf9zxogi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8fy0xhw620naf9zxogi.png" alt="Image description" width="709" height="219"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 8: Apply CIS Benchmark Fixes Automatically.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;HIGHLY RECOMMENDED:&lt;/code&gt;&lt;/strong&gt; Before applying the CIS benchmark security hardening, it's best to back up your virtual machine (VM) or take a snapshot. We will take a snapshot of the VM. While your Ubuntu server is running, follow the marked arrows sequentially to take a snapshot of the server. This is important because you can easily roll back to your Ubuntu server stable version/state in the event you break something or get stuck somewhere in your server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzkizo1d9w4q35u53d63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzkizo1d9w4q35u53d63.png" alt="Image description" width="751" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide a snapshot name of your choice as pointed by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy06bjnjeqzv2ruo76mj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy06bjnjeqzv2ruo76mj.png" alt="Image description" width="576" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To revert to any of your snapshots, follow the sequence of the arrows below and click on the name of the snapshot you want to revert to. The 3rd arrow points to the name of a snapshot I created.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkm9jz7xccq26r8cr7u5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkm9jz7xccq26r8cr7u5.png" alt="Image description" width="750" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have saved the current state of the freshly installed Ubuntu server using a snapshot. Let’s apply the security recommendations:&lt;/p&gt;

&lt;p&gt;Run the command in green, and provide the Ubuntu server password as pointed to by the 1st arrow for authentication before the CIS benchmark is applied. Before the CIS benchmark security is fixed/applied, the system will always be audited first, as pointed out by the 2nd arrow. Each time you run the command to fix/apply the CIS benchmark, an audit must first be carried out. If you read along to the second line of the line pointed to by the 2nd arrow, you will see &lt;code&gt;--results&lt;/code&gt; followed by a path; this is where the audit report will be saved.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifzbwk45vw1cz3szbwa1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifzbwk45vw1cz3szbwa1.png" alt="Image description" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 1st arrow points to just a part of the audit carried out. After successfully auditing the system, the CIS benchmark will be applied. The 1st, 2nd and 3rd arrows point to the system files that will get executed to implement the CIS benchmark security. The 4th arrow points to the commencement of the fixing process, starting with the first one remediating rule &lt;code&gt;1/402&lt;/code&gt; down until it remediates &lt;code&gt;402/402&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzjzjjvdgj59yotz8wlrh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzjzjjvdgj59yotz8wlrh.png" alt="Image description" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The USG fix is done as pointed to by the 1st arrow.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;After remediating rule &lt;code&gt;402/402&lt;/code&gt;, reboot the system to complete the process, as pointed to by the 2nd arrow. Perform another audit as pointed to by the 3rd arrow, after you have applied the CIS benchmark security. This will help to compare whether the security hardening has improved.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo reboot&lt;/code&gt; to reboot the server as shown in the screenshot below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2kwavu15npqhlkabb0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2kwavu15npqhlkabb0g.png" alt="Image description" width="713" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This fix process will: Harden SSH settings, configure file permissions, disable unnecessary services, apply password policies, and more. The Ubuntu server security is hardened and stricter now, as pointed out by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghwyyomxr2d82xkobmb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghwyyomxr2d82xkobmb8.png" alt="Image description" width="702" height="131"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 9: Re-audit After Reboot.
&lt;/h2&gt;

&lt;p&gt;After reboot, rerun the audit, and compare the audit report with the previous report generated before applying the CIS benchmark security hardening:&lt;/p&gt;

&lt;p&gt;Before running the audit, let's check and mark the audit report generated earlier, before we applied the CIS benchmark security above in &lt;code&gt;Step 8&lt;/code&gt;. The 1st and 2nd arrows point to the audit report generated from the last audit we performed in &lt;code&gt;Step 6&lt;/code&gt;. The other reports you see were generated when we ran the fix command to apply the CIS benchmark security. I have run the fix command multiple times, which is why you can see multiple reports there. Remember, each time we apply the CIS benchmark, an audit is first performed before the fix.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw5479p7rxttp2gq66gir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw5479p7rxttp2gq66gir.png" alt="Image description" width="729" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;sudo usg audit cis_level1_server&lt;/code&gt; to check the compliance scores after we have fixed/applied the CIS benchmark security.&lt;/p&gt;

&lt;p&gt;Currently, we are operating as the root user, as pointed to by the 1st arrow. Run exit to log out from the root user pointed to by the 2nd arrow. The 3rd arrow points to the dollar sign &lt;code&gt;$&lt;/code&gt;, meaning a regular user.&lt;/p&gt;

&lt;p&gt;After running the audit command, the 4th arrow points to the flag/option &lt;code&gt;--result&lt;/code&gt;, meanwhile the 5th arrow points to the path/directory where the result is stored &lt;code&gt;/var/lib/usg/&lt;/code&gt;, the &lt;code&gt;.xml&lt;/code&gt; file is the file name containing the audit report.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frz6qwy7oe5js70seygbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frz6qwy7oe5js70seygbk.png" alt="Image description" width="788" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just as shown above, once the audit is complete, the 1st arrow points that the audit is complete and shows us where to find the audit report as pointed to by the 2nd and 3rd arrows.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4h2h1z4ktvilp0uf17a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4h2h1z4ktvilp0uf17a.png" alt="Image description" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To access the audit report, we need root user privileges. Run &lt;code&gt;sudo -i&lt;/code&gt; to switch to the root user. We navigate to the &lt;code&gt;/var/lib/usg/&lt;/code&gt; directory and &lt;code&gt;ls -l&lt;/code&gt; out the path contents. The 1st and 2nd arrows point to the audit report (.html and .xml) just generated.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyogsa39t6vhsq4zdzhfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyogsa39t6vhsq4zdzhfy.png" alt="Image description" width="797" height="586"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the command pointed to by the 1st arrow to copy the &lt;code&gt;.html&lt;/code&gt; file pointed to by the 2nd arrow to the home directory so that we can access it anytime without root user privileges.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlhmpja7lu8uyhp3nbx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlhmpja7lu8uyhp3nbx3.png" alt="Image description" width="738" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we have successfully copied the file to the home directory. Let's copy the file to a Windows client machine so that we can view the .html file.&lt;/p&gt;

&lt;p&gt;Using a different approach, from the Windows Subsystem for Linux (WSL) running on the Windows client machine, &lt;code&gt;SSH&lt;/code&gt; into the Ubuntu server VM, and copy the &lt;code&gt;.html&lt;/code&gt; file in the home directory to the Windows client machine desktop folder/path.&lt;/p&gt;

&lt;p&gt;To remotely &lt;code&gt;SSH&lt;/code&gt; connect to the Ubuntu server, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &amp;lt;Ubuntu-server-username&amp;gt;@&amp;lt;Ubuntu-server-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will be required to enter the remote machine (Ubuntu server VM) password to be able to connect to it. I have successfully remotely connected to the Ubuntu server, so I run &lt;code&gt;whoami&lt;/code&gt; to print the Ubuntu server username as pointed out by 1st arrow, &lt;code&gt;pwd&lt;/code&gt; to print the current directory as pointed out by 2nd arrow, and &lt;code&gt;ls -l&lt;/code&gt; to list the directory contents as pointed out by 3rd arrow. The 4th arrow points to the command (spanning two lines) that will copy the &lt;code&gt;.html&lt;/code&gt; file from the remote machine (Ubuntu server VM) home directory to the Windows client machine desktop path. You will provide the destination system (Windows client machine) password to authenticate you to copy to the machine, as pointed out by the 5th arrow. The 6th and 7th arrows point to the file successfully copied to the Windows client machine.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9kirbde9nueqbbhs08a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9kirbde9nueqbbhs08a.png" alt="Image description" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s confirm that the compliance score has improved. Below is a snippet of the audit report before we applied the CIS benchmark security, with just a 70.87% success rate and 124 rule results failed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbh6hgzzq9vir2azye7x7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbh6hgzzq9vir2azye7x7.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Meanwhile, here is the audit report after applying the CIS benchmark security. There is a clear improvement compared to the initial report, where only 9 rule conditions failed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol5npyyqqoiq5ecw1e8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol5npyyqqoiq5ecw1e8u.png" alt="Image description" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 1st arrow points to the target system audited, the 2nd arrow points to the username that performed the audit.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvu10b1lezt2k94u5nnop.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvu10b1lezt2k94u5nnop.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post-hardening audit results show significantly improved CIS Level 1 Server Benchmark compliance, with only 9 rules, results that failed and a 92.24% success rate.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzswhhc1vw9we80qsf0cw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzswhhc1vw9we80qsf0cw.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/security-hardening-with-ubuntu-security-guide-USG" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/security-hardening-with-ubuntu-security-guide-USG&lt;/a&gt;"&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>ubuntu</category>
      <category>linux</category>
    </item>
    <item>
      <title>File Sharing using scp and rsync.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Mon, 09 Jun 2025 12:35:23 +0000</pubDate>
      <link>https://forem.com/agbuenoch/file-sharing-using-scp-and-rsync-42dc</link>
      <guid>https://forem.com/agbuenoch/file-sharing-using-scp-and-rsync-42dc</guid>
      <description>&lt;p&gt;One essential requirement for building a powerful home cybersecurity lab is the ability to securely and efficiently transfer files between your Ubuntu Server VM and your Windows client machine.&lt;/p&gt;

&lt;p&gt;This project implemented two methods to transfer files, all from the Ubuntu server VM terminal, covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SCP (Secure Copy over SSH)&lt;/li&gt;
&lt;li&gt;Rsync (Fast file sync)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For best security practices, use virtual machines for the Ubuntu Server and Windows Client Machines.&lt;/li&gt;
&lt;li&gt;Ensure the systems have a means of authenticating users, that is username and password for login to the systems. This is because, during file sharing, you will be prompted to provide both the source and destination system passwords.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; must be installed and enabled on the two systems that intend to share/copy files.&lt;/li&gt;
&lt;li&gt;To confirm if a command/tool is installed on a Linux terminal, type &lt;code&gt;commandName&lt;/code&gt; or &lt;code&gt;commandName --version&lt;/code&gt; or &lt;code&gt;commandName&amp;gt; --help&lt;/code&gt;, if it returns the version or usage information, it means that the command/tool is installed, otherwise it will output that the &lt;code&gt;command &amp;lt;commandName&amp;gt;&lt;/code&gt; not found or is not recognise, and it will provide you with the command to install that specific command/tool.&lt;/li&gt;
&lt;li&gt;When copying files, always include the file extension when writing file names, for example &lt;code&gt;myfile.html, packet.pcap, test.txt&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;Disable your &lt;code&gt;SSH&lt;/code&gt; service when not in use.&lt;/li&gt;
&lt;li&gt;Anything inside the symbol &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; is a placeholder; replace it, including the symbol, with your system's values or argument.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Settings/Configurations of “SSH and rsync” on Ubuntu Server VM.
&lt;/h2&gt;

&lt;p&gt;First, view the IP address of your Ubuntu server VM. Look for an entry under the &lt;code&gt;inet&lt;/code&gt; section usually for the interface &lt;code&gt;eth0&lt;/code&gt;, or &lt;code&gt;ens33&lt;/code&gt;. This will show the IP address pointed to by the 1st and 2nd arrows.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iop1hhbm25t99sbl0w2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iop1hhbm25t99sbl0w2.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;ssh --version&lt;/code&gt; to verify SSH is installed. The usage information is returned, which means SSH is already installed on the Ubuntu server VM as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frt0js4xw2ospilm4xifj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frt0js4xw2ospilm4xifj.png" alt="Image description" width="716" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In an instance where a command is not yet installed, the terminal will not return the version/usage information, and it will provide you with a guide or command to install the specific command. For example, Wireshark is not yet installed, as pointed to by the 1st arrow. The 2nd arrow points to the command provided by the terminal to install the Wireshark tool.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbsvf4wtbr0gt7uh62uf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbsvf4wtbr0gt7uh62uf.png" alt="Image description" width="621" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's verify that “rsync” is installed on our Ubuntu server VM. As pointed out by the 1st arrow, the command returned the version and usage information.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpnmdg4uhrbxje81ykrh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpnmdg4uhrbxje81ykrh.png" alt="Image description" width="666" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also verify the status of the SSH service, as pointed out by the 2nd arrow below, the “SSH” service on the Ubuntu server VM is enabled and actively running.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1cfe7vvt57hbf2ryfb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1cfe7vvt57hbf2ryfb3.png" alt="Image description" width="788" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unlike “SSH” as shown above, “rsync” does not need to be enabled or running as a service (daemon) to work for file copying. So you can ignore the rsync “inactive (dead)” service status as pointed to by the 1st arrow, and use “rsync” normally for all your file transfer tasks.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zvtuusnv6ovsv2dvzre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zvtuusnv6ovsv2dvzre.png" alt="Image description" width="742" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;rsync&lt;/code&gt; service shows &lt;code&gt;inactive (dead)&lt;/code&gt; because by default, the &lt;code&gt;rsync&lt;/code&gt; service (daemon mode) is not automatically used unless we configure it explicitly with a valid &lt;code&gt;rsyncd.conf&lt;/code&gt; file and start it as a daemon.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Verify &lt;strong&gt;SSH access&lt;/strong&gt; to see if we can SSH into the Ubuntu server VM manually. You will be prompted for the Ubuntu server VM password as pointed to by the 1st arrow. If successful, you will get a “&lt;strong&gt;Welcome to Ubuntu ...&lt;/strong&gt;” message as underlined below.&lt;/p&gt;

&lt;p&gt;Run: &lt;code&gt;ssh &amp;lt;Ubuntu_Username&amp;gt;@&amp;lt;Ubuntu_IPv4&amp;gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0y0djli6jomcbcti2lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0y0djli6jomcbcti2lk.png" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have ensured &lt;code&gt;SSH&lt;/code&gt; is enabled/installed on the Ubuntu server VM, and “rsync” is also installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Settings/Configurations of “SSH and rsync” on Windows Client Machine.
&lt;/h2&gt;

&lt;p&gt;The Windows client machine is also required to have an SSH server installed and running. Therefore, let's install “SSH” on the Windows client machine and ensure “rsync” (via WSL) is also installed.&lt;/p&gt;

&lt;h4&gt;
  
  
  OPTION A: Using Windows Subsystem for Linux (WSL) (PREFERRED/RECOMMENDED).
&lt;/h4&gt;

&lt;p&gt;We will be using WSL alongside the Ubuntu server VM terminal for a seamless, consistent Linux environment for file sharing and copying, with full access to Linux tools like “rsync”, as well as integration with the Windows system. This will help keep everything simple and efficient.&lt;/p&gt;

&lt;p&gt;If you do not have Windows Subsystem for Linux (WSL) installed in your Windows client machine, run the command pointed to by the 1st arrow using PowerShell to begin the download of “Ubuntu”, but if you already have WSL, skip the WSL installation step to the next step. The 2nd arrow points to the downloading progress of “Ubuntu”, which is currently at 1.5% as shown below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fae98sssjvog4fnxuw5ii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fae98sssjvog4fnxuw5ii.png" alt="Image description" width="573" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successfully installing the WSL (Ubuntu), search for “Ubuntu or Terminal” on your Windows client machine and open it. By default, you will be presented with the PowerShell interface first. Click on the caret symbol for a drop-down of other shells and click on “Ubuntu” as pointed to by the 1st and 2nd arrows, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7s92airhq7mwfre6tx5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7s92airhq7mwfre6tx5r.png" alt="Image description" width="757" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;code&gt;SSH&lt;/code&gt; (A package that contains both openssh-client and openssh-server) on the WSL using the command pointed to by the 1st arrow, to enable &lt;code&gt;WSL&lt;/code&gt; to accept both inbound and outbound &lt;code&gt;SSH&lt;/code&gt; connections.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgex4jdoj167moetpo9n6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgex4jdoj167moetpo9n6.png" alt="Image description" width="789" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's now verify if “SSH” and “rsync” are installed. Run the command pointed to by the 1st arrow, “SSH” usage information is returned, therefore it is installed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesf4r6ksw8bvcxc4hpnb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesf4r6ksw8bvcxc4hpnb.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the command pointed to by the 1st arrow; it is verified that &lt;code&gt;rsync&lt;/code&gt; is installed, hence the return of the version and usage information as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadxspwnx4lu55jr1bdyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadxspwnx4lu55jr1bdyp.png" alt="Image description" width="761" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if the “rsync” command is not installed,  run the command pointed to by the 1st arrow to install it. Enter your user password as pointed out by the 2nd arrow. I already have &lt;code&gt;rsync&lt;/code&gt; installed as pointed out by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeudjef7nkyowiytgt6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeudjef7nkyowiytgt6n.png" alt="Image description" width="757" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, we now have both &lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; installed on both the Ubuntu server VM and the Windows client machine (via WSL).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WSL Path Conventions:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Windows drives&lt;/code&gt; are mounted inside &lt;code&gt;WSL&lt;/code&gt; at &lt;code&gt;/mnt/&lt;/code&gt;, for example:&lt;br&gt;&lt;br&gt;
The Windows path/directory &lt;code&gt;C:\Users\YourName\Downloads\&lt;/code&gt; Is written in WSL as &lt;code&gt;/mnt/c/Users/YourName/Downloads/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also, if you are copying/sharing files to a Windows client machine from Ubuntu server VM terminal using the &lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; running on the WSL, use the Linux path convention for Windows client machine which is /mnt/c/ and NOT C:/ because in this scenario we are NOT using the “SSH” running directly on the Windows client machine through Powershell but the “SSH” running on WSL.&lt;/p&gt;

&lt;p&gt;The file will land in the Windows client machine filesystem &lt;code&gt;C:\...&lt;/code&gt;, but the connection goes through the Linux environment of WSL.&lt;/p&gt;

&lt;p&gt;From the screenshot below, I want to access the Windows client machine &lt;code&gt;C:\&lt;/code&gt; drive from the &lt;code&gt;WSL&lt;/code&gt;. I changed the directory to &lt;code&gt;/mnt/c/&lt;/code&gt; as underlined below. I listed the files and directory as pointed to by the 2nd arrow. The lists are long, so pass the &lt;code&gt;ls -l&lt;/code&gt; output to &lt;code&gt;head -n 4&lt;/code&gt; to print four lines of the output.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzp8nudv2nqxscmn22ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzp8nudv2nqxscmn22ts.png" alt="Image description" width="695" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can run similar commands on both the Ubuntu server VM terminal and the WSL running on the Windows machine.&lt;br&gt;
Another alternative for using the Windows Subsystem for Linux (WSL) described above is to install Cygwin or Git Bash; they both have “rsync” included. Cygwin provide “Linux feelings” on Windows client machines just like WSL; it provides Windows client machines with similar Linux functionality, but note that this does not mean you can run Linux native apps on Windows. But NOTE that WSL provide more complete/native Linux-like capabilities on Windows machines compared to Cygwin's lightweight/limited capabilities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Gather WSL details.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Let's check for the WSL username using the command pointed to by the 1st arrow. The 2nd arrow points to the username returned.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8vqxvd32btzd98og4ww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8vqxvd32btzd98og4ww.png" alt="Image description" width="709" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check for the WSL IP address. Run the command pointed to by the 1st arrow to view the IPv4 address pointed to by the 3rd arrow of your network interface pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljhylvsz284gnyabyclu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljhylvsz284gnyabyclu.png" alt="Image description" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take notes of these details, they will be required when we want to copy or share a file with another system.&lt;/p&gt;

&lt;h4&gt;
  
  
  OPTION B: Using PowerShell (OPTIONAL).
&lt;/h4&gt;

&lt;p&gt;“rsync” cannot be directly installed using PowerShell; it will have to be installed using the WSL, just as demonstrated above. Unlike &lt;code&gt;rsync&lt;/code&gt;, even without the WSL, &lt;code&gt;SSH&lt;/code&gt; can be installed directly on a Windows client machine and used to share/copy files with remote systems. This is why it is recommended to use &lt;code&gt;WSL&lt;/code&gt;, which can enable the use of both &lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's enable &lt;code&gt;SSH&lt;/code&gt; directly on the Windows client machine. Open a PowerShell on your Windows client machine and run the commands below as pointed to by the 1st arrow, as an administrator:&lt;/p&gt;

&lt;p&gt;Installing OpenSSH client, made for outbound SSH connections to remote systems.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwrgb06xa7nknuehrxdza.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwrgb06xa7nknuehrxdza.png" alt="Image description" width="733" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Installing OpenSSH server, made for inbound SSH connections from remote systems.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23lusvkr0sdo56xr5pfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F23lusvkr0sdo56xr5pfc.png" alt="Image description" width="709" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Openssh-client and Openssh-server have been successfully installed as pointed to by the arrows below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpd9vybpiofopcctnfir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpd9vybpiofopcctnfir.png" alt="Image description" width="702" height="201"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ibrq6xspxia19w7qnn9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ibrq6xspxia19w7qnn9.png" alt="Image description" width="722" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We would set the Openssh server to automatically start each time we boot our system. Run the command pointed out by the 1st arrow to show the current status of the server, which is “Stopped” as pointed out by the 2nd arrow. Run the command pointed out by the 3rd arrow to automatically start the Openssh server each time we boot the system. The command pointed out by the 4th arrow will start the Openssh server. When we view the Openssh server this time using the command pointed to by the 5th arrow, the status has changed to “Running” as pointed to by the 6th arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bpjd8jhde7yi5w966n4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bpjd8jhde7yi5w966n4.png" alt="Image description" width="675" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Stop-Service sshd&lt;/code&gt;  =&amp;gt;Run this command to stop the openssh server.&lt;br&gt;&lt;br&gt;
&lt;code&gt;Start-Service sshd&lt;/code&gt; =&amp;gt;Run this command to start the openssh server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get the Windows Client Machine details.&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
Note down these details, it will be required when sharing/copying files with another system.&lt;/p&gt;

&lt;p&gt;When you run the command &lt;code&gt;ipconfig&lt;/code&gt; in Windows PowerShell, you may see multiple IPv4 addresses—especially if you have: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WiFi and Ethernet (wired) connections&lt;/li&gt;
&lt;li&gt;VPNs (like OpenVPN, NordVPN), or&lt;/li&gt;
&lt;li&gt;Virtual network adapters (VMware, VirtualBox, WSL).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pick the IP based on your network setup:&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are connected via WiFi: Use the IP under Wireless LAN adapter Wi-Fi. Example: 192.168.1.100&lt;/li&gt;
&lt;li&gt;If connected via Ethernet (via a cable): Use the IP under Ethernet adapter Ethernet. Example: 10.0.0.5&lt;/li&gt;
&lt;li&gt;Ignore these IPs:172.x.x.x (usually Windows Subsystem Linux–WSL or Docker). 192.168.152.1 (VMware NAT interface—only for VM-internal traffic). These IPs are NOT used for the transfer/sharing of files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, let's find the Windows client machine &lt;code&gt;IPs&lt;/code&gt;. Run the command pointed to by the 1st arrow. The 2nd, 3rd and 4th arrows point to other available network interface adapters.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1o8v6ikcr8x1org6od4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1o8v6ikcr8x1org6od4y.png" alt="Image description" width="677" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am connected via WiFi as underlined below. If the file sharing/copying will be directly with the Windows client machine (NOT via WSL), the IPv4 address under it shall be used.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnepuaj7fgs10a70kevz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnepuaj7fgs10a70kevz1.png" alt="Image description" width="622" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify Connectivity:&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
From your Ubuntu VM terminal, ping the chosen Windows client machine IP as pointed to by the 1st arrow. If ping succeeds, this is the correct IP. If ping fails: Try another IPv4 address from the list. As pointed out by the 2nd arrow, we have successfully pinged the Windows IP.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqun1b7y945dmljqreggh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqun1b7y945dmljqreggh.png" alt="Image description" width="602" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: VMware Network Mode.&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bridged: Your VM shares the host’s WiFi/Ethernet IP (e.g., &lt;code&gt;192.168.1.100&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;NAT: Your VM gets a separate IP (e.g., &lt;code&gt;192.168.152.x&lt;/code&gt;), but the host’s IP is still &lt;code&gt;192.168.1.100&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Check the Windows client username:&lt;br&gt;&lt;/strong&gt;&lt;br&gt;
Run the command pointed to by the 1st arrow. Your Windows client machine username will be returned as underlined and pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dbzcwp643kdmlxa7q84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dbzcwp643kdmlxa7q84.png" alt="Image description" width="557" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify “SSH” Connectivity to the Windows Client Machine:&lt;/strong&gt;&lt;br&gt;
From the Ubuntu VM terminal, let's verify we can SSH into the Windows client machine after we have enabled the &lt;code&gt;OpenSSH server&lt;/code&gt; and identified the &lt;code&gt;Windows client machine's IP&lt;/code&gt;. If your username has a space in it, remember to wrap it in a quote as demonstrated below. Run the command pointed to by the 1st arrow and provide the Windows client machine password, i.e the machine you want to remotely connect to.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrwznu6g1znc7epqgdv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrwznu6g1znc7epqgdv2.png" alt="Image description" width="638" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Voila, we are remotely connected to the Windows client machine, as shown below. You have total and complete control of the Windows client machine remotely, directly through the command prompt. As pointed out by the 3rd arrow, the prompt has changed from the Ubuntu server prompt &lt;code&gt;$&lt;/code&gt; to a Windows command prompt &lt;code&gt;&amp;gt;&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98v7txex0nwnmig80zxf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98v7txex0nwnmig80zxf.png" alt="Image description" width="612" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To disconnect from the remote Windows client machine, run the command pointed to by the 1st arrow. Immediately, the connection to the Windows client machine closed as pointed to by the 2nd arrow. We are back to the Ubuntu server VM terminal as pointed to by the 3rd, 4th and 5th arrows.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxaujaervwd2r8ui74x2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxaujaervwd2r8ui74x2.png" alt="Image description" width="664" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are now set and ready to share/copy files between the Ubuntu server VM and the Windows client machine. We can decide to share/copy files to the Windows machine via WSL (using the SSH server running on the WSL) or directly to the Windows machine (using the SSH server running on the Windows client machine installed through PowerShell).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Copy Files using "scp".
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All commands will be run/executed from the Ubuntu server VM terminal for both copying from the Ubuntu server VM to the Windows client machine and copying from the Windows client machine to the Ubuntu server VM.&lt;/li&gt;
&lt;li&gt;Ensure both &lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; are installed on the &lt;code&gt;WSL&lt;/code&gt; and &lt;code&gt;SSH&lt;/code&gt; on the Windows client machine (through PowerShell).&lt;/li&gt;
&lt;li&gt;If your username or a file path/directory has a space in it, ensure you enclose it with a double quotation mark like this: &lt;code&gt;"agbu enoch amachundi"&lt;/code&gt; or &lt;code&gt;"C:\\Users\\Agbu Enoch Amachundi"&lt;/code&gt; or &lt;code&gt;"/mnt/c/Users/Agbu Enoch Amachundi"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The Windows &lt;code&gt;C:\&lt;/code&gt; drive is located at &lt;code&gt;/mnt/c/&lt;/code&gt; on the WSL or any Linux machine. For example, file path in Windows client machine:- &lt;code&gt;C:\\Users\\Agbu Enoch Amachundi\\&lt;/code&gt;. The equivalent file path in Linnux machine will be: &lt;code&gt;"/mnt/c/Users/Agbu Enoch Amachundi/"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Copying/sharing files between the Ubuntu server VM and the Windows client machine is best recommended to use &lt;code&gt;Windows Subsystem for Linux (WSL)&lt;/code&gt; running on the Windows machine, while &lt;code&gt;SSH&lt;/code&gt; and/or &lt;code&gt;rsync&lt;/code&gt; are installed/running on &lt;code&gt;WSL&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  OPTION A: Copy from Ubuntu server VM to Windows client machine via WSL.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;scp /ubuntu-server/path/to/filename &amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:&lt;span class="s2"&gt;"/mnt/c/Users/windows-nameofuser/.../destination/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the command highlighted in green on the screenshot. I already have these files residing in my Ubuntu server's current directory.&lt;/p&gt;

&lt;p&gt;After running the command in green to copy the file, provide your Ubuntu server password as pointed to by the 1st arrow, also provide the password for the WLS user as pointed to by the 2nd arrow. The 3rd arrow points to the file being copied, and the 4th arrow points to the progress percentage of the copied file. It was copied to the Windows client machine via the WSL 100%.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20uq779oyy90dvbw3sps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20uq779oyy90dvbw3sps.png" alt="Image description" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scp&lt;/code&gt; Is the command used to copy the file.&lt;br&gt;&lt;br&gt;
&lt;code&gt;/ubuntu-server/path/to/filename&lt;/code&gt; Is the source path.&lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:"/mnt/c/Users/windows-nameofuser/.../destination/&lt;/code&gt; Is the destination path.&lt;/p&gt;

&lt;h3&gt;
  
  
  OPTION B: Copy file from Ubuntu server VM directly to Windows machine (NOT via WSL):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;scp /ubuntu-server/path/to/filename &amp;lt;windows-username&amp;gt;@&amp;lt;windows-ip&amp;gt;:&lt;span class="s2"&gt;"C:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;Users&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;windows-nameofuser&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;destination&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will copy a file directly to a Windows client machine (not through WSL) via OpenSSH installed on Windows using PowerShell, just as demonstrated in &lt;code&gt;OPTION B of Step 2&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;The first command in green lists out the files and directories in the current folder, among which are two files we shall be copying, as pointed to by the 1st and 2nd arrows.&lt;/p&gt;

&lt;p&gt;You will be authenticated to provide a password for both the source system &lt;code&gt;Ubuntu server&lt;/code&gt; and the destination system &lt;code&gt;Windows client machine&lt;/code&gt; you intend to copy to, as pointed to by the 3rd and 5th arrow. The 6th arrow shows the files were 100% copied.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0tm1vtw5qi90qyd7zb2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0tm1vtw5qi90qyd7zb2.png" alt="Image description" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./*.*&lt;/code&gt; Means, from the current path/directory &lt;code&gt;./&lt;/code&gt;, copy all files with zero or more character length &lt;code&gt;*&lt;/code&gt;, followed by a dot &lt;code&gt;.&lt;/code&gt; and then extension (e.g &lt;code&gt;.html&lt;/code&gt;, &lt;code&gt;.txt&lt;/code&gt;) having zero or more character length &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note: The file transfer is directly with the native Windows client machine; therefore, the Windows machine path convention of &lt;code&gt;C:\&lt;/code&gt; must be strictly followed. One of the double backwards slashes is made to escape the other backwards slash because the Windows path is enclosed within a quotation mark.&lt;/p&gt;

&lt;p&gt;Voila, we have successfully and securely copied the two files to our Windows client machine.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9wdv1553h9gpuev7tvl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9wdv1553h9gpuev7tvl.png" alt="Image description" width="501" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  OPTION C: Copy file from Windows client machine (via WSL) to Ubuntu server VM.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;scp &amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:&lt;span class="s2"&gt;"/mnt/c/Users/windows-nameofuser/.../filename"&lt;/span&gt; /ubuntu-server/path/to/destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's copy the file &lt;code&gt;ARP+Storm.pcap&lt;/code&gt; to the Ubuntu server VM's current path/directory &lt;code&gt;./&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Provide the password for the &lt;code&gt;WSL user&lt;/code&gt; as pointed to by the 2nd arrow. The 3rd and 4th arrows point to the file name and the percentage of the file copied, respectively.&lt;/p&gt;

&lt;p&gt;The 5th arrow shows that the file has been successfully copied to the Ubuntu server by listing all the files in the current path.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwoydfb5bzdsywp46ptf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwoydfb5bzdsywp46ptf.png" alt="Image description" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore:&lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:"/mnt/c/Users/windows-nameofuser/.../filename"&lt;/code&gt; Is the source path.&lt;br&gt;&lt;br&gt;
&lt;code&gt;/ubuntu-server/path/to/destination&lt;/code&gt; Is the destination path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Copy files using "rsync" (Remote SYNCchronisation).
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;rsync&lt;/code&gt; refers to "Remote SYNChronization". This is similar to the &lt;code&gt;scp&lt;/code&gt; command; replace the &lt;code&gt;scp&lt;/code&gt; command with the &lt;code&gt;rsync&lt;/code&gt; command.&lt;/p&gt;

&lt;h3&gt;
  
  
  OPTION I: Copy from Ubuntu server VM to Windows machine via WSL.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; /ubuntu-server/path/to/filename &amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:&lt;span class="s2"&gt;"/mnt/c/Users/windows-nameofuser/.../destination/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the file pointed to by the 1st arrow from the Ubuntu server to the Windows client machine using the &lt;code&gt;rsync&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We break the command into &lt;code&gt;two lines&lt;/code&gt; by using the backslash &lt;code&gt;\&lt;/code&gt; as pointed to by the 4th arrow, then press Enter. Provide the Ubuntu server user password as pointed to by the 2nd arrow. We have successfully copied the file to the Windows client machine using rsync, as pointed out by the 3rd arrow, we are provided with additional details regarding the copying of the files, including size and speed.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3koc6y0jijwgxvr7biwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3koc6y0jijwgxvr7biwc.png" alt="Image description" width="728" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;-avz&lt;/code&gt; are options (also called "flags") we passed to &lt;code&gt;rsync&lt;/code&gt;, and they control how the file transfer happens.&lt;br&gt;&lt;br&gt;
&lt;code&gt;-a&lt;/code&gt; &lt;strong&gt;Archive mode&lt;/strong&gt;. It preserves important file properties (permissions, timestamps, symbolic links, etc.). It ensures the copied file is a true replica of the original.&lt;br&gt;&lt;br&gt;
&lt;code&gt;-v&lt;/code&gt; &lt;strong&gt;Verbose&lt;/strong&gt;. It makes the command show you more details during the transfer. You’ll see what files are being copied in real-time, which is helpful for monitoring.&lt;br&gt;&lt;br&gt;
&lt;code&gt;-z&lt;/code&gt; &lt;strong&gt;Compression&lt;/strong&gt;. This compresses file data during transfer. Especially useful for transferring over a network (like Ubuntu VM to WSL) to speed up the process, especially for large files.&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  OPTION II: Copy file from Ubuntu server VM directly to Windows machine (NOT via WSL).
&lt;/h3&gt;

&lt;p&gt;First of all, &lt;code&gt;rsync&lt;/code&gt; is a Linux Tool. You cannot directly &lt;code&gt;rsync&lt;/code&gt; from Ubuntu to a pure native Windows client machine without some Linux-like layer &lt;code&gt;WSL&lt;/code&gt; or &lt;code&gt;Cygwin&lt;/code&gt;, on the Windows side. Therefore, this option is not achievable, except you directly install &lt;code&gt;rsync&lt;/code&gt; on the native Windows client machine (which is rare and can be very complicated).&lt;/p&gt;

&lt;p&gt;To prove to you that &lt;code&gt;rsync&lt;/code&gt; is not running on a native Windows client machine, let's type the &lt;code&gt;rsync&lt;/code&gt; command on PowerShell, as pointed by the 2nd and 3rd arrow, the command &lt;code&gt;rsync&lt;/code&gt; is not recognised as a command in the PowerShell.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqk2dw67iokoz6z69unmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqk2dw67iokoz6z69unmp.png" alt="Image description" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I deliberately brought out this OPTION II, so you can understand when and where &lt;code&gt;scp&lt;/code&gt; and &lt;code&gt;rsync&lt;/code&gt; can be used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  OPTION III: Copy file from Windows machine (via WSL) to Ubuntu server VM.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; &amp;lt;WSL-username&amp;gt;@&amp;lt;WSL-ip&amp;gt;:&lt;span class="s2"&gt;"/mnt/c/Users/windows-nameofuser/.../filename"&lt;/span&gt; /ubuntu-server/path/to/destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s copy a file &lt;code&gt;testing.html&lt;/code&gt; from the Windows client machine via the &lt;code&gt;WSL&lt;/code&gt; to the Ubuntu server VM at the current directory/path &lt;code&gt;./&lt;/code&gt; as pointed to by the 2nd arrow.&lt;/p&gt;

&lt;p&gt;Provide the &lt;code&gt;WSL user password&lt;/code&gt; as pointed to by the 3rd arrow. The 4th arrow points to the copied file details during transit.&lt;/p&gt;

&lt;p&gt;The 5th arrow points to the copied file after successfully copying it to the Ubuntu server VM.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0phxuu2zxge5oeeleb9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0phxuu2zxge5oeeleb9t.png" alt="Image description" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The &lt;code&gt;OPTION III&lt;/code&gt; worked because &lt;code&gt;WSL&lt;/code&gt; is standing as an intermediary between the Windows client machine and the Ubuntu server VM, and because &lt;code&gt;WSL&lt;/code&gt; is an Ubuntu system, &lt;code&gt;rsync&lt;/code&gt; was installed and can be used to communicate with another Linux system (Ubuntu server VM).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which Method to Use?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For one-time transfers: &lt;code&gt;scp&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;For large files: &lt;code&gt;rsync&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/file-sharing-using-scp-and-rsync" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/file-sharing-using-scp-and-rsync&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Cybersecurity Home Lab: Installs Ubuntu Server On VMware Workstation Pro.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Wed, 04 Jun 2025 13:19:06 +0000</pubDate>
      <link>https://forem.com/agbuenoch/cybersecurity-home-lab-installs-ubuntu-server-on-vmware-workstation-pro-46g</link>
      <guid>https://forem.com/agbuenoch/cybersecurity-home-lab-installs-ubuntu-server-on-vmware-workstation-pro-46g</guid>
      <description>&lt;h2&gt;
  
  
  Installing Ubuntu Server "Installer Image" On VMware Workstation Pro.
&lt;/h2&gt;

&lt;p&gt;This project documents the step-by-step process of downloading and installing the &lt;code&gt;Ubuntu Server Installer Image&lt;/code&gt; on &lt;code&gt;VMware Workstation Pro&lt;/code&gt; virtualisation tool, to perform log analysis and monitoring.&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VMware Workstation Pro&lt;/td&gt;
&lt;td&gt;Virtualization platform.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ubuntu Server (&lt;code&gt;ISO&lt;/code&gt; file)&lt;/td&gt;
&lt;td&gt;Server OS for SIEM and log analysis tools, as a base for detection tools like Wazuh, ELK, and Splunk.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This project walks you through how to manually download and install Ubuntu Server &lt;code&gt;Installer Image&lt;/code&gt;, an &lt;code&gt;.iso&lt;/code&gt; file to create an Ubuntu server VM and specify its basic settings and configurations in &lt;code&gt;VMware Workstation Pro&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Download the Ubuntu Server Installer Image.
&lt;/h2&gt;

&lt;p&gt;Click &lt;a href="https://ubuntu.com/download/server" rel="noopener noreferrer"&gt;Ubuntu Server&lt;/a&gt; to download the &lt;code&gt;installer image&lt;/code&gt; for &lt;code&gt;Ubuntu 24.04.2 LTS&lt;/code&gt;. &lt;code&gt;LTS&lt;/code&gt; stands for Long-Term Support, which means five years of free security and maintenance updates, extended to &lt;code&gt;10 years&lt;/code&gt; with &lt;a href="https://ubuntu.com/pro" rel="noopener noreferrer"&gt;Ubuntu Pro&lt;/a&gt; if enabled. This means Ubuntu Pro delivers 10 years of expanded security coverage on top of Ubuntu’s Long Term Support (LTS) commitment, in addition to management and compliance tooling. After installing the installer image, we will enable &lt;code&gt;Ubuntu Pro&lt;/code&gt;, which is free for personal use.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: The arrows are sequentially numbered for easy understanding of the sequential steps to follow. Some of the directions the arrow points at are not links, but just to draw your attention to key observables.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo78ol0g5iczysphmw6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo78ol0g5iczysphmw6s.png" alt="Image description" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The download will start immediately after you click on the download button, and you will be redirected to the page below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fju4hef1yl0pxus5u2mp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fju4hef1yl0pxus5u2mp1.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the download is in progress, scroll downward and click on Get Ubuntu Pro, or you can visit the Ubuntu Pro website here to register for free. Click on the “Get Ubuntu Pro” as pointed to by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexk4s4tkk8diuhhjnyx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexk4s4tkk8diuhhjnyx2.png" alt="Image description" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “&lt;strong&gt;Get Ubuntu Pro Now&lt;/strong&gt;” as pointed to by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wwimq6j8f5vbmkhbvcq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wwimq6j8f5vbmkhbvcq.png" alt="Image description" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the “&lt;strong&gt;Myself&lt;/strong&gt;” button as pointed to by the 1st arrow and click on “&lt;strong&gt;Register&lt;/strong&gt;” as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe9f27w498pj2myi0cbyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe9f27w498pj2myi0cbyi.png" alt="Image description" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don't have an account, check the first button; otherwise, check the second button as pointed to by the 1st and 2nd arrows respectively, and provide your details accordingly.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81tc2cy4e4qdwi80xa5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81tc2cy4e4qdwi80xa5p.png" alt="Image description" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you sign in, copy down the “&lt;strong&gt;Token&lt;/strong&gt;” pointed to by the 3rd arrow; we will use it to upgrade the Ubuntu server to “&lt;strong&gt;Ubuntu Pro&lt;/strong&gt;” when we successfully create the Ubuntu server on the VMware Workstation Pro. The 4th arrow points to the command we should use to enable Ubuntu Pro.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzs1zsqqg6oi1fzwkj1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzs1zsqqg6oi1fzwkj1u.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you subsequently want to view your Token, visit ubuntu.com and click on "&lt;strong&gt;Sign in&lt;/strong&gt;" at the top right-hand corner of the home page, and you will be redirected to the Ubuntu One Account Page. If this is the first time you're visiting ubuntu.com, you will be prompted with the cookie pop-up below, You can accept by clicking “&lt;strong&gt;Accept all and visit site&lt;/strong&gt;” or choose to manage your preference by clicking the “&lt;strong&gt;Manage your tracker settings&lt;/strong&gt;”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbbds0oztgwfzw8q4r5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbbds0oztgwfzw8q4r5k.png" alt="Image description" width="670" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzee2aa2bl2udqo8066s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzee2aa2bl2udqo8066s.png" alt="Image description" width="330" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be redirected to the page below. Provide your login details and click on “&lt;strong&gt;Log in&lt;/strong&gt;”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovspox0oezh7to1kg58n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovspox0oezh7to1kg58n.png" alt="Image description" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the "&lt;strong&gt;Yes, log me in&lt;/strong&gt;"&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkl75zowt9daxph9vwan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkl75zowt9daxph9vwan.png" alt="Image description" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suppose you previously “&lt;strong&gt;Accepted the cookie pop-up&lt;/strong&gt;”, the next time you click on "&lt;strong&gt;Log in&lt;/strong&gt;", you won't be asked to enter your username and password again. In that case, you will be redirected to the screenshot immediately above, and you can click on the “&lt;strong&gt;Yes, log me in&lt;/strong&gt;” because the cookie saved your login details and remembered you.&lt;/p&gt;

&lt;p&gt;You have successfully logged in. You will then be redirected to this page, click on the “caret” symbol and click on the “&lt;strong&gt;Ubuntu Pro dashboard&lt;/strong&gt;” as pointed to by the 1st and 2nd arrows, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1l4gvw5vxg3w7srdnt9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1l4gvw5vxg3w7srdnt9.png" alt="Image description" width="330" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Open VMware Workstation and Create a New Ubuntu VM
&lt;/h2&gt;

&lt;p&gt;Because the Ubuntu Server Installer Image is an &lt;code&gt;.iso&lt;/code&gt; file, click on “Create a New Virtual Machine” as pointed to by the arrow. Follow the remaining installation process using the arrows as a guide.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8jlraj1y87866971suf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8jlraj1y87866971suf.png" alt="Image description" width="547" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kfid6aw83tpx6crfpst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kfid6aw83tpx6crfpst.png" alt="Image description" width="588" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The path to the downloaded &lt;code&gt;.iso&lt;/code&gt; file is automatically detected, but if you changed the location, you can click on "&lt;strong&gt;Browse&lt;/strong&gt;" as pointed to by the 2nd arrow to the new location where you kept the .iso file.&lt;/p&gt;

&lt;p&gt;If you prefer to install the operating system later after creating the Ubuntu Server Virtual Machine, you can alternatively choose to check the button as pointed to by the 3rd arrow; otherwise, stick to the default selection as pointed to by the 1st arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8868sdk75sk0qok3k4kp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8868sdk75sk0qok3k4kp.png" alt="Image description" width="571" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give the Ubuntu server a name of your choice as pointed to by the 1st arrow; you will be guided on acceptable syntax for your choice of names, for example, the use of upper case letters is not allowed.&lt;/p&gt;

&lt;p&gt;You can also choose to change the location where the VM should reside by clicking on the "&lt;strong&gt;Browse&lt;/strong&gt;" button as pointed to by the 2nd arrow; otherwise, click "&lt;strong&gt;Next&lt;/strong&gt;".&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspphqgehozxjlc80bom7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspphqgehozxjlc80bom7.png" alt="Image description" width="574" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As pointed out by the 1st arrow, assign the disk size; &lt;code&gt;20GB&lt;/code&gt; is the minimum size recommended.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s329fojzbk0odhjxen5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s329fojzbk0odhjxen5.png" alt="Image description" width="571" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the “Customise Hardware” as pointed to by the 1st arrow only if you want to change any settings or configuration. Changes can still be made even after the installation.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecl4cy2pblz09o50lxp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecl4cy2pblz09o50lxp0.png" alt="Image description" width="580" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you click on “&lt;strong&gt;Finish&lt;/strong&gt;”, you will be presented with the VM interface shown below. The 1st arrow points to the “&lt;strong&gt;Play/start&lt;/strong&gt;” button used for powering the VM. Click on the “caret” symbol for other options like “Suspend, and Restart” buttons. You can edit the VM settings/configurations by clicking on the link pointed to by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsiju0tdtdnvrpnstcfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsiju0tdtdnvrpnstcfl.png" alt="Image description" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start the Ubuntu Server
&lt;/h2&gt;

&lt;p&gt;From the screenshot above, start the Ubuntu server by clicking on the green play button pointed by the first or second arrow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The arrows in the screenshots provided in the &lt;code&gt;Step 3&lt;/code&gt; are not in sequential order. I will explain each one of them that is necessary.&lt;br&gt;
Use the mouse to scroll up and down the VM interface, using the &lt;code&gt;scroll bar&lt;/code&gt;. &lt;br&gt;
At this stage, you will start navigating between your native machine/host and the Ubuntu server VM. On your native machine keyboard, press “Ctrl G” or move the mouse cursor directly inside the VM and click inside it, to move/direct your keyboard input into the VM, this will enable you to interact with the VM directly using the keyboard which is very important especially at this installation process of starting the Ubuntu Server for the first time. While the keyboard focus is on the VM, press &lt;code&gt;Ctrl Alt&lt;/code&gt; or move the mouse to click anywhere outside the VM, to move/direct the keyboard input out of the VM to the native machine.&lt;br&gt;
Always scroll downward to accept the setting you have checked or selected. I used arrows to point to the scroll bar at the extreme right side of the window.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcj957176asbfyz9bpr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcj957176asbfyz9bpr0.png" alt="Image description" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Press &lt;code&gt;Ctrl G&lt;/code&gt; to direct keyboard input to the VM, and press "&lt;strong&gt;Enter&lt;/strong&gt;" on your keyboard to activate the highlighted choice as pointed to by the 1st arrow. Do this for all other ones.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfo1gd636cudeco087md.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfo1gd636cudeco087md.png" alt="Image description" width="759" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7wxgd5pgvvvqgjabwbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7wxgd5pgvvvqgjabwbo.png" alt="Image description" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to change your keyboard layout from the default one detected “&lt;strong&gt;[English US]&lt;/strong&gt;” you can move the mouse to “Identify Keyboard” and press Enter on your keyboard, as pointed to by the 2nd arrow, otherwise just scrow down and press Enter when the mouse is on “&lt;strong&gt;Done&lt;/strong&gt;”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kznafzs4ogezez6ck90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kznafzs4ogezez6ck90.png" alt="Image description" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suppose you chose to “&lt;strong&gt;Identify Keyboard&lt;/strong&gt;”. In that case, you will be asked a couple of questions, which I sample just two screenshots below, answer them accordingly, and your keyboard layout will be automatically detected.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6regnj32lq0c7kpxqwp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6regnj32lq0c7kpxqwp.png" alt="Image description" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctvp9o72ioj989jil6lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctvp9o72ioj989jil6lk.png" alt="Image description" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flk929zh9c0ihbu88qp7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flk929zh9c0ihbu88qp7d.png" alt="Image description" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the keyboard layout settings, the next steps follows. Move the mouse to activate/select the "&lt;strong&gt;Ubuntu Server&lt;/strong&gt;" as pointed to by the 3rd arrow. The &lt;code&gt;X&lt;/code&gt; inside the parentheses means it has been selected or activated, scroll downward as pointed to by the 2nd arrow, direct the mouse input back to the VM, ensure the mouse is active on “&lt;strong&gt;Done&lt;/strong&gt;”, and press Enter.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm947uh6rytycuk6l5mwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm947uh6rytycuk6l5mwg.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the "&lt;strong&gt;Network configuration&lt;/strong&gt;", scroll downward and press Enter while on "&lt;strong&gt;TBD&lt;/strong&gt;"&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmidznfintjw4worbikz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmidznfintjw4worbikz.png" alt="Image description" width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0hgdchzjfjbxprta535.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0hgdchzjfjbxprta535.png" alt="Image description" width="800" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Skip the proxy configuration, scroll down, and press Enter while on the “&lt;strong&gt;Done&lt;/strong&gt;” button.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzaenee1rgwdlvjre4wi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzaenee1rgwdlvjre4wi.png" alt="Image description" width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrr6t9q8mzdk3a1bya4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrr6t9q8mzdk3a1bya4y.png" alt="Image description" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll downward and press Enter.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2sq2ixu511gl2l4to6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2sq2ixu511gl2l4to6c.png" alt="Image description" width="800" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select “&lt;strong&gt;Use an entire disk&lt;/strong&gt;” as pointed to by the 2nd arrow. The &lt;code&gt;X&lt;/code&gt; means it is selected.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjmvsdn4rdfjy6xfyf4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjmvsdn4rdfjy6xfyf4i.png" alt="Image description" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl0buoqcj8l4klw1mfdw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl0buoqcj8l4klw1mfdw.png" alt="Image description" width="800" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be presented with the storage configuration summary, scroll down and press Enter when you are active on the “&lt;strong&gt;Done&lt;/strong&gt;” button.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnzdqnw06dc2xx7g3cij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnzdqnw06dc2xx7g3cij.png" alt="Image description" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkih7hlb0spkx5sfw2cv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkih7hlb0spkx5sfw2cv.png" alt="Image description" width="800" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3y3prtvldu1zs1vdqmz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3y3prtvldu1zs1vdqmz.png" alt="Image description" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be prompted to click on “&lt;strong&gt;Continue&lt;/strong&gt;”&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkwabnt1wrxaq1zzac4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkwabnt1wrxaq1zzac4n.png" alt="Image description" width="650" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next is “Profile Configuration”, provide the following details to sign up for login into the Ubuntu server after the installation. Use the "Tab" key on your keyboard to move from one row to another after entering the values.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgctk3m798qoeeb22sauz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgctk3m798qoeeb22sauz.png" alt="Image description" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the “&lt;strong&gt;Skip Ubuntu Pro setup for now&lt;/strong&gt;” and scroll down the cursor to “&lt;strong&gt;continue&lt;/strong&gt;” and press Enter.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwsh0pywobsbkwb2sct2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwsh0pywobsbkwb2sct2.png" alt="Image description" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the “&lt;strong&gt;Install OpenSSH server&lt;/strong&gt;” as pointed to by the arrow below. Ensure you see &lt;code&gt;X&lt;/code&gt; appear inside the bracket, scroll down and press Enter on “&lt;strong&gt;Done&lt;/strong&gt;”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nw4ga2kr4gawuao1c2r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nw4ga2kr4gawuao1c2r.png" alt="Image description" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The installation process will begin; this will take a considerable number of hours, depending on your native machine specifications. The higher RAM and processor cores you have, the faster the installation process.&lt;/p&gt;

&lt;p&gt;When you are running out of battery or internet connectivity at any stage of the installation especially this stage, I recommend you do not shut down your system or “&lt;strong&gt;power off&lt;/strong&gt;” the VM or exit the VMware Workstation Pro, you should put your system on “&lt;strong&gt;sleep&lt;/strong&gt;” mode and wake it up later when you have internet connections or charged your battery, to continue the installation process. Just remember, this process can take a while.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvpt3p4emhi2g1va85u6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvpt3p4emhi2g1va85u6.png" alt="Image description" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfqqg4k9ehba4bbm62up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfqqg4k9ehba4bbm62up.png" alt="Image description" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnqbh5piqd372gkzngya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnqbh5piqd372gkzngya.png" alt="Image description" width="721" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now "&lt;strong&gt;shut down&lt;/strong&gt;” the Ubuntu server. Click on the “&lt;strong&gt;caret&lt;/strong&gt;” symbol as pointed by the 1st arrow, you will see “&lt;strong&gt;Shut Down Guest&lt;/strong&gt;” as pointed to by the 2nd arrow, click on it.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2vhrez2v9md40uwsagy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2vhrez2v9md40uwsagy.png" alt="Image description" width="520" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you shut down the VM, you will see the VM interface shown below, click on the "&lt;strong&gt;CD/DVD (SATA)&lt;/strong&gt;", so that we can detach the &lt;code&gt;.iso&lt;/code&gt; file installation directory from our native machine.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31nrbyblcq5kpnsx43s6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31nrbyblcq5kpnsx43s6.png" alt="Image description" width="629" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As pointed out by the 1st arrow, uncheck the “&lt;strong&gt;Connect at power on&lt;/strong&gt;” button. Checked the “&lt;strong&gt;Use physical drive&lt;/strong&gt;” as pointed to by the 2nd arrow. Click on the “&lt;strong&gt;caret&lt;/strong&gt;” symbol pointed to by the 3rd arrow and select “&lt;strong&gt;Auto detect&lt;/strong&gt;”, scroll down as pointed to by the 4th arrow and click on “&lt;strong&gt;ok&lt;/strong&gt;”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yyra9pta0tx85x4nofu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yyra9pta0tx85x4nofu.png" alt="Image description" width="752" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, “&lt;strong&gt;Power on&lt;/strong&gt;” the Ubuntu server again by clicking on the green power button right in the VM interface. This time, the server will not load directly from the &lt;code&gt;.iso&lt;/code&gt; file on our local machine. This will also take a while, just as indicated on the screenshot below.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3uie0fyx8iv3cpwtelv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3uie0fyx8iv3cpwtelv.png" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be prompted to log in to the Ubuntu server using the signup details provided during the installation process above in “&lt;strong&gt;Profile Configuration&lt;/strong&gt;”. Enter your username as pointed to by the 1st arrow, press “&lt;strong&gt;Enter&lt;/strong&gt;” on your keyboard and enter the password as pointed to by the 2nd arrow. &lt;/p&gt;

&lt;p&gt;Voila! We have successfully logged in to the Ubuntu server and received a welcome message to “&lt;strong&gt;Ubuntu 24.04.2 LTS&lt;/strong&gt;”. The 3rd arrow points to the message that says &lt;code&gt;ESM - i.e Extended Security Maintenance is not enable&lt;/code&gt;. This is referring to the “&lt;strong&gt;Ubuntu Pro&lt;/strong&gt;” and we will enable this feature in the next step so that we can receive additional future security updates up to 10+ years. After the welcome message and other additional information, we are presented with a “&lt;strong&gt;Prompt&lt;/strong&gt;” to interact with the Ubuntu server. Let's explain the entire components of the “&lt;strong&gt;Prompt&lt;/strong&gt;”. The 4th arrow points to the username, i.e the user currently logged in to the server. The 5th arrow points to the host/machine name, which is “ubuntu-server”; this is the name given to this Ubuntu server VM. The 6th arrow points to the dollar sign &lt;code&gt;$&lt;/code&gt;, which refers to a normal user with less privileges. If this were an administrator or super user, the symbol or sign would be a hash sign &lt;code&gt;#&lt;/code&gt;, which means the logged-in user would have a root user privilege.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfv96p5gqgf490iw9s16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfv96p5gqgf490iw9s16.png" alt="Image description" width="733" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Enable Ubuntu-Pro
&lt;/h2&gt;

&lt;p&gt;Copy the token assigned to you when registering for “&lt;strong&gt;Ubuntu Pro&lt;/strong&gt;” as demonstrated above, and run the command shown below. You will be required to provide a password for the user who is currently logged in to this server, this is to ensure the command is run by an authorized user.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ryg0bac8x38escz3jwm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ryg0bac8x38escz3jwm.png" alt="Image description" width="616" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As pointed out by the arrow below, our &lt;code&gt;Extended Security Maintenance - ESM&lt;/code&gt; is now enabled, which implies that the “&lt;strong&gt;Ubuntu Pro&lt;/strong&gt;” is now enabled and attached to our Ubuntu server.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxwflwcj1bhib62l8oxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxwflwcj1bhib62l8oxm.png" alt="Image description" width="632" height="321"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/cybersecurity-home-lab" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/cybersecurity-home-lab&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>ubuntu</category>
      <category>linux</category>
    </item>
    <item>
      <title>Cybersecurity Home-Lab: Installs Kali Linux and VMware Workstation Pro.</title>
      <dc:creator>Enoch Amachundi Agbu</dc:creator>
      <pubDate>Wed, 04 Jun 2025 11:34:32 +0000</pubDate>
      <link>https://forem.com/agbuenoch/cybersecurity-home-lab-installs-kali-linux-and-vmware-workstation-pro-45ho</link>
      <guid>https://forem.com/agbuenoch/cybersecurity-home-lab-installs-kali-linux-and-vmware-workstation-pro-45ho</guid>
      <description>&lt;h2&gt;
  
  
  Installing Kali Linux "Pre-Built Image" and VMware Workstation Pro.
&lt;/h2&gt;

&lt;p&gt;This project documents the step-by-step process of setting up a &lt;code&gt;Cybersecurity Home Lab&lt;/code&gt; by downloading and installing &lt;code&gt;Kali-Linux Pre-Built Image&lt;/code&gt;, on &lt;code&gt;VMware Workstation Pro&lt;/code&gt; virtualisation tool, to simulate attacks.&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VMware Workstation Pro&lt;/td&gt;
&lt;td&gt;Virtualization platform.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kali Linux (&lt;code&gt;OVA&lt;/code&gt; file - Pre-Built Image)&lt;/td&gt;
&lt;td&gt;Offensive security and pentesting, for penetration testing and vulnerability scanning.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Virtualisation&lt;/strong&gt; is the process of creating a virtual version of computing environments, such as operating systems, servers, and networks, on a single physical machine. It enables users to run multiple systems simultaneously, making it an essential tool for testing, development, and cybersecurity labs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VMware Workstation Pro&lt;/strong&gt; is a powerful virtualisation software that allows users to run multiple virtual machines on a single physical system. It's widely used by IT professionals, developers, and cybersecurity analysts to simulate real-world environments without needing separate hardware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kali Linux&lt;/strong&gt; is a Debian-based Linux distribution specifically designed for penetration testing and ethical hacking. Pre-loaded with hundreds of security tools, it’s a go-to OS for cybersecurity professionals and learners aiming to test vulnerabilities, perform digital forensics, and learn offensive security techniques in a controlled environment.&lt;/p&gt;

&lt;p&gt;As of &lt;strong&gt;November 11, 2024&lt;/strong&gt;, VMware Workstation Pro is &lt;code&gt;free&lt;/code&gt; for personal use, which implies that a &lt;code&gt;license key is no longer required&lt;/code&gt; during installation. The company “BROADCOM” completed the acquisition of VMware on &lt;strong&gt;November 22, 2023&lt;/strong&gt;. VMware Workstation Pro became part of Broadcom's software portfolio at that time.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 1: Log in to the Broadcom support website
&lt;/h2&gt;

&lt;p&gt;Sign up or sign in to the &lt;a href="https://support.broadcom.com/" rel="noopener noreferrer"&gt;Broadcom Support Portal&lt;/a&gt;. If you already have an account, click on "Login"; otherwise, click on "Register" as pointed to by the second and first arrow, respectively.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxul7jv9wsejc69hwwoz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxul7jv9wsejc69hwwoz5.png" alt="Image description" width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assuming you are registering for the first time, fill in your information as shown below. You are expected to enter the text from the image pointed to by the 2nd arrow into the box below it, pointed to by the 3rd arrow. If you are unsure about the text, you have the option to click on the speaker to hear the text read out loud as pointed to by the 4th arrow. You can also click the refresh button to change the given text as pointed to by the 5th arrow. Click on Next and follow through with the signup process.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvylbg1cf6eyl4odkdxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvylbg1cf6eyl4odkdxl.png" alt="Image description" width="521" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After signing up successfully, log in to the portal.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjw4illnuuswgjmt81utt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjw4illnuuswgjmt81utt.png" alt="Image description" width="434" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 2: Download VMware Workstation.
&lt;/h2&gt;

&lt;p&gt;After logging in, you will be directed to the home page shown below:&lt;/p&gt;

&lt;p&gt;The 1st arrow points to your registered name, showing you are logged in. Click on either of the links pointed to by the 2nd arrow and click on “VMware Cloud Foundation”, next click on “My Downloads”.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrfxkdp5zmbs6bawbcty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrfxkdp5zmbs6bawbcty.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click “HERE” pointed to by the 2nd arrow in the screenshot below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fji8zhkogdiu4lfnn523u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fji8zhkogdiu4lfnn523u.png" alt="Image description" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Search by typing &lt;strong&gt;VMware Workstation&lt;/strong&gt; inside the search bar as pointed to by the 1st arrow and click on &lt;strong&gt;Show Results&lt;/strong&gt;. The matched results will be displayed, click on the &lt;strong&gt;VMware Workstation Pro&lt;/strong&gt; as pointed to by the 3rd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hdoh8dkipr3dswsk8tx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4hdoh8dkipr3dswsk8tx.png" alt="Image description" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two operating systems versions of the VMware Workstation Pro are displayed, pointed to by the two arrows; choose the one that corresponds to your operating system. We are selecting the Windows OS version.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3mj6ci7e9fhbpil88qj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3mj6ci7e9fhbpil88qj.png" alt="Image description" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the "caret" pointed to by the 1st arrow to expand the Windows OS “VMware Workstation Pro” version. Click on the latest version as pointed to by the 2nd arrow.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xrbumcse1dtss2o6jvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xrbumcse1dtss2o6jvu.png" alt="Image description" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the download button to start downloading &lt;strong&gt;VMware Workstation Pro&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv41sikfwarhmfkxf95w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv41sikfwarhmfkxf95w.png" alt="Image description" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Install the VMware Workstation
&lt;/h2&gt;

&lt;p&gt;Check your download folder or whichever location you specified for your downloads, and right-click on the executable file, click &lt;strong&gt;Run as Administrator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Follow through the remaining installation process using the arrows shown in the screenshots below.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ygwx8f0q2d1koyafabv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ygwx8f0q2d1koyafabv.png" alt="Image description" width="507" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3fnt0lnun487mfx58u5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3fnt0lnun487mfx58u5.png" alt="Image description" width="511" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I recommend you check the box pointed to by the 1st arrow, so you can be able to access your &lt;strong&gt;VMware Workstation Pro&lt;/strong&gt; through the native computer Command Prompt. You can choose to change the default installation location by clicking on the &lt;strong&gt;Change&lt;/strong&gt; button pointed to by the 3rd arrow and specifying your desired path/location. Click on &lt;strong&gt;Next&lt;/strong&gt; after that.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6ifkzcfbc8qc6t6tses.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6ifkzcfbc8qc6t6tses.png" alt="Image description" width="503" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the boxes and click on Next.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefncopwig48agc90vril.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefncopwig48agc90vril.png" alt="Image description" width="508" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the boxes and click on Next.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixec29km2p7g062i1q3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixec29km2p7g062i1q3p.png" alt="Image description" width="514" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwncivcrv4guf5d83iax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwncivcrv4guf5d83iax.png" alt="Image description" width="500" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmamolgvn5cljwblnlh4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmamolgvn5cljwblnlh4g.png" alt="Image description" width="513" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fie81rtwg5sstbs746j3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fie81rtwg5sstbs746j3h.png" alt="Image description" width="501" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Download the Kali Linux “pre-built image”.
&lt;/h2&gt;

&lt;p&gt;We can use a &lt;strong&gt;Pre-built image (.7z archive)&lt;/strong&gt; or an &lt;strong&gt;Installer image (.iso file)&lt;/strong&gt; to run virtual machines on VMware Workstations. We are focusing on downloading the pre-built image. The &lt;strong&gt;Installer image&lt;/strong&gt; has the most tedious installation process, where you have much control to specify installation settings.&lt;/p&gt;

&lt;p&gt;Visit Kali Platforms, click on the &lt;strong&gt;Virtual Machine&lt;/strong&gt; box as pointed to by an arrow. A &lt;strong&gt;Pre-built Image&lt;/strong&gt; VM is an existing virtual machine, we can quickly start the VM immediately after we download it without going through any installation and configuration settings.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy6h379pvlp5t2vqclw9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy6h379pvlp5t2vqclw9z.png" alt="Image description" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because we are using the VMware virtualisation platform, click on the VMware download button as pointed to by the 1st arrow, with the actual download size of &lt;code&gt;3.2G&lt;/code&gt; written just beside it. You can see that besides VMware, there are other virtualisation platforms like &lt;strong&gt;Oracle VirtualBox&lt;/strong&gt;. The download starts immediately you click on it. After that,  locate the downloaded &lt;strong&gt;archived file&lt;/strong&gt; and unzip it. Right-click on the file and click on "Extract File".&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzjpjpo5xiheqr9y09gu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzjpjpo5xiheqr9y09gu.png" alt="Image description" width="772" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Open the Kali Linux (pre-built image) in VMware Workstation Pro.
&lt;/h2&gt;

&lt;p&gt;Double-click on the “VMware Workstation Pro” shortcut to open it. Remember the Kali Linux “pre-built image” is an existing Virtual Machine; on this premise,  click on the “Open a virtual machine” and locate the extracted file unzipped above.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsv0znln8d17bwwbqomv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsv0znln8d17bwwbqomv.png" alt="Image description" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Locate the extracted file, double click on it to automatically open it, or select it and click on open to open it on &lt;strong&gt;VMware Workstation Pro&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gub846n2kngegjrzny0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gub846n2kngegjrzny0.png" alt="Image description" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After opening the Kali-Linux Pre-built Image, you will be presented with the interface shown below. The 1st arrow points to the virtual machine name, the 2nd arrow points to the machine state, which is currently “powered off”. The two 3rd arrows point to the start button, You can click on the ‘caret’ symbol right beside the green button to view and use other options like “shutdown, suspend, or restart” the VM. The VM settings can be edited and also upgraded as pointed to by the 4th arrow. The 5th arrow points to the device information regarding Memory and processors allocated, among others, which are all subject to change using the "Edit virtual machine settings" pointed to by the 4th arrow. The 6th arrow points to all open tabs, where we have the “Home” and “kali-linux-2025.1a-vmware-amd64” tabs.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flij6c9lcs94mx6ofyboc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flij6c9lcs94mx6ofyboc.png" alt="Image description" width="800" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the Start button as shown above, and enter the default username and password of “kali” to log in to the Kali Linux VM.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb53rrlgnxki3jv2f4yz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb53rrlgnxki3jv2f4yz.png" alt="Image description" width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Voila,  we have successfully logged in to the Kali Linux VM.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgj030n3j2h3k9uwc13ok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgj030n3j2h3k9uwc13ok.png" alt="Image description" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have successfully downloaded and installed both Kali Linux pre-built images and VMware Workstation Pro, and opened Kali Linux VM on VMware Workstation.&lt;/p&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;p&gt;Alternatively to the Kali Linux &lt;strong&gt;pre-built image&lt;/strong&gt;, you can choose to download and use the Kali Linux &lt;strong&gt;Installer Images&lt;/strong&gt; instead, as shown below. The Kali Linux Installer Images enable you to create the Kali Linux VM from scratch, where you are responsible for specifying all the system configurations and settings, such as RAM allocation and storage location, among others.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4a8dcg96iy7blcb6ed4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4a8dcg96iy7blcb6ed4.png" alt="Image description" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Recommended&lt;/strong&gt;, and you will be directed to the download page shown below. Select your system processor architecture, where &lt;code&gt;x86_64&lt;/code&gt; refers to the traditional &lt;strong&gt;64-bit processor architecture&lt;/strong&gt; commonly found in most PCs, while &lt;code&gt;Apple Silicon (ARM64)&lt;/code&gt; is Apple's proprietary 64-bit processor architecture used in newer Mac computers.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrptag1st7sgeztuxwx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrptag1st7sgeztuxwx3.png" alt="Image description" width="633" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Installer Image is an &lt;code&gt;.iso&lt;/code&gt; file, used to create virtual machines. After the download, open the VMware workstation, click on &lt;strong&gt;Create a New Virtual Machine&lt;/strong&gt; and locate where the &lt;code&gt;.iso&lt;/code&gt; file is downloaded and select it. Follow the on-screen prompts to proceed with the rest of the installations and settings. The default selections during the installation, in most cases, should work fine.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fff5rngoy6sebtvjcp3gf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fff5rngoy6sebtvjcp3gf.png" alt="Image description" width="478" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/agbuenoch/cybersecurity-home-lab" rel="noopener noreferrer"&gt;https://github.com/agbuenoch/cybersecurity-home-lab&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with me.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/agbuenoch" rel="noopener noreferrer"&gt;🔗 LinkedIn&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.x.com/agbuenoch" rel="noopener noreferrer"&gt;🔗 X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agbuenoch</category>
      <category>cybersecurity</category>
      <category>vmware</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
