% CST8207 Week 09 Notes -- Review, Permissions, Midterm #2 % Ian! D. Allen -- -- [www.idallen.com] % Fall 2014 - September to December 2014 - Updated 2015-09-06 01:35 EDT - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] Readings, Assignments, Labs, and ToDo ===================================== - Read (at least) these things (All The Words): - [Week 09 Notes HTML] -- this file -- **Read All The Words** - [Unix Modes and Permissions, whoami, id, groups, ls -l, chmod] - [List of Commands You Should Know] - [Video Tutorials on Lynda.com] - Using your [lynda.com] account, watch [Unix for Mac OS X Users] - **4. Ownership and Permissions 34m 58s** - Who am I? 4m 3s - `whoami` - Unix groups 1m 52s - `groups` - File and directory ownership 6m 41s - `ls -la, chown, sudo` - File and directory permissions 4m 27s - `rwx` notation - Setting permissions using alpha notation 6m 49s - `chmod` - Setting permissions using octal notation 3m 49s Midterm Test #2 --------------- - All test and exam dates are posted on the [Course Home Page]. - Midterm #2 takes place Friday, October 31 in your one-hour lecture. - You must read the [Test Instructions] first. - If you entered your name wrong on the last test, the penalty is double for getting your name wrong on this one. You can check your own name by following the new web link [Algonquin Registered Name Game] in section 4.2 of the [Test Instructions]. - [213 practice Midterm Test #1 questions] are available along with an answer key in the [Class Notes][All Weeks]. See the [Practice Test README] page. - A Quiz on most of these questions is available on Blackboard. See the [Week 04 Notes HTML] for how quizzes work. Not all practice questions appear in the quizzes. - Midterm Test #2 covers: - anything on the previous midterm test, especially questions that were not answered correctly, plus: - weekly notes, labs, quizzes, and assignments for Weeks 1 through 8 inclusive. - The emphasis is on material covered since the previous test. - Material in [Assignment #04 HTML] is relevant to this test. - Material in [Assignment #06 HTML] is relevant to this test. Final Exam 8am Monday December 8 -------------------------------- The final exam schedule is posted on the [Course Home Page]. Your final exam is three hours long, starting at 8am, in T117/119. It will be 180 multiple-choice questions. There will be a set of practice questions, and a quiz on those questions, posted before the exam. Assignments and Lab work this week ---------------------------------- Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. - Read All The Words, Do, and then Submit via Blackboard: - Assignment #07 HTML -- coming soon - Really do **Read All The Words**. You don't get a second chance to get it right. ### Worksheets The worksheets are available in four formats: Open Office (ODT), PDF, HTML, and Text. Only the Open Office format allows you "fill in the blanks" in the worksheet. The PDF format looks good but doesn't allow you to type into the blanks in the worksheet. The HTML format is crude but useful for quick for viewing online. Do **NOT** open the ODT files using any Microsoft products; they will mangle the format and mis-number the questions. Use the free Libre Office or Open Office programs to open these ODT documents. On campus, you can [download Libre Office here]. - [Worksheet #02 ODT] online viewing: [Worksheet #02 HTML] -- Using standard Linux commands I - `PS1, cd, find, less, ls, man, mkdir, passwd, pwd, rmdir` - [Worksheet #03 ODT] online viewing: [Worksheet #03 HTML] -- Using standard Linux commands II - `cat, clear, cp, find, grep, history, less, man, mv, rm, sleep, touch` - [Worksheet #04 ODT] online viewing: [Worksheet #04 HTML] -- GLOB Patterns and Aliases - bash GLOB patterns (wildcards), `alias, sum` - [Worksheet #05 ODT] online viewing: [Worksheet #05 HTML] -- I/O Redirection and Pipes - bash I/O redirection (including pipes), `date, head, nl, tail, tr, wc` ### Optional Bonus Assignments -- extra marks - [Assignment #03 HTML] -- *Optional* BONUS VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional Reading: [The VI (VIM) Text Editor] - [Worksheet #06 HTML] -- *Optional* VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional command-line VIM tutorial: the `vimtutor` program on the CLS. - [Assignment #05 HTML] -- *Optional* BONUS Midterm Assignment - This is an *optional* BONUS assignment reviewing your midterm test. - There is an Assignment #5 checking script available to verify the format of your file before you submit it for marking, but only people who **Read All The Words** here will know about it. From the Class Notes link on the Course Home Page ================================================= - [Course Home Page] - [All Weeks] - Review last week. Did you do everything assigned last week? From the Classroom Whiteboard/Chalkboard ======================================== - **Take notes in class!** Your in-class notes would go here. Learning the Material --------------------- - You learn the material because you want to be a Computer Systems Technician. - You like doing this work; you want to be good at it. - Review your mistakes on the first midterm test (questions re-appear). - For practice tests and quizzes, see the [Practice Test README] - Review the commands used in each lab worksheet (and their common options). - [Unix/Linux Command List][List of Commands You Should Know] - Review how the shell works: GLOB, redirection, quotes - Know **why** the shell behaves that way. Copy/paste teaches you nothing. - process quotes, split on semicolons and pipes next, then do redirection - What are the Four Rules for Output Redirection? Three Rules for Pipes? - [Unix Shell I/O Redirection (including Pipes)] - From Colin and Alex: ![Read All The Words by Alex and Colin] Real Sysadmin Work ================== Awesome License Plate --------------------- ![Bye Bye Data] Course Linux Server private address failure ------------------------------------------- After the power failure on Wednesday, private connections to the [Course Linux Server] were failing and resetting, and long file transfers (e.g. the hourly backup to my desktop machine) were also failing or terminating in the middle. Connections to the public IP address worked fine. I went on a diagnostic mission. Indeed, long file transfers to the private address would "stall" in the middle, sometimes finishing and sometimes not. Sometimes, trying to connect to the private address gave "connection timed out". A `PuTTY` session to the private address would either not connect or would abort in the middle. What finally clued me in to the problem was watching a running `ping` trace where I saw the `TTL` jump from `127` to `63` and then back to `127` again. I ran an `nmap` scan of the IP address when it had one `TTL`, and then another `nmap` scan when it flipped back. Here is the result of that diagnostic, an email message to the IT department: From: Ian! D. Allen Subject: duplicate DHCP IP for 10.50.254.149 Date: Thu, 23 Oct 2014 08:45:37 -0400 To: Algonquin College Help Desk Cc: Todd Kelley, Wenjuan Jiang There may be a rogue machine using IP 10.50.254.149. The DHCP server at 10.254.21.74 handed this IP to my Linux server, but some other machine was already using it. The result was intermittent connection failure to my server, icmp misdirects, and failure of long file transfers. You can see the result here from two successive nmap requests to the same IP address. One connects to some probably-Microsoft machine, and the next nmap a few seconds later connects to my Linux server: Starting Nmap 5.21 ( http://nmap.org ) at 2014-10-23 08:29 EDT Nmap scan report for idallen-cls-alg.dyndns.org. (10.50.254.149) Host is up (0.00025s latency). Not shown: 994 filtered ports PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 445/tcp open microsoft-ds 3389/tcp open ms-term-serv 49153/tcp open unknown 49154/tcp open unknown Nmap done: 1 IP address (1 host up) scanned in 5.18 seconds Starting Nmap 5.21 ( http://nmap.org ) at 2014-10-23 08:30 EDT Nmap scan report for idallen-cls-alg.dyndns.org. (10.50.254.149) Host is up (0.00084s latency). Not shown: 992 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 80/tcp open http 110/tcp open pop3 443/tcp open https 995/tcp open pop3s 2222/tcp filtered unknown 8080/tcp filtered http-proxy Nmap done: 1 IP address (1 host up) scanned in 1.32 seconds You can see the same thing when running ping to the IP address; it switches machines in the middle (the TTL changes): 64 bytes from 10.50.254.149: icmp_seq=42 ttl=126 time=0 ms 64 bytes from 10.50.254.149: icmp_seq=43 ttl=126 time=0 ms 64 bytes from 10.50.254.149: icmp_seq=44 ttl=126 time=0 ms 64 bytes from 10.50.254.149: icmp_seq=45 ttl=62 time=0 ms 64 bytes from 10.50.254.149: icmp_seq=46 ttl=62 time=0 ms 64 bytes from 10.50.254.149: icmp_seq=47 ttl=62 time=0 ms I've DHCP released that bogus IP address and obtained a new one. You might find out why the DHCP server gave my machine an IP address that was already in use, or track down why that machine is using that IP instead of getting it properly from the DHCP server. Linux doesn't have a way to say "don't ask DHCP for this IP address", but I know enough about how Linux `DHCP` works to know that the previous IP address obtained by `DHCP` is cached in the file `/var/lib/dhcp/dhclient.eth0.leases` and that Linux will ask for this address again even if you release the IP and re-request a new address via `DHCP`. So I shut down the `eth0` interface, which released the current IP address, edited the file to cache a different IP address (I picked `10.50.254.160` at random), and then brought up the interface. Linux asked for `10.50.254.160` and the `DHCP` server acknowledged that. So now the CLS has its own IP that isn't in conflict with that other machine at `10.50.254.149`. This is what sysadmin do. Microsoft driver update disables unauthorized chips --------------------------------------------------- If you're a Microsoft Windows user, you don't have access to the source code of the software you use, and you rely on proprietary binary software from your vendor. That means your vendor controls your computer and can make it [damage your unauthorized chips] ![Take Notes in Class] -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [www.idallen.com]: http://www.idallen.com/ [Course Home Page]: .. [Course Outline]: course_outline.pdf [All Weeks]: indexcgi.cgi [Plain Text]: week09notes.txt [Week 09 Notes HTML]: week09notes.html [Unix Modes and Permissions, whoami, id, groups, ls -l, chmod]: 500_permissions.html [List of Commands You Should Know]: 900_unix_command_list.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [lynda.com]: http://algonquincollege.com/onlineresources/mobileStudent/lynda.htm [Unix for Mac OS X Users]: http://www.lynda.com/Mac-OS-X-10-6-tutorials/Unix-for-Mac-OS-X-Users/78546-2.html [Test Instructions]: 000_test_instructions.html [Algonquin Registered Name Game]: http://cst8207.idallen.ca/~idallen/namegame.cgi [213 practice Midterm Test #1 questions]: practicetest2.pdf [Practice Test README]: PRACTICE_TEST_README.html [Week 04 Notes HTML]: week04notes.html [Assignment #04 HTML]: assignment04.html [Assignment #06 HTML]: assignment06.html [download Libre Office here]: 050_course_introduction.html#install-libreoffice-or-openoffice-into-windows [Worksheet #02 ODT]: worksheet02.odt [Worksheet #02 HTML]: worksheet02.html [Worksheet #03 ODT]: worksheet03.odt [Worksheet #03 HTML]: worksheet03.html [Worksheet #04 ODT]: worksheet04.odt [Worksheet #04 HTML]: worksheet04.html [Worksheet #05 ODT]: worksheet05.odt [Worksheet #05 HTML]: worksheet05.html [Assignment #03 HTML]: assignment03.html [The VI (VIM) Text Editor]: 300_vi_text_editor.html [Worksheet #06 HTML]: worksheet06.html [Assignment #05 HTML]: assignment05.html [Unix Shell I/O Redirection (including Pipes)]: 200_redirection.html [Read All The Words by Alex and Colin]: ian_algonquin2014_read_all_the_words.jpg "Photo by Alex Lemoine and Colin Hough" [Bye Bye Data]: data/rm-rf.jpg "Bye Bye Data" [Course Linux Server]: 070_course_linux_server.html [damage your unauthorized chips]: http://arstechnica.com/information-technology/2014/10/windows-update-drivers-bricking-usb-serial-chips-beloved-of-hardware-hackers/ [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/