Lab01: Accessing the Linux Operating System
Objectives
This lab takes a look at UNIX through an online experience on a Red Hat Linux server.
In this lab, you will:
1) Log on to a Linux system locally and remotely
2) Log on to a Linux system using both character-based and graphical interfaces
3) Start a terminal window session from a graphic desktop.
4) Start multiple sessions on a single system
5) Perform simple tasks using both commands and graphical icons
6) Exit from a login session
Procedure
Print a hard copy of this lab document so that you have something to guide you as you
are performing the steps. You can also use the printed copy to record your answers to
the questions asked during the lab. When you submit the lab, you will be asked for some
of these answers. Have fun exploring...
Logging on to a Remote System
- To logon to Opus, you will have to access the Linux server remotely using a secure shell client (ssh).
From a Windows machine, use the PuTTY client that is on your desktop or under the programs/CIS
menu. Double-click
the icon and specify the name of the remote system (opus.cabrillo.edu), and ssh as the means
of access.
Note: when attempting to connect to Opus for the first time from a given machine, you may be
asked to confirm the identity of Opus, (71:a6:97:1a ...), select "yes" to continue.
If you are at a Linux command line, simply type: ssh -l logname opus.cabrillo.edu
where logname is your login name, e.g. guest90
A window will come up when you have established a connection, and you will be asked for three pieces of information, one at a time:
login as: _ Type in your login name and press the Enter key: guest90
Password: _ Type in your password and press
Enter
A brief sign-on message will appear and then you will be asked:
Terminal type? [xterm] _ Just press Enter
This tells Linux what type of terminal you are emulating so it knows the
capabilities of your screen/window.
Congratulations!! You are logged in.
Notice how the system prompts you for entering commands. Your prompt
is a string, ending with a $ symbol.
What is the string that precedes the $ symbol? /home/cis90/guest
Simple Commands
We will use some simple commands to gather some information before we logout.
Remember to press Enter after each command.
- date
Is the date and time correct? Should be more or less correct
- cal
Run the cal command.
How many months does it display? one
- who
How many users are currently logged onto the system?
If there is more than one person besides yourself, who has been on
the longest? answers will vary
- id
Find out who you are. What is your uid number? 503
- clear
Clear this information from your screen.
- ps
What is the name of the shell you are using? (Look in the CMD column) bash
- tty
What device is the operating system using to read input and write output for this login session?
/dev/pts/[0-9]
See what you can discover about the following commands.
What do each of the following commands do?
- uname displays the name of the operating system
- hostname displays the name of the computer you are on.
- history shows the past commands you have entered.
- To exit your current login session,type exit and you will terminate your shell, which
will log you off the system.
Logging on to a Local System
In the Computer Technology Center,(CTC), set yourself down in front of the Pentium 4 computers, (two-toned gray machines).
These computers run either Windows XP or RedHat Linux; shortly
after you turn the machine on, you will be given a choice as to which operating system to
boot. You have 30 seconds to make your decision, at which point it defaults to Windows.
Note the graphical interface and the text box prompting you to enter your login name.
- Log into the graphical system by providing your personal login name or cis90
if you have not received your personal account. The password to the ctc account is brush
- What do you notice to be different about a graphical login?
Besides the graphic display, your login name and password are read in separately, and when you type your
password, you see an asterisk (*) for each character you type.
Were you asked for a terminal type? No
- The multiuser capabilities of UNIX are usually exercised by users logging in from different
terminals e.g. terminals in various locations around an office building. An added feature of
being at the console of a UNIX machine is that you can run multiple login sessions from a
single console. Let's do that!
From the keyboard, type: <Cltl><Alt>F1
where F1 is function key 1. Be sure that these keys are all down at the same time.
- This is a character-based interface allowing you to login in a non-graphical format.
We often call this a terminal interface because it resembles the interface of a standard
serial terminal. Some times you'll hear the term virtual terminals used to describe
these logon screens because they look and behave as if they were real terminals.
- Log in from this terminal session using the same username and password as you did above.
- Use the who command to see who is on this system. You should see both
of your login sessions. How can you tell them apart? They are attached to different
terminals (ttys). Also, the time of login is recorded.
- In general, you can log in to a local UNIX machine from as many virtual terminals as
the operating system supports. How many does Linux support?
(Hint: Holding down <Cltl><Alt>, press the other Function Keys (2-7)
one at a time.)
- Log in to at least two of these virtual terminals, and using the commands you learned
on Opus, answer the following questions:
- Do you have the same user id on each of the virtual terminal sessions? yes
- Is your command history the same for all login sessions? no, they are kept separate until you log off.
- How can you distinguish between the different login sessions? Use the tty command.
- If you log off one session, do you get logged off all the sessions? No
- Before graphical user interfaces came out on UNIX, this was the way that users were
able to simulate multiple windows. UNIX had this concept of windows before
Microsoft did, the UNIX community called them screens. Let's go back to our
graphical session. Do you know how?
Press: <Cltl><Alt>F7
- A graphical interface is often thought as being easier to use than a command-line interface,
because you don't have to memorize commands, and you don't have to type so often. Instead,
you use the mouse to look around for meaningful icons and menus, and just point, click and
double-click. See if you can accomplish the tasks we did from the command-line by making menu
selections from the Main Menu, (The Red Hat on the bottom-left of the task bar).
How do you:
- Find the current date?
- Find a calendar of the current month?
- Can you find out who is on the system?
- Log off?
- Sometimes it's just easier to use a virtual terminal when you know what you want to do.
A graphical session allows you to run a terminal session in a separate window. Click on the
Main Menu icon and select System Tools menu. At the bottom of this menu, select
Terminal.
A 25 line terminal window should now appear so that you can run the who or
any other UNIX command.
(Warning: typing the exit command will close this window session.)
- For your last task, you will use the ssh command to remotely log in
to Opus and submit your lab. From your terminal window, type the following line:
ssh guest90@opus.cabrillo.edu
Note: You may receive a warning message about a key finger print. If you do, just
type yes and press Enter.
Supply your password ( and terminal type) when prompted.
- Once you are logged on to Opus, run the submit command.
submit
This is not a UNIX or Linux command, but it is still a command that
will ask you for your first and last name so that we can prepare a home directory for you.
It will also ask you the answers to five questions about the information you collected from this lab.
- Don't forget to log off both the Opus computer and your local terminal session and
your Graphical Desktop.
Congratulations!! You've completed your first lab.