Project 1
Unix Familiarization
COSC 352
Spring 2003
Due February 6th, by e-mail, before class



This semester we will be doing several projects on a instructional Unix system dediated specifically to this class. If you have used Unix before, then some of this material will be new. Some it will not be.

For this assignment, you are to use your own Unix account. This can be GUSUN, CSSUN, or your own computer running some Unix variant, such as Linux of Mac OS X. Everyone should have access to at least GUSUN.

If you do not already have a GUSUN account, you can get one at:

http://www.georgetown.edu/uis/web/gusun.

If you need to access GUSUN from home, use SSH. A free SSH client (for Windows) is available at:

http://www.ssh.com/support/downloads/secureshellwks/non-commercial.html

You will quickly notice that Unix has a command line interface. You will have to type commands you want executed. This is good and bad. You have more control over what happens, but you have a lot to learn. I have been using Unix for about 10 years now, and keep learning things (I learned some stuff making up this assignment).

First Off


I would recommend using tcsh as a shell. bash is good too, but most of the tutorials cover using tcsh. To start tcsh, type "tcsh" first thing when you log onto gusun. you might have to type "logout" or "exit" twice to log off if you do this.

Also,  you need to know is that you can get what passes for help for any command on a Unix system by typing:

man <command>

where <command> is the command you want information about. The man pages are not always useful in a tutorial sense, but they will explain the variety of options available for each command.

Try "man man" to see what man can tell you.

Unix reference information


A number of good tutorials exist that will teach you all you need to know about Unix, and more. You should look through these tutorials as you answer the questions below.

http://www.ee.surrey.ac.uk/Teaching/Unix/
http://www.ctssn.com/
http://heather.cs.ucdavis.edu/~matloff/unix.html
http://wks.uts.ohio-state.edu/unix_course/
http://wks.uts.ohio-state.edu/sysadm_course/sysadm.html

The last two links are also available as printable books. They seem like good references to me.

Intro to Unix
http://wks.uts.ohio-state.edu/unix_course/unix_book.pdf

Intro to System Administration (more in-depth)
http://wks.uts.ohio-state.edu/sysadm_course/sysadm_book.pdf

You should also look in the text, as it has very useful relevant information.

Your assignment:

Use the class text, man pages and the tutorials refernced above (other on-line sources are fine too, but talk to me before you talk to others about the assignment) to figure out how to do the following things on a unix system.

File System Manipulation


Commands to learn
ls, rm, mkdir, rmdir, cd, pwd, ln, chmod

1) How do you find out what directory you are working in?

2) What one command could you use to list every file on the entire system, showing their owner, location, and access time?

3) How do you list hidden files, i.e., file names that begin with '.'?

4) How do you print a list of all files just within the subdirectories  of the current directory? You should not list files in the subdirectories of the subdirectories or below.

5) Where can you store files temporarily that are too large to fit  within your account?

6) How would you create a file named "~/fred" that, when opened, actually opened the /etc/passwd file?

7) What command would you use to delete a directory named test, assuming it contained other files and directories and you wanted them to be deleted as well?

8) What command would you use to make a file readable by anyone on the system?

9) What command would you use to make a file readable only by you (assiming it was your file)

10) Assuming you had root access, what command would you use to make a file execute as root when run?

Commands to learn:

which, whereis, file, strings, more (or less)

11) How would you find the path to the ping command?

12) Asuume you found a file named /tmp/hacker-leftover. What command could you use to find out what type of file this was?

13) If the /tmp/hacker-leftover file was a binary executable, what command could you use to extract any readable information from the file without running it?

Searching through files;


Commands to learn:

grep, find

14) What command would you use to determine what files in a particular directory contained the string "d00d"?

15) What command would you use to determine what files in a particular directory contained either of the strings "d00d" or "hax0r3d"?

16) What command would you use to determine what files in a particular directory contained a string similar to "owned", except in some varying letter case (e.g. OwnEd)?

17) What command would you use to find all the files on a system that had been accessed within the last week?

18) What command would you use to find all the files on a system that were suid root?

19) What command would you use to file all files on a system that had a name ending in .txt that contained the string "qbert"?

Commands to learn:

finger, w, who, whoami, last, acctcom

20) What command would you use to show what users were on a local system, and what their idle times were?

21) What command would you use to show what users were on a local system, and what processes they were running?

22) What command would you use to show what users were on a local system, and where they were logged in from?

23) What command would you use to find out the last time a user named "clay" was logged onto the system?

24) What command would you use to find out all the recent processes a user named "clay" had run on the system?

25) What command might you be able to use to determine what users are on a remote system?

Commands to learn:

cut, sort

26) What command line (a series of commands) could you use to get a list of just the user IDs of people who had logged into a local system?

27) What command line could you use to get a list of remote systems that had been used to log into the local system?


What to turn in:


In order to grade your work, I will need to know what system you worked on. Please execute these two commands, and include their output at the top with your name:

hostname
uname -a


After that, all you need to include is the appropriate list of commands. Please format them in the following manner: a pound sign, the question number, and then on the next line, the command. For example, if question zero were "How do you determine the hostname of the system you are on?", the answer would be:

#0
hostname


Please e-mail you solutions in the body of the message (not as an attachment, and not as html) to the instructor.