To gain some experience and understanding of
During this entire Lab record the name and purpose of any program that you use. This includes commands typed at the command line (since they are actually programs) and any icons that you click (since this also runs a program).
For the purposes of this lab, the computer that you are sitting in front of will be referred to as the local computer. In this lab you are going to use the local computer to connect to and then work on a remote computer. This remote machine is called loki. It's full Internet address is loki.cs.kent.edu.
Computers and operating systems that support many users at the same time are called multiuser systems. Since many people can use them at the same time each user has a separate account, identified by a username. Each of you have your own account on the remote computer loki. Your account will be protected from unauthorized access and use by way of a password. There is an initial default password which you will later change.
Computers used to be extremely large and expensive, and they produced great amounts of heat. So much heat was produced that they were put in their own large, air-conditioned rooms. People would work at a station called a terminal. A terminal is a combination of a keyboard and a monitor. Out of the back of the terminal would be a long wire that would directly plug into a port on the computer (in the large, air-conditioned, room). The monitor could only display characters/text, and the only input device was a keyboard, so people would use a Command Line Interface (CLI) to interact with the computer. Thus named because one typed commands on a single line.
Not many people use a terminal anymore to do any useful work at the computer. In general they sit at a local computer and use a terminal window (i.e. a shell) to work on a remote computer over a network. However, people who work at setting up and maintaining computer systems often use a terminal window to do their work.
A shell is a piece of software which provides a user interface to the computer's operating system, so that we may enter commands. There are many ways of accessing the shell on a remote computer from a local computer, including two programs called telnet and ssh. The remote computer would run telnet and/or ssh server software, and the local computer would run a telnet and/or ssh client software. We interact with the telnet client software on our local computer and it sends requests to the corresponding server software on the remote computer. Most multiuser computers run one of these server programs so that users can connect and use the machine.
As an aside, you have probably used and have on your home computer several other pieces of client software. You use an email client program ( Outlook Express, Mozilla Thunderbird, Netscape's email client) to access an email server to retrieve and send mail. Your web browser contains a web client which makes requests for html and other documents from a web server.
The shell access client software (the one running on your local computer) gives you a terminal window that along with a keyboard behaves the same as the old monitors used in the original terminals.
Shell access, such as through the ssh or telnet program is a simple and low-bandwidth way of connecting to a remote computer. Low-bandwidth means that only a small amount of information is transferred per second. It doesn't require a fast connection to the remote computer, and a client program can be run from any computer that is connected to a network, even if both computer are using different Graphical User Interface's (Windows, MAC OS, X-Windows etc) or not using a GUI at all.
There are two two ways of shell access to a remote computer, telnet and ssh. We are only going to use ssh.
Start the ssh client program. Use the link marked SSH Secure Shell under Start->Programs.
On some computer clicking on the Secure Shell Client automatically starts the Secure File Transfer (instead of the shell). This is not a problem. In fact, the program ssh contains also a GUI window for the transfer of files from your local machine to the remote machine (e.g. loki) and vice versa. The SSH File Transfer Client window is the GUI terminal window for the file transfer. Open Program--> Accessories --> Internet Tools --> SSH File Transfer Client (on other machines, such as ). The SSH File Transfer Client window divided in two part. The window on the left hand side part displays the content of your local machine. The right hands side of the window displays the remote machine (i.e. loki). After you connect you will see that the window on the right hand side turns from grey to white, which means that it is active and you will be able to view each single folder of your local machine as well as those of the remote machine. If you have never used loki before, there will be no files or folders. When you connect in the SSH File Tranfer Client, you are automatically connected in the Shell Client as well. Identify the New Terminal Window (the Shell client icon) button on the ribbon of the Secure File Tansfer program and press it to open the shell window.
To login you must know your account name. Be usre you know your account name (username).
Choose Quick Connect from the menu bar and enter the host computer name, loki.cs.kent.edu, and the account name. Replace YOUR_USER_NAME below with your username from the loki username list.
For the host name enter:
loki.cs.kent.eduFor the username enter:
YOUR_USER_NAMEFor the password enter your loki account password. Since this is probably the first time that you are using the account a default password has been setup. Your default password is initial_first + initial_last+last 6 digits of your ID Banner. You will change this password later in this lab. Insert your passwors and press Connect.
At this point you should be connected to
loki and on your account. If not, then try and login again.
The machine loki (loki.cs.kent.edu) is a PC running the linux operating system. The linux operating system is the newest member of the family of UNIX operating systems.
The different versions of the UNIX operating system were created by many different companies, such as AT&T, IBM, and Sun, running on many different kinds of computers from embedded computers (computers embedded in other devices) to mainframes. The majority of computers that form the backbone of the Internet are running some form of the UNIX operating system.
The core program of an UNIX operating systems is called the kernel. The linux kernel was originally written by Linus Torvalds when he wanted to use UNIX on his PC.
The linux operating system is an open source project. Essentially this means that all of the source code (the computer code written in a high-level language) is available to anyone who wants to use it. Companies and people can take it and extend it as long as they make their extensions also available. In fact, most of the software running on loki is open-source. At this point many companies, such as IBM, contribute source code to linux, All of it is available for free.
Installing and configuring the linux kernel is not particularly easy due to how flexible and powerful it is. To make linux easier to install commercial companies have come up with linux distributions that include the kernel and other software. Examples include RedHat, Debian, and Mandrake. The linux distribution used on loki is RedHat 8.0. These distributions are also freely available for download from these companies. However people often buy one of these linux distributions because of the convenience, manuals, and support. A linux distribution on a CD can be copied and distributed freely.
The linux kernel is only part of what an operating system needs. Utility programs, graphical user interfaces, development environments and even application software is also needed. Much of the basic utilities that can be used with Linux are provided by the GNU Project, and the rest of the needed software is provided by other open-source projects. This combination of the linux kernel and supporting software is referred to as GNU/Linux, however many people just call it linux.
The ideas of open source software seem mysterious to some people. They don't understand why people or companies would give away their source code and not charge for their product. One of the best introductions to these ideas is The Cathedral and the Bazaar.
The program ssh provides you a terminal window to a remote machine. This terminal window give you access to a shell program which provides a CLI (Command Line Interface). This shell program provides a user interface to the operating system, in which you use the keyboard to type in commands and view things using a text display.
The shell gives you a prompt and waits for you to enter a command. After you enter a command it carries it out and then returns to a prompt again.
There are many advantages to using a shell. The shell commands allow more options and are more sophisticated than using a windowing system. The shell commands, especially complicated ones, can be entered more quickly. Also long series of complicated shell commands can be easily automated.
Here are just some of the commands that the shell on loki will let you use. Type in each command and observe. Each command is actually a program. Show your activity by taking a screenshot of the window. Since you will experience many commands, pack as many commands as you can in a single screenshot.
whoamisee who you are logged in as (your account name)
whosee who's logged in to the computer
wsee who's logged and what their doing
uptimeshows various information including how long the system has been up and the load average
Take a screenshot of the previous 3 commands.
When you get access to an account for the first time on of your first tasks is to change your password. The password must be at least 6 characters long and include at least one digit. Of course, don't write it down in your notebook, and don't let anybody else know what it is. No one, unless you tell them, will know your password. Not your teacher, not even the people who manage the computer system. If you forget your password you will have to go in person to the system staff in 147 at the Kent campus, show identification, and have it reset back to its default. Do not allow this to happen.
To change your password, at the prompt type:
passwd
And press the Enter key. The system may be slow to respond at times. Wait for it to prompt you and follow instructions. As mentioned earlier, pick something you won't forget that has at least one digit or uppercase character in it. When you type the password no characters will appear on the screen. Do not worry. Type first your old password and twice the new password as asked. If the password does not meet the current security guidelines, you will be asked to enter a different one.
Your password can be changed any time you want. If you forget your password you will need to go to the system staff to get it fixed. Do not tell anyone or write down your password.
Leave this window open for the rest of the lab. We will get back to this terminal window again. However you must remember to logout at the end of this lab to avoid that other people can have access to your data.
While you go trough the rest of this lab you will collect a set of information that you will insert in a table (copy and paste) as requested by question 1 of the Lab Report. Look at the data you must collect in the Lab Report to get an idea of the data you should collect. Then return here to start your data collection.
As you go through the rest of this sections instructions, fill in the table in the Report (cut and paste) with the appropriate information.
You have a unique account on loki identified by your username. (You can find out what account you are on by using the command whoami). Accounts allow the resources of the system to be managed.
There are four main resources managed by the operating system: 1)Disk, 2)Printer, 3)Processor (cpu) and 4)Memory. In order to manage these resources effectively and efficiently, the OS has many responsibilities. We will examine each of these resources in turn, along with some of the tasks the OS is responsible for.
You will experience several commands on the shell that let you check the statud of the Disk, the Processor and the Memory. Take a screenshot of the commands you will execute. To minimize the number of screenshots, insert in one screenshot as many commands as it is possible.
One of the main resources of a computer system is the hard disk. As part of your account you are given your own directory/folder called your home directory. When you first logon to your account you are by default placed in your home directory.
Since you just logged on, you can see what your home directory is by using the command
pwd
Since all of the accounts on loki are using the same disks in order to prevent you from using too much of this resource your account is given a disk quota. You can see what your current disk usage by using the command.
quota -v
The quota command will show you how many blocks you are currently using, what your quota is, and what your limit is. Your limit is what you are never allowed to go over, and your quota is what you can temporarily go over. Use of quotas allows many accounts to share a resource, such as a hard disk, without allowing one account to use all of it.
All accounts are placed into groups. You can find what groups you are in by using the command id. The group names are listed in parentheses at the end of the output.
The command id also shows your uid or user id. Every account is given a unique user id.
Using the same command we can also see the gid or group id.
Another resource of a computer system that we are very interested in when doing a research paper is the printer quota. Multiuser computer systems have printers that are shared by all the users. In order to manage the use of these printers, each account is given a printer quota. You can find your printer quota by using the command lpquota (laser printer quota). Unfortunately, since you are at the Stark campus you do not have an lpquota, so expect to see "command not found".
For this section you will need both a terminal window to enter CLI commands in, and the SSH Secure File Transfer to see the content of the File Manager. You will go back and forth between one and the other. Show your activity by taking a screenshot of the window. Since you will experience many commands, pack as many commands as you can in a single screenshot.
Data is organized on computer systems into files. We use applications to create things such as research papers, email, web pages, Lab Reports, etc. that are stored as files. Much of the work that we do at the computer has to do with manipulating files.
With your terminal window, type in the following commands:
lslist the files in the current directory
ls -alist all the files in the current directory
ls -allist all files in "long" format, show additional information
Now look at your files using the file manager SSH Secure File Transfer. Press the blue chasing arrows from the menu on the remote side to refresh the screen. You can get a detailed view of your files by clicking on the folder to open a folder and then using the folder with the back arrow from the menu to move downward and upward, respectively, in the hierarchy of the folders.
Open Notepad and create a text file. In the file write the list of the courses that you are taking this semester. Save the file with the name "MySpringCourses.txt. Open the SSH File Transfer Client window (if not open yet), refresh the left hand side of the screen (if the window was already open) by using the chasing arrows in the Toolbar. Now you see the file you have just created. Drag it on the left hand side to transfer it on loki.
Go to the SSH Secure Shell and use the command ls to check that the file is effectively there. (Be sure to be in the correct folder where you have transferred your file, otherwise use the command cd to go up or down in the hierarchy until you locate yourself in the correct folder. If you do not know how to proceed, ask your instructor).
To view your file, at the prompt type:
more MySpringCourses.txt
Take a screenshot of your shell.
If we want to remove a file we can use the command:
rm MySpringCourses.txt
deletes the file "MySpringCourses.txt"
Type in the command and then use the command ls to see that the file is no longer there.
Go back to the SSH Secure File Transfer and refresh the screen with the blue chasing arrows.
Files can also be deleted/removed by being in the SSH Secure File Transfer by selecting them and pressing the cross in the top menu.
Files are organized into directories. A directory in the CLI corresponds to a folder in the graphical user interface. This allows related files to be grouped together which makes them easier to organize for our use and for security.
In the CLI, to reach a file's location it is necessary to know what directory/folder it is in, and what directory that directory is in. and so on and so on. This is called the path to the file.
At any point in order to figure out the path to the directory we are in we can use the command:
pwd"print working directory", shows the directory you are currently in.
In the file manager of the SSH Secure File Transfer the working directory is shown at the top in the menu.
To create a directory we can use the command:
mkdir CS10051create a directory named CS10051 in the current directory.
Since you are hopefully in your home directory (you can use the command pwd to check) this will create a directory named CS10051 in your home directory.
Note that file and directory names do not include any spaces.
To see what happened, use the command ls to see if the directory was created.
Now we want to work in the CS10051 directory. The easiest way to do that is to change our current directory to the CS 10051 directory
You can use the following command to do that:
cd CS10051
Use the command pwd to check that you are in the right directory.
Did the file manager of the SSH Secure File Transfer changed to the subdirectory also? If not, double click on the name of the directory to go in.
Go back to the SSH Secure Shell. For demonstration purposes we would like to create a file in this subdirectory. We can use the following command to do that:
touch anewfilecreates an empty file called "anewfile"
Use the command ls to see what the touch command did. Also check the file manager SSH Secure File Transfer to see if it is there.
In each directory there are always two special files. One has the name "." (yes, a single period) that is the current directory. The other has the name ".." (yes, two periods immediately after each other) that is the parent directory.
Before we show this, go back to the SSH Secure Shell and type the command cd to go to your home directory in case you moved away from it. To be sure you are in the home directory, type pwd to check.
Now we want to move out of the subdirectory CS10051 and back to our home directory. We can do this by using the command:
cd ..".." denotes the parent of the current directory, the directory the current directory is in.
Observe the directory that you are now in by using the command pwd. Also, use an ls command to get your bearings.
Did the file manager of the SSH Secure File Transfer change its current directory? If not, you can move back up by clicking the folder with the back arrow in the top menu.
Return to the SSH Secure Shell. You can move directly to your home directory, no matter where you are at, by using the command:
cdchanges to your home directory.
Suppose you want to make a copy of your MySpringCourses.txt into the folder CS10051. The command
cp MySpringCourses.txt CS10051/.
copies theMySpringCourses.txt file from the current directory into the CS0051 directory and gives it the same name.
Now you have two copies of the same file. If you want to give a different name to the copied file, replace the "." with the desired name. For example
cp MySpringCourses.txt CS10051/CopyOfMySpringCourses.txt
If you want simply move the file MySpringCourses.txt into the folder without keeping a copy in the current directory, type
mv MySpringCourses.txt CS10051/.
MySpringCourses.txt will be removed from the current directory and moved into the CS0051 directory.
Multiuser computer systems typically allow file and directory access to be restricted. This allows the viewing and modification of files and directories to be controlled with the obvious advantages.
In Unix operating systems each file/directory has an owner. The owner of a file/directory sets it's access permissions.
Go to the SSH Secure File Transfer and right click on the file, such as MySpringCourses.txt, and select Properties.
You will see the Properties that describe the Permissions to read, write, and execute for that file. Go to the shell now and see the properties of the same file by typing
ls -al MySpringCourses.txt
You will see something similar to this:
-rw-r--r--
Three types of access for a file/directory may be given or denied. For files:
When file access is attempted the person/program (each running program has an owner also) attempting the file access falls into one of the the following three categories:
Typically the above is concisely displayed on one field in the order user, group, other. Such as:
rw-r-----
So, a permission -rwxrwxrwx allows User, Groups and Others to read, write and execute the file.
For each category of user (User, Group and Others) write down in your Lab Report an english description of what each category of user can do with the file called MySpringCourses.txt
The same scheme is used is used for directories but with a slightly different meaning for read, write, and execute. For directories/folders:
The directory /usr/bin contains many of the programs that you would run as you use the operating system. It even includes the passwd program that allows you to change your password. Using the SSH Secure File Transfer write the directory /usr/bin in the address field of the top menu to move to this directory. Then look at the permissions of the file passwd (the password program).
For each category of user (User, Group and Others) write down the table of the Report an english description of what each category of user can do with the file called passwd. Also record any special permissions that you see.
Note that you should never give write access to other for either file or directory. If such access is given files may be modified or deleted by others.
Every program that the operating system is running is given a separate process (also called a job or task). Show your activity by taking a screenshot of the window. Since you will experience many commands, pack as many commands as you can in a single screenshot.
The processor is an important system resource which the operating system must manage efficiently. It should be kept as busy as possible. To this end the multiple processes loaded into the system memory at any one time must be managed. Each of these processes is given a unique id called the process id, or PID.
We can see what processes you are running by using the command:
psshow the processes (programs) you are running
Observe the process ids that you are using.
You can see all the process that are being run by using the command:
ps -edafshow all current processes
There are so many that they will scroll past you on the screen, so you can look at just part of the listing at a time by using the command:
ps -edaf | moresend the output of the ps command through the more program to see a windowfull at a time. Press the spacebar for more, q to quit.
We can also save the output of the command ps by using the command:
ps -edaf > psoutsend the output of the ps command to the file psout instead of the terminal window
And then we can look at the resulting file using the command:
more psoutview the psout file a "page" at a time
If we wanted to see only the lines of the file psout that contained our username, we could do so using the command:
grep yourusername psoutthe grep command searches for the string (word) yourusername in the file psout and prints every line that contains it.
In this command, you will have to substitute your actual username into the command.
Multiuser systems run almost all the time. We can see how long the computer system has been "up" by using the command:
uptimeinformation about the current O.S.
We can also see the load average which is a measure of how busy the O.S. is in handling processes.
Record in the table of the Lab Report the current load average and how long the system has been up.
The operating system can only carry out one of these processes at a time. We can see what it is doing by using the command:
topthe process list. You can stop the command by typing a "q"
The top command shows us a snapshot of the state of the operating system. It is periodically refreshed, so you will see things change if you watch it long enough.
Note that top itself puts a load on the system, so go ahead and start it and stop it as soon as you can. The output of top will stay on the screen, it will just not be refreshed.
Take a screenshot of the processor activity.
The command top also shows us the percentage of the time that the system is idle. Can you identify the percentage of idle time?
Modern operating systems are multiuser (many different users at the same time) and multitasking (they can run many different programs at the same time). In fact, you can start running many programs from the same shell window.
All of the processes have to share the memory resources of the system.
We can see how we are doing with the memory resource by using the command:
freedisplay amount of free and used memory in the system
Record the total, free and used amount of memory in the system.
Another view of the memory resource can be seen by using the top program.
When you are done working on your account you need to make sure to logout. The command logout will do this.
It is important to always logout when we are done. If not, other people can get access to our accounts. Not only can they steal or alter the information that we have stored there, they can use the account to send threatening email, try to break into other systems, etc.