Linux Basics from a Remote Terminal

 Comp 150 Course Home Page

Related pages
  1. Linux Basics from a Remote Terminal (this page)
  2. Static web page editing and forms are discussed in Html Form Editing.  
  3. See The Overall CGI Process for an introduction to dynamic web pages.
  4. The cgiTest Index Page links to all the resources on static and dynamic web development
You can access the Computer Science Linux Cluster several ways:  directly from the Linux lab in 412 Lewis Towers or Damen Hall 341 (not 342), or remotely from a Windows machine connected to the Internet, as in Damen Hall 342.  The same Linux login ID and password are used in either case, but there are many more options directly on a Linux Lab machine, starting from a graphical environment much like in Windows.  The instructions in these web pages will focus instead on remote access from Windows machines.  

For remote access the activities are more limited:  files can be moved back and forth with the graphical interface in Filezilla (available on the University Windows computers), while other actions on the Linux machines are carried out from a text based command-line interface, through a terminal program such as PuTTY, also on the University Windows machines.  This document covers connecting and logging in with PuTTY, initializing your web site, a few simple Linux commands.  Continue after this with the links in items 2-3 above.

I.  Connecting and Logging In Via a Terminal Program (PuTTY)

  1. First you must access the Computer Science Web server that will hold your web content via a terminal program.   The one in the University Windows labs is PuTTY (also available for free download from the web for your own machine):  
    1. Go to the start menu, Loyola Software -> Internet -> PuTTY
    2. You should see a popup window, and find the Field labeled Host name.  Enter
          xenon.cs.luc.edu
      You should see a circular radio button selected that says SSH (short for Secure SHell).
    3. click Open, and then you should see a terminal text window.
     
  2. Log in:  Note that you do NOT use your University 'Universal' ID and password.  The standard form for the Linux Lab login ID's is initials followed by your whole last name, all in lower case (based on the name you used to register).  For example Marie A. Juarez would have ID
       majuarez
    Your instructor or TA will give you the way to form your initial password.  If you are not in class, you can also look in Comp 150 on Blackboard, at the end of the Course Documents page.

    If this does not work you might try removing or inserting middle initials.  Your instructor should have a list of login ID's to check against if you keep having problems.
  3. If you have not yet changed your password from the initial setting:
    • Enter the command to change your password.  Note the shortened spelling:
      passwd
    • Follow the password changing instructions, entering your old password and then a new password of at least 8 characters, entered twice.  The system is picky about security.  If it thinks your choice is too simple, you will have to try again.  Remember your new password!

II.  Initializing a Web Site

Do this step only if you have not already started a web site under this login ID.
Enter the command I have set up to initialize a web site:
   /homes/users/cs/faculty/anh/initweb
Look at the output on the screen and check the URL given for your web page in a web browser.  Now you have a web site that you control!  Read on for what you can do with it.    

III. More on Linux and Terminal Commands

  1. In your terminal window, enter the command
       pwd
    This mouthful you get in response is the fully stated location of your home directory in the file system on Xenon.  Note that in Linux, components of the path are separated by '/' not '\'.  Linux has an abbreviation for your home directory, ~.  The current directory is shown to you after every command you enter.  You should see the ~ on the command line.
  2. Enter the command
       ls
    This is short for list a directory.  It lists the current directory by default.  You should see at least one entry, public_html, which is the main directory for your web pages.  
  3. Type the follow start of a command. (Do NOT press the enter key.)
       cd pu
    Now press the tab key.  This completes the directory entry if there is only one possibility.  You should see
      cd public_html
    Now press enter.  cd is short for change directory.  You should see ~/public_html in the command prompt.
  4. Enter the command
       ls
    again.  You should see index.html, the file web page created in part II. above. 
  5. Enter the command (with dash letter ell, short for long)
       ls -l
    This gives a more verbose and informative directory listing.  It lists file sizes, modification times, and permissions.  Permissions will be important to us.  There are typically ten characters in the permission string.  you should the permission string for index.html:
      -rw-r--r--
  6. Enter the command (with dash letter ell) for a long listingof you home directory
       ls -l ~
    You should see the permisions for public_html as
       drwx--x--x
    The first character of the permission string is - for a normal file and d for a directory.  The remaining characters come in three groups of three, the first group is permissions for the user, the next is for the users' group (which we will not worry about) and finally permssions for others (in particular anonymous web users).  We will mostly worry about and manipulate the permissions for others:  the last three characters.  If all permissions are granted they would be rwx meaning permission to read, write, and execute.  A dash in place of one of these means the permission is not granted.  It is important that public web pages be readable by others, as for your index.html, where the permissions for others (r--) indicate they can read but not overwrite or execute the file.  We will see later that x is required for regular files that are executable Python scripts.  For directories, x means that files in the directory are accessible by name.  If a directory has execute permission but not read permission, you can refer to a file by exact name, but you cannot run the ls command to see the contents.  The execute permission for the public_html directory is essential for anything in it to be visible from the web.
We will see later that we can change the permissions for files with the chmod command.  We will need this for executable scripts that make our web pages dynamic.

The naming conventions in a web URL are different than for a local user of the file system.  From the web, people can only see your pubic_html directory and underneath it, and this directory is refered to on the web as webpages.cs.luc.edu/~yourLoginId.  
  
Next: Static web page editing and forms are discussed in Html Form Editing.
The cgiTest Index Page   Course Home Page