Changes

Jump to: navigation, search

Tutorial 7 - Installing Linux / Live Linux / Virtualization

5,173 bytes added, 15:30, 28 September 2021
INVESTIGATION 3: INSTALLING THE GLOBAL PROTECT VPN AND CONNECTING TO MATRIX FROM YOUR VIRTUAL MACHINE
* [https://archlinux.org/pacman/pacman.8.html Pacman] (Pacman Package Manager). This is used in Arch Linux, as well as a few others.
* [https://www.unix.com/man-page/suse/8/zypper/ Zypper] Package Manager. This is used in OpenSUSE, which is popular for use on servers in Europe.
 
Since we are using Red Hat Enterprise Linux (or RHEL), we will be using DNF to install software.
Your first step to installing software should always be to test your Internet connectivity, as without a working connection you cannot resolve anything. To do this we can use the tool '''ping''', which is commonly used to troubleshoot network connectivity issues.
 
* Click on Activities in the top left corner of your RHEL VM (right next to the tiny Red Hat) and launch the Terminal application.
[[Image:1_-_terminal.jpg | 500px | Launch the Terminal.]]
 
* Enter the command <span style="color:blue;font-weight:bold;font-family:courier;">ping www.google.com</span>
 
* This should succeed. If it fails, you may need to troubleshoot network issues. Ask your professor for assistance. Press '''ctrl + c''' at the same time to kill this process.
 
* While you can switch to the '''root''' user in your VM and install software, it's a bad practice to do this. In industry, admins are commonly granted permissions through '''sudo'''; which stands for "superuser do". This is similar to run as administrator in Windows. Sudo can be configured to allow users elevated privileges to a subset of commands, or all commands. Additionally, usage is logged to the appropriate user. This makes tracking the activity of a system with many administrator a lot easier. When you initially installed RHEL, you did not set up sudo. We will do so now.
 
* Initially you will have to switch to root to configure sudo. Do this by issuing the command <span style="color:blue;font-weight:bold;font-family:courier;">su -</span>
 
* You should see your prompt change to '''[root@localhost ~]#'''. Now issue the command <span style="color:blue;font-weight:bold;font-family:courier;">visudo</span>
 
* This will allow you to edit the /etc/sudoers file and add the user you created when you installed RHEL. visudo works like using vi, except it checks the file to ensure the syntax is correct. If it is not, it will give you a warning. This is an extremely useful tool. Find the line that reads as follows: '''root ALL=(ALL) ALL'''
 
* This means that root is allowed to run from any terminal (first all), acting as any user (second all), and execute any command (third all). Below this line, add the following (substituting your username where appropriate). Be sure to enter insert mode by pressing the letter '''i''': '''senecaid ALL=ALL'''
 
* When you are done, press '''esc''' followed by ''':x''' to save your changes. This should return you to your command prompt. We want to test our elevated privileges from our regular user, so return to your normal prompt by typing <span style="color:blue;font-weight:bold;font-family:courier;">exit</span>
 
* Now we are going to update our operating system. To do this, issue the command <span style="color:blue;font-weight:bold;font-family:courier;">sudo dnf -y update</span>
 
* You may be prompted for your password. The inclusion of the '''-y''' option, auto assumes yes to prompts (this can be very handy). The update process may take a while. Do not interrupt it.
 
* The package required to connect to Seneca's VPN ('''openconnect''') is not available in the default RHEL repo. It is however, available from epel (extra packages for enterprise linux). First add this repo by issuing the command <span style="color:blue;font-weight:bold;font-family:courier;">sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm</span>
 
* Note, since you did not include the -y option, you will have to answer y (yes) when prompted.
 
* Now, install '''openconnect''' by issuing the command <span style="color:blue;font-weight:bold;font-family:courier;">sudo dnf -y install openconnect</span>
 
* Once this has completed, you can connect to Seneca's VPN by issuing the following command (be sure to substitute your username where appropriate) <span style="color:blue;font-weight:bold;font-family:courier;">sudo openconnect --protocol=gp senecavpn.senecacollege.ca -u username -b</span>
 
* Enter your password when prompted.
 
* Now you should be able to ssh into Matrix. Test this by issuing the following Linux command <span style="color:blue;font-weight:bold;font-family:courier;">ssh yoursenecaid@matrix.senecacollege.ca</span>
 
* Enter '''yes''' to share your public key.
 
 
* When prompted, enter your password. Were you able to connect to your Matrix account?
* Confirm you are in your home directory. What command did you use?
 
* Use a '''text editor''' (nano or vi) to create a file in your current directory called '''myvm.txt''' and enter the following text:
'''This is line 1
This is line 2
This is line 3'''
* Save and exit the text editor.
* Confirm that you created this file, and confirm the contents are correct.
 
* Enter the command: <span style="color:blue;font-weight:bold;font-family:courier;">~osl640/week7-check-1</span> to submit your tutorial.
 
* Once this succeeds, you may exit and shutdown your vm. note: you can shutdown from the command line by issuing the command: '''poweroff'''.
 
<span color=":red;">Important: Keep your RHEL VM, as you will need it for your project.</span>
= LINUX PRACTICE QUESTIONS =

Navigation menu