Exercise #04 for DAT2330 due 2006-02-17 23:59 EDT (Friday) no late penalty if submitted by 2006-02-19 23:59 EDT (Sunday) GJ Hagenaars -- gj@hagenaars.com Work on the Course Linux Server (not ACADUNIX)! 1. Create a file called "exercise04answers.txt" 2. At the top of the file, use the label as defined before. 3. Put on a line the word "lab" by itself, then work on lab exercises 1-5 below. List all the relevant commands and arguments that you had to use in the lab exercises. Put in comments to show why you did something (this can help your mark even if you did something wrong). 4. Put on a line the word "book3" by itself, then answer questions 1-6, 8-11 and 14, from the book, chapter 3, pages 72-73. 5. Put on a line the word "book5" by itself, then answer questions 2-4, 6-10, 12, 16, chapter 5, pages 134-136. 6. Put on a line the word "bonus" by itself, then answer lab question 6 below. 7. Submit using the datsubmit command datsubmit 04 exercise04answers.txt lab exercises: 1. In my directory on the course linux server (my username is "gj"), is a directory called "public_html/dropbox". In this location, create a directory the name of which is your studentid. Set the permissions on this directory to only allow yourself all permissions (i.e. make sure that nobody else on the system can get into this directory). Create a link called "mysyslog" into your directory, link it to the file called "syslog" in "public_html/". Make sure you can read its contents. From here on, all lab exercises should take place in the directory you have just created (i.e. any new files you create have to go in there). 2. From mysyslog, select all those lines that have to do with firewall rules, example: Feb 13 20:20:33 idallen-home1 kernel: Shorewall:net2all:DROP:IN=eth0 OUT= MAC=00:80:c8:4b:b7:75:00:04:e2:50:08:96:08:00 SRC=4.164.5.254 DST=192.168.9.198 LEN=908 TOS=0x00 PREC=0x00 TTL=117 ID=17592 PROTO=UDP SPT=13111 DPT=1026 LEN=888 But do not select any other lines. Put these lines in a file called firewall.log You may not use an editor or cut and paste. 3. How many lines are there in firewall.log? How many different source IP addresses are there in firewall.log? How many different destination IP addresses? How many different source ports? How many different destination ports? Find an efficient way to get these numbers (counting on your fingers is not efficient!). 4. Create a file called "partgroup", the contents of which are selected from the GIDs from the first 20 lines of the password file. Make sure the list is sorted in reverse numerical order, and remove the highest and lowest number. You may not use an editor, or copy and paste to create this file. (Build your command pipeline!) Explain what every part of the pipeline does (or is supposed to do). 5. List all the umask setting so that when you create a file, you end up with permissions r---w-rw-. List all the umask settings so that when you create a directory, you end up with permissions r-x-wxrw-. 6. Bonus points: there are two mistakes in the book on page 605. Identify the mistakes. What should the text really say to be correct?