creation of our IoT solution

FIND A SOLUTION AT Academic Writers Bay

University of Wolverhampton
School of Mathematics and Computer Science
Student Number:
IoT Security Workshop 3

Lab Description
In this lab, we begin the creation of our IoT solution. It is important to choose the components that constitute a solid foundation. As the operating system, we are going to use the Linux for several reasons:
The most obvious advantage is that Linux is free. Even if a single user licence of Windows does not cost much, the total cost of ownership can be higher if we extend our solution, further increase ongoing costs.
Linux-based systems are more reliable than Windows. Traditionally, Linux systems are known to run for years without having a failure or a situation that demands restarting.
Linux systems consume fewer system resources like RAM, disk space, and so forth, when compared to Windows. For our IoT platform, we need at least 1 GB of RAM and 20–25 GB of disk space.
Linux-based systems are built with security at a fundamental level. We don’t need to install anti-viruses.
The main reason is the control that Linux allows. You can decide what to install, or even recompile, in your system.
From the application point of view, we need Node.js (a Javascript engine) and LAMP stack installed on our system. LAMP is an acronym for Linux-Apache-MySQL-PHP. It consists of Apache HTTP Server, the MySQL relational database management system, and the PHP programming language. In addition, some other modules that I’ll introduce you as we progress.
As usual, while installing our environment, please take your time to search for any commands we are using, or packages. Blindly executing the commands in this document will get you nowhere, just miss a chance to learn something that will help you in your career.
Task 1, Prepare the Linux VM:
Before starting, check that you have at least 50gb free on your disk
We need the ISO to install Ubuntu Linux
Go to the website
In the download section, select the desktop version 20.10

Start the download…it is about 3Gb so it takes a bit of time depending on your connection
In the meantime, using the web, describe the differences between Ubuntu Desktop and Ubuntu Server? [MARKS]
Open VirtualBox and create a new virtual machine (in the location you prefer) with the following settings
Name: iot1731533 (replace the number with your student ID)
Type: Linux
Version: Ubuntu 64bit
Memory: 4096 MB
Hard Disk: Create the virtual hard disk now
Click “Create”
When asked for the size of the virtual hard disk, choose
Size: 40 Gb
Type: VDI
Dynamically allocated
Click “Create”
The new machine should appear on the left of VirtualBox’s window. Right-click on it, and click “Settings”. Under the “Advanced” tab, enable “Shared Clipboard” and “Drag’n’drop” by selecting “Bidirectional” on both of them.
Without closing the dialog, click “Storage”, select the CD/DVD drive under the controller IDE. On the right, click the small CD icon to open the menu and select “Choose a disk file”. Now find and open the Ubuntu ISO you have just downloaded. Press OK to close the dialog.
Start the machine by pressing the Start button on the top of the VirtualBox’s window. Check the correct ISO file has been selected and click again “Start”.
Press ENTER at the GRUB menu, so you don’t need to wait 30secs
After a bit, you will reach the following screen
Click on “Install Ubuntu” and:
Choose the correct keyboard layout for your computer (press Continue)
Select “Minimal installation” and leave the “Download updates” checked (press Continue)
Leave the “Erase disk and Install Ubuntu” checked and press “Install Now”
In the “Write disk” confirmation dialog, press “Continue”
Select your time zone
You need now to create the user as in the following figure
Name: <your first name>
Computer Name: iot1731533 (replace the number with your student ID)
Choose a password and write it down somewhere. Don’t forget it or you need to reinstall from scratch.
Press “Continue” and the installation finally starts installing the packages (it take a while, around 15mins so you can have a cup of the or coffee). At the end, click on “Restart now”. When asked to remove the installation media, simply press ENTER. Your new Ubuntu machine is ready.
Login to your new machine with your password:
When asked to register to Ubuntu Single Sign-On, press Cancel
Press Skip to close the Online Account dialog
Press Next, Next and Done to complete the configuration
If there are updates, you can do them pressing “Install Now” (It can take a bit)
Task 2, Installing basic software stacks:
Now that we have our instance ready, we can install LAMP. A LAMP stack is a set of open-source software used to create websites and web applications. LAMP is an acronym that stands for Linux-Apache-MySQL-PHP. It consists of the Linux operating system, an Apache HTTP Server, a MySQL relational database management system, and the PHP programming language.
However, before start, we need to check the firewall. In fact, Ubuntu servers use a firewall, named Uncomplicated Firewall, to make sure that only connections to certain services are allowed by enabling it.
Using the web, provide a brief description of Uncomplicated Firewall. Use your own words. [MARKS]
Open a terminal by right-clicking on the desktop and click “Open in Terminal”
Let’s install the SSH server to have secure access to our machine. In the terminal, type
sudo apt update
sudo apt install openssh-server -y
Check the services which are allowed in the firewall by typing
sudo ufw app list
SSH is probably already enable but, for sake of knowledge, let’s suppose we need to enable it with
sudo ufw allow OpenSSH
sudo ufw enable
Now let’s check the final status of the firewall with
sudo ufw status
You should get a response like the following.
Insert here your screenshot. [MARKS]
Now we need to install Apache Web Server. In the terminal type
sudo apt install apache2 -y
Check if Apache is already enabled in the firewall
sudo ufw app list
You can also check which ports are being used by the service with
sudo ufw app info “Apache Full”
Which ports are opened for Apache? [MARKS]
Now open your browser inside the vm (Firefox) and navigate to the address “localhost”. You should see the standard Apache page as follows
With our web server installed and up and running, it is time to install the database management system, in our case it is MySQL
sudo apt install mysql-server -y
Apparently, MySQL comes with a default configuration installed, and it is a good idea to secure our installation right now. After the MySQL installation, there is a preinstalled script that helps us secure our database system.
sudo mysql_secure_installation
Press Y at the first prompt
Choose MEDIUM for the strength-level of the password
Now insert a new password for database-root. It must contain lower- and upper-case letters, number and special characters. Please write down that password! Furthermore, note that you cannot see what you are typing, so be careful.
Press Y to confirm your password
Press Y to remove anonymous users
Press Y to remove root access from outside
Press Y to remove test database
Press Y to refresh privileges
Since you are cyber-security students, try to describe why we need to apply the previous limitations in order to improve the security of the installation (use the web). [MARKS]
In the last versions of MySQL, the root user is authenticated using a system plugin by default instead of with a password. We need to change it, because we want other applications and external programs to connect with MySQL. Enter the MySQL prompt by typing
sudo mysql
Verify the type of authentication with the following SQL query
SELECT user,authentication_string,plugin,host FROM mysql.user WHERE user=”root”;
And the result must be similar to
Now change the authentication with the next statement
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘your-password’;
Obviously, change your-password with the password you created before for MySQL, but keep the quotes! If you are successful, you should get the message “Query OK, …”. Let’s check again the root properties with
SELECT user,authentication_string,plugin,host FROM mysql.user WHERE user=”root”;
And now the plugin must be “mysql_native_password”
Flush the privileges with
And type EXIT to exit from MySQL.
Now it’s time to install PHP. PHP stands for Hypertext Preprocessor, which is an open source, server-side scripting language for the development of web applications and services. In the terminal, type
sudo apt install php libapache2-mod-php php-mysql -y
Let’s test it by creating a new PHP file with your student ID, for example
sudo nano /var/www/html/1731533.php
And add the content in the following screenshot (replace with your name)
Press CTRL+X, Y and ENTER to save and close the editor.
Open your browser again and navigate to http://localhost/1731533.php (replace with your student ID) and post your screenshot below. [MARKS]
We need now to install PHPMyAdmin to manage the database from the web. In the terminal, type
sudo apt install phpmyadmin php-mbstring -y
During the installation, PHPMyAdmin will ask you for some input:
In the first screen, select Apache Web server with Space. Then Tab to move to the Ok button and Enter.
When asked for “configure database for phpmyadmin with dbconfig-common”, press Yes
When asked for the PHPMyAdmin database user, replace “phpmyadmin@localhost” with “root@localhost”
When asked for the password, insert the MySQL password you created at step 9
We need to enable a plugin for Apache, typing
sudo phpenmod mbstring
And then restarting the web server with
sudo systemctl restart apache2
Let’s check if everything is working fine. Open your browser and navigate to http://localhost/phpmyadmin
Login using user “root” and your database password (from step 9) and you should see the following stage
NOTE: if you got the error “404 Not found”, please execute the instructions on the file “Workshop 3 – Troubleshooting” in the Canvas.
Put your screenshot here. [MARKS]
Well done. This is the end of workshop 3 and we have finally prepared our machine. You can close the terminal typing “exit” and you can shutdown your machine by clicking the top-right arrow and click “Power Off”.

YOU MAY ALSO READ ...  working with children in a health
Order from Academic Writers Bay
Best Custom Essay Writing Services