Changes

Jump to: navigation, search

Tutorial 1: Using Your Matrix Server Account

1,340 bytes added, 16:51, 24 September 2020
Part 1: Using the Linux Shell
[[Image:cli-prompt.png|thumb|right|120px|A '''shell''' is an interface / interpreter to allow a user to communicate with the Linux computer system. ]]
Although you need to study concepts throughout this course, you will also need to learn to '''issue and memorize simple as well as more advanced Linux commands'''. This requires that you practice issuing Linux commands on a frequent basis to become more comfortable when working within the Unix and '''Linux command-line environments'''.
For this course, it is important to learn how to '''open a command prompt in order to issue commands to perform common tasks'''. In Unix/Linux, a '''shell''' is simply an interface / interpreter to allow a user to communicate with the Linux computer system (server). Linux shells have evolved (improved) over a period of time. You will be using the '''Bash Shell''' which is considered to be user-friendly. By understanding how to issue Linux commands, you can create a file consisting of Linux commands and programming techniques called a '''shell script''' (learned later in this course) to automate tasks to make you a more '''productive''' user and administrator.
In the next investigation, you will learn how to '''connect''' to and '''login''' to your Matrix server account from a remote computer<br>such as your '''home desktop computer''' or your '''laptop computer'''.<br><br>
 
===Connecting to Your Matrix Account===
 
After connecting to the Seneca Global Portal, you can open a terminal in your Newer Windows 10, Mac or Linux computer and issue the following command:<br><br><span style="color:blue;font-weight:bold;">ssh senecauserid@matrix.senecacollege.ca</span><br><br>
 
You can also click on the following link to download and install a graphical SSH application for your Windows machine:<br>http://www.sfsu.edu/ftp/win/ssh/SSHSecureShellClient-3.2.9.exe<br><br>
=INVESTIGATION 1: ACCESSING YOUR MATRIX LINUX ACCOUNT=
You need to run an application called '''SSH''' in order to securely connect to your Matrix Linux account where you will learn to work in the Linux environment.<br>
In this sectioninvestigation, you will learn various methods of how to access connect and login to your '''Matrix Linux accountby issuing a command from your computer''' s text-based on the type of '''Operating System''' on your remove computerterminal or downloading, installing a running a Windows SSH graphical application.<br>
<!--
===CONNECTING TO YOUR MATRIX ACCOUNT FROM COMMAND LINE===
<br>You need to run an application called '''SSH''' in order to securely connect to your Matrix Linux account where you will learn to work in the Linux environment.<br><br>[[Image:gp1.png|thumb|right|130px|The '''Global Portal''' service must be connected.]]
'''If you <u>quickly</u> want to connect to your Matrix account, then perform the following steps:'''<br><br># Before proceeding, make certain that your '''Seneca Global Portal''' is connected.<br><br>If you haven't set this up, refer to the following link for instructions;<br>https://inside.senecacollege.ca/its/services/vpn/<br><br>Let's learn a quick and simple method of connecting to your Matrix account by opening<br>a text-based '''terminal''' and issuing the '''ssh command'''.<br><br>
# Determine which operating system that your computer is using.
# Refer to the following table for Try connecting to your Matrix account using the instructions in the table below based on <u>your </u> '''current operating system'''.<br><br>
<table style="margin-left:50px;">
<tr valign="top" style="text-align:center;"> <tdth>'''SSH from Newer Version of Windows 10:'''<br/th> <th>'''MacOSX:''' </th> <th>'''Linux:''' </th> </tr> <tr> <td> *From the start menu, type '''cmd'''and launch program
*In the command line, enter the following command:<br><span style="color:blue;font-weight:bold;font-size:.75em;">ssh senecausername@matrix.senecacollege.ca</span>
*Enter your password when prompted.<br>Answer '''yes''' to any questions it may ask you.
</td>
<td>
'''SSH from macOS:'''<br>
*Launch '''Terminal''' from the '''finder''' utility
*In the command line, enter the following command:<br><span style="color:blue;font-weight:bold;font-size:.75em;">ssh senecausername@matrix.senecacollege.ca</span>
*Enter your password when prompted.<br>Answer '''yes''' to any questions it may ask you.
</td>
<td>'''SSH from Linux:'''<br>
*From the menu, choose:<br>'''Applications''' > '''System Tools''' > '''Terminal'''.
*In the command line, enter the following command:<br><span style="color:blue;font-weight:bold;font-size:.75em;">ssh senecausername@matrix.senecacollege.ca</span>
</tr>
</table>
<br>
<ol><li value="4">Although you may be comfortable using this method to connect to your Matrix Linux account,<br>it is recommended to learn to run other SSH applications (e.g. graphical) for comparison purposes.<br><br></li></ol>
<ol><li value="3">Although you may be comfortable using this method to connect to your Matrix Linux account,<br>it is '''HIGHLY RECOMMENDED''' to learn to run other SSH applications (e.g. graphical) for comparison purposes.<br><br></li></ol> ===CONNECTING TO YOUR MATRIX ACCOUNT FROM A GRAPHICAL APPLICATION===
You can also install and run a free Windows '''graphical SSH application''' in order to connect to your Matrix account.<br>You may find it useful when running a graphical SSH application to '''copy and paste text'''.<br><br>
'''Perform the Following Steps:'''
# You should notice that the '''AppsAnywhere''' main application window appears.<br><br>'''NOTE:''' You may see a '''Validation in Process''' (or a '''validation successful''') message appear .<br>Although your applications are displayed, you <u>cannot</u> launch them until the validation process is successful.<br><br><table align="right"><tr valign="top"><td>[[Image:ma_validation.png|thumb|right|175px|Validation in Process Message in AppsAnywhere. ]]</td><td>[[Image:ma_system_tray.png|thumb|right|175px|Starting '''Cloudpaging''' Service in your '''System Tray'''. ]]</td><tr></table>You can tell if the system is still validating if an red exclamation mark <span style="color:red; font-weight:bold">!</span> appears in the application icon.<br><br>If the validation process is taking a long time, try opening the '''Cloudpaging''' service in the '''system tray''' located in the right side of the taskbar (you may need to click to display ALL services and then '''double-click''' the '''Cloudpaging''' application to launch).<br><br>
# After your AppsAnywhere session has been validated, click on the '''Search Apps''' area located in the top right corner of the AppsAnywhere window and type the word: <span style="color:blue;font-weight:bold">ssh</span><br><br>[[Image:apps-anywhere.png|thumb|right|250px|Several SSH applications will appear. We will use the application called '''SSH Client''' for this practice tutorial. ]]
# Several SSH applications will appear. <br><br>'''NOTE:''' All of these applications allow you to connect to your Matrix account.<br>We will use the application called '''SSH Secure Shell Client''' for this practice tutorial.<br><br>'''NOTE:''' If you encountere encounter an error trying to launch the SSH application via AppsAnywhere,<br>click on the following link for IT service desk contact info: [https://inside.senecacollege.ca/its/service-catalogue/contacts.html '''IT service desk'''].<br><br>
# Launch the '''SSH Secure Shell Client''' application icon to launch this program.<br><br>'''TIP:''' Prior to launching the application, you can add this to your '''favourites''' which will make it faster<br>to access this application in the future.<br><br><span style="color:blue">'''NOTE #1''': If you experience a problem launching any of your applications, you should note that there is a '''Cloudpaging Player''' application<br>that lists applications launched. If your application did '''NOT''' launch properly, '''right click''' on each listed application and select '''remove''' from the menu.<br>Then re-launch your application from the AppsAnywhere page (the IT service desk indicated that this can occasionally occur).<br><br>
# After the application has been installed, it should appear as an application icon on your desktop.<br>'''Double click''' the '''SSH Secure Shell Client''' application icon.<br><br>
# The main SSH Client window will appear. Click on the '''Quick Connect''' button.<br><br>'''NOTE:''' The Connect dialog box allows the user to specify the '''server name''' and your '''account name'''<br>to allow you to connect to the server.<br><br>[[Image:quick-connect-window.png|thumb|right|150px|Quick Connect Dialog Box ]]
# Click on the textbox labelled Hostnanme and enter the text: <span style="color:blue;font-weight:bold">matrix.senecacollege.ca</span><br><br>'''NOTE:''' You can use the hostname '''matrix''' since you are located <u>inside</u> Seneca's network.<br>If you where located <u>outside</u> Seneca's network, then you would need to enter the full domain name: '''matrix.senecac.on.ca'''<br>You will be using the latter hostname since you will be connecting to your Matrix account remotely and not within the college.<br><br>[[Image:share-public-key.png|thumb|right|150px|Dialog Box to Share Public Key on Remote Server ]]
# When connecting securely for the '''first time''', a dialog box will appear to share a "public key" with your Matrix account in order to make your interaction between your workstation and the remote Linux server secure within the network (i.e. encrypted to prevent unauthorized access by other users)<br><br>'''FYI:''' To make communications over a network secure, a computer generates '''two keys''': a '''private key''' that is kept on the computer, and a '''public key''', which can be shared with other computers. Transmissions from your computer uses the private key to encrypt ('''scramble''') transmission to the remote computer, which in turn, uses the public key to decrypt (unscramble) the transmission. Likewise, the remote computer uses the public key to encrypt (scramble) transmissions and your computer uses the private key to decrypt ('''unscramble''') those transmissions.<br><br>[[Image:ssh-password-prompt.png|thumb|right|150px|Password Dialog Box ]]
# Click the '''Yes''' button to share your public key.<br><br>
# Next, a dialog box will appear prompting you for your Matrix account password in order to gain entry to your Matrix account. Your Matrix password is identical to your Seneca password. As you type the password, the text will be blocked-out or hidden to prevent others from viewing the screen to obtain your password[[Image:ssh-authentication-response.png|thumb|right|150px|Authentication Response Dialog Box ]]<br><br>
# Enter your password and click '''OK''' or press '''ENTER'''<br><br>[[Image:ssh-login-error.png|thumb|right|150px|SSH Login Error ]]
# Click '''OK''' or press '''ENTER''' at the '''Authentication Response''' dialog box.<br><br>'''NOTE:''' If you encounter an '''error message''', this can occur for several reasons:<ol><li>You mis-spelled the '''name of the server'''</li><li>You mis-spelled your Matrix '''username''' (same username that you connect to my.senecacollege.ca)</li><li>You have '''CAPS LOCK''' on by mistake (your username should be '''lowercase''' only).</li><li>You mis-spelled your '''password''' (same password that you connect to my.senecacollege.ca)</li></ol><br>If you encountered an error logging in, issue the same steps to connect to your Matrix account,<br>but carefully check your server name, username and your password. If you continue to experience the same problems,<br>click on the following link for IT service desk contact info: [https://inside.senecacollege.ca/its/service-catalogue/contacts.html '''IT service desk'''].<br><br>[[Image:ssh-shell-window.png|thumb|right|150px|Matrix Shell Command Line Interface ]]
#If you entered your password correctly, the main SSH Linux shell should appear where you enter Linux commands.<br><br>The '''Matrix''' server has been configured to allow users to '''only interact with the Linux OS by issuing commands'''. There are various reasons for this, but the main 2 reasons are to '''force students to learn how to issue Linux commands''' as well as '''limitations to remote access to a graphical Linux server''' due to large number of users (students).<br><br>Later in the course, your instructor may demonstrate other ways of accessing '''graphical versions of Linux''', and how to launch a shell terminal.<br><br>
# Issue the following command: <span style="color:blue;font-weight:bold">man man</span><br>How many volume numbers are contained in the man pages (like '''executable commands/programs''', '''games''', or '''system administrator commands''')?<br><br>
# Press the letter <span style="color:blue;font-weight:bold">q</span> to exit the man command.<br><br>
# Issue the following Linux command to get help with the ls command: '''<span style="color:blue;font-weight:bold">man ls'''</span><br><br>'''NOTE:''' You can use the following short-cut keys within the man command to <br>help navigate throughout this utility to get help with the ls command (refer to table below):<br><br><table cellpadding="3"><tr><th style="border-bottom: 1px solid black;">Keyboard Shortcut</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><tr><td>'''ENTER'''</td><td>Move down one line</td></tr><tr><td>'''SPACEBAR'''</td><td>Move one screen down</td></tr><tr><td>'''&lt;ctrl&gt;&lt;fb&gt;'''</td><td>Move one screen up</td></tr><tr><td>'''/pattern/'''</td><td>Search for Pattern</td></tr><tr><td>'''q'''</td><td>quit man utility</td></tr></table><br>
# Navigate through the man utility for the '''ls''' Linux command and note the option letters that correspond to the following:<br><ul><li>Include directory entries whose names begin with a '''period'''</li><li>List in long ('''detailed''') format</li><li>'''Recursively''' list subdirectories encountered</li><li>'''Sort''' files by size</li><li>Display a '''forward slash''' (`/') immediately after each pathname that is a directory</li></ul><br>
# Exit the man utility for the ls command.<br><br>
# Issue the ls command for each of those option letters you wrote down to see how this command differs for each option.<br><br>'''NOTE: ''' The '''man''' utility can be used with the '''-k''' option to help list Linux commands that match a text pattern <br>that is contained within the help screen for a Linux command.<br><br># Although we will not be learning about pipeline commands (using the | character) until later, <br>try issuing the following pipeline command: <span style="color:blue;font-weight:bold">man -k copy | grep 8</span><br><br>How this does this pipeline command make it easier to obtain information regarding man command?<br><br># If you wish to change your password, you can change it by issuing the command: <span style="color:blue;font-weight:bold">passwd</span><br>What option for the passwd command can be used to change user info (such as name)?<br>'''Hint:''' use the '''man''' command for '''passwd'''.<br><br>'''NOTE:''' You are NOT required to change your Matrix password for this tutorial. The Matrix server is "synched" <br>with the my.senecacollege.ca server, so it is better to have your Matrix password changed at the same time <br>that you change your '''myseneca''' password.<br><br>
'''Command Line Editing'''
Learning '''shortcut keys''' in any OS terminal will allow you to be more productive as a sysadmin. You will focus on learning <br>Let's learn a few common Bash Shell keyboard shortcut keysand learn find out where you can access <br>online help for additional shortcuts (if required).
'''Perform the Following Steps:'''
# Press the up arrow key. What happens?<br><br>
# Press the <span style="color:blue;font-weight:bold">ctrl-u</span> key combination. What happens?<br><br>
# Press the <span style="color:blue;font-weight:bold">up arrow</span> key combination, and see what happens when you press <span style="color:blue;font-weight:bold">BACKSPACE</span> , <span style="color:blue;font-weight:bold">&lt;ctrl&gt;&lt;BACKSPACE&gt;</span> and <span style="color:blue;font-weight:bold">&lt;ctrl&gt;&lt;h&gt;</span>. <br>Why is it important to know those series of key combinations?<br><br>
# Press the <span style="color:blue;font-weight:bold">ctrl-u</span> key combination to clear the line.<br><br>
# Press the <span style="color:blue;font-weight:bold">ctrl-l</span> key combination. What happens? What is the advantage of using this key combination then issuing the '''clear''' command?<br><br>
:The Bash shortcut keys that you just learned are sufficient to perform Bash Shell editing.<br>Although you are NOT required to learn other short-cut keys, here is a link to a listing in case you are interested:<br>https://ostechnix.com/list-useful-bash-keyboard-shortcuts/
<br>
===Part 2: Performing Online Assignments ===
# When you have time this week, enter <span style="color:blue;font-weight:bold">2</span> in the menu selection area and perform the first 3 parts only<br>('''Unix Command Structure''', '''Entering and Editing Commands''', '''Using the Online Manual''').<br><br>
# When you have completed this section, you will be returned to the main window.<br>View the contents of this window to confirm that you completed this section.<br><br>'''NOTE:''' Although you are NOT allowed to use reference sheets for course evaluations, it is recommended to create one for your personal use, and write down Linux commands, their arguments and options, so your can successfully perform quizzes, midterm exam, and final exam.<br><br>
# In order to exit the assignment #1 screen, enter <span style="color:blue;font-weight:bold">q</span><br><br># Run the command to restart your assignment #1 and go to the main menu.<br>What do you notice?<br><br>If you successfully completed the first two sections, they no longer appear in reverse video.<br>This indicates that you have completed the first two sections of this assignment.<br><br># Exit your Assignment 1, and exit your Matrix session.<br><br># Proceed to the next section to perform additional practice. Linux is about "doing"! The more practice questions you perform, <br>the better mark you will achieve for this course and have a better foundation of issuing Linux commands to be more productive in your future courses.<br><br>
= LINUX PRACTICE QUESTIONS =
13,420
edits

Navigation menu