% CST8207 Week 10 Notes – Permissions, package management, system logging, processes % Ian! D. Allen – – [www.idallen.com] % Fall 2014 - September to December 2014 - Updated Fri Nov 7 17:39:17 EST 2014 Readings, Assignments, Labs, and ToDo ===================================== - Read (at least) these things (All The Words): - [Week 10 Notes HTML] – this file – **Read All The Words** - [Unix Modes and Permissions, whoami, id, groups, ls -l, chmod] - [Permissions masking with umask, chmod, 777 octal permissions] - [Unix/Linux Software Package Management: yum, rpm, and tar] - [Unix/Linux system logging, log files, kernel messages] - [Unix/Linux Processes, Jobs, background, foreground, kill, killall] - [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` Assignments, Quizzes, and Lab work this week -------------------------------------------- **Reminder:** There are now two quizzes that you need to complete on Blackboard as part of your term Quiz mark. A third quiz will be posted before the Final Exam. 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] – setting permissions, mode, umask - [Assignment #10 HTML] – CentOS 6.6 Installation and Configuration - 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` - [Worksheet #08 ODT] online viewing: [Worksheet #08 HTML] – minimal permissions, mode, umask, octal - `chmod, ls -lid, umask` ### 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. - **New Due Date** due to Blackboard failure last week. - [Assignment #08 HTML] – *Optional* BONUS Midterm Assignment - This is an *optional* BONUS assignment reviewing your midterm test. - There is an Assignment #8 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 ================================================= - 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. - Understanding pathnames and symlinks: 1. Ways of creating files in /tmp: $ touch /tmp/file ; cp foo /tmp/tmpfile ; mv bar /tmp/tmpfile 2. Create a directory in /tmp: $ mkdir /tmp/dir 3. Create a symlink in /tmp with target "linux": $ ln -s linux /tmp/symlink De-reference (relative path): /tmp/symlink -> /tmp/linux 4. Create a symlink in /tmp/a/b/bar with target "../../a/../foo": $ ln -s ../../a/../foo /tmp/a/b/bar De-reference: /tmp/a/b/bar -> /tmp/a/b/../../a/../foo -> /tmp/foo - The `diff` command from [GNU Diffutils]: - `diff file1 file2` - Lines starting with `<` are in file on left (`file1`) ; lines starting with `>` are in file on right (`file2`). - [Description of Output] - If you know VI, use a wide terminal screen and try `vimdiff` - If you run a Linux GUI, see also `meld` (and `gvimdiff` for VI) - Advanced answer to [Assignment #06] **easy**, **medium**, etc. disk usage a. Find all the inode numbers under `foo` and print them one per line b. For each line, run `find` to find all inodes with that number and delete. - Patrick Ouellette will be giving a presentation on the 3rd year Security program in B370 on Tuesday, November 11th at 5:30pm. More information on the program is available here: Midterm Test #2 Analysis ------------------------- - Number of students who entered their own name incorrectly on the mark-sense form: `12` - Number of students who entered the wrong test version number: `37` - Number of students who got question #45 wrong even though the answer was given in the Test Instructions printed at the top of the test: `5` - Class scores for 139 (out of 159 registered) students: 95.6 93.3 91.1 91.1 91.1 91.1 91.1 91.1 91.1 88.9 88.9 88.9 86.7 86.7 84.4 84.4 84.4 84.4 84.4 84.4 84.4 83.6 82.2 82.2 82.2 82.2 82.2 81.5 80 80 80 77.8 77.8 77.8 77.8 77.8 77.8 77.8 75.6 75.4 73.3 73.3 73.3 73.3 73.3 73.3 73.3 73.3 71.1 71.1 71.1 68.9 68.9 68.9 68.9 66.7 66.7 66.7 64.8 64.7 64.4 64.4 64.4 64.4 64.4 64.4 62.7 62.7 62.5 62.2 60.4 60 60 60 60 57.8 57.8 56.4 55.6 53.9 53.9 53.3 52.8 52.8 52.2 52.2 51.7 51.7 51.1 51.1 51.1 50.1 49.6 48.9 48.9 48.9 48 47.4 46.7 46.7 46.7 45.3 44.4 44.4 44.4 44.4 43.9 43.4 42.2 41.8 41.8 40 38.8 37.8 37.8 37.8 37.2 36.6 35.5 33.4 33.4 33.3 31.1 31.1 29.3 28.9 25.9 24.4 24.3 23.5 21.6 21.5 20.9 20 15.5 14.6 14.2 13.3 8.9 90% - 100% 9 ********* 80% - 90% 22 ********************** 70% - 80% 20 ******************** 60% - 70% 24 ************************ 50% - 60% 18 ****************** 40% - 50% 19 ******************* 30% - 40% 12 ************ 20% - 30% 10 ********** 10% - 20% 4 **** 0% - 10% 1 * - You can see the errors in [Midterm Test #2 PDF]. 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 ================== Locally Authored Linux Security Document ---------------------------------------- Mike Gifford runs [**OpenConcept Consulting**] here in town: *“Open source web development for social change”.* He works with [**Drupal**], an open source [web content management system (CMS)]. He wrote: > We’ve been working on a best practices document for Drupal security that is > geared specifically at government clients. […] We wrote this for a federal > government department in town that had their site compromised earlier in > the year. Figured it was a good time to write up a general document to help > guide folks in the public sector. Security is certainly a complex issue, > and most government departments just don’t seem to get it. For instance > CSEC provides security information for Windows 2003, but not Windows 2008. > > We are releasing this document because we believe that most government > departments simply do not have the resources to put into properly setting > up and maintaining the security of their servers. Our hope is that we will > be able to build a community of people behind this process who can help > build on and maintain a set of best practices. I’m also hoping that it > helps to reach up into management a bit and be more approachable for folks > who already with IT security. > > I do hope that folks […] heard the recent court case with the 12 year old > boy who is on trial for hacking into government computer systems in 3 > different jurisdictions. To some extent that’s a reflection the rise of > hacker culture on the Internet, but it should also be an indication of how > far government security practices have fallen short. If a kid can hack away > at government sites for fun, and get away with this much information, what > are more politically or crime motivated hackers capable of? There is far > too much security theatre and not enough collaboration within government > about how to raise the lowest common denominator for security. I’ve blogged > about this here: > > > > We’ve released the initial security guide here for review here (we are > asking for people to submit their name & email so that we can track who is > making use of this PDF): > > > > We’d like to get feedback on this document, and our hope is that this > starts an open conversation about security best practices. I would like to > thank the people who have contributed to this document, but generally I > have decided what is or is not listed in this release. There will be errors > that I likely introduced and they will be addressed as they are raised. > > There’s a GoogleDoc too for folks who are interested in adding comments > directly to that version of the document. > > Mike Gifford, President, OpenConcept Consulting Inc.\ > Drupal 8 Core Accessibility Maintainer –\> \ > | > > Open source web development for social change – ![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/ [Unix Modes and Permissions, whoami, id, groups, ls -l, chmod]: 500_permissions.html [Permissions masking with umask, chmod, 777 octal permissions]: 510_umask.html [Unix/Linux Software Package Management: yum, rpm, and tar]: 520_package_management.html [Unix/Linux system logging, log files, kernel messages]: 580_system_log_files.html [Unix/Linux Processes, Jobs, background, foreground, kill, killall]: 600_processes_and_jobs.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 [download Libre Office here]: 050_course_introduction.html#install-libreoffice-or-openoffice-into-windows [The VI (VIM) Text Editor]: 300_vi_text_editor.html [GNU Diffutils]: http://www.gnu.org/software/diffutils/ [Description of Output]: https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Normal [Midterm Test #2 PDF]: midterm2.pdf [Practice Test README]: PRACTICE_TEST_README.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" [**OpenConcept Consulting**]: http://openconcept.ca [**Drupal**]: http://drupal.org/ [web content management system (CMS)]: http://en.wikipedia.org/wiki/Content_management_system [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Plain Text]: week10notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/