% CST8207 Week 11 Notes – system logging, processes, jobs, kill, at, cron, users and groups % Ian! D. Allen – – [www.idallen.com] % Winter 2015 - January to Apil 2015 - Updated Tue Mar 24 17:00:43 EDT 2015 Readings, Assignments, Labs, Tests, and ToDo ============================================ - Read (at least) these things (All The Words): 1. [Week 11 Notes HTML] – this file – **Read All The Words** 2. [Unix/Linux system logging, log files, kernel messages] 3. [Unix/Linux Processes, Jobs, background, foreground, kill, killall] 4. [Delayed and Repeated Scheduled Execution - at, cron, and crontab] 5. [Users and Groups - /etc/passwd, /etc/group, su, sudo, chsh, useradd, gpasswd, etc.] 6. [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap] 7. [List of Commands You Should Know] 8. [Video Tutorials on Lynda.com] - Create your [lynda.com] account and watch [Unix for Mac OS X Users] - **4. Ownership and Permissions 34m 58s** - Setting permissions using octal notation 3m 49s - The `root` user 1m 57s - `sudo` and `sudoers` 5m 20s - **5. Commands and Programs 52m 34s** - System information commands 3m 40s - date, uptime, users, who, uname, hostname, domainname - Viewing processes 5m 0s - ps - Monitoring processes 3m 36s - top - Stopping processes 3m 19s - kill Assignments 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: - Bonus (optional) [Assignment #04 HTML] – the VIM text editor (extended due date again and again) - [Assignment #08 HTML] – CentOS virtual server installation - Bonus (optional) [Assignment #09 HTML] – Midterm #2 corrections - There is a checking program available to check your file format for this bonus assignment, but only people who Read All These Words will know about it. Wrong format means no marks. - [Assignment #10 HTML] – setting permissions, mode, umask - due date extended one week; no other due dates affected - [Assignment #11 HTML] – tar, processes, syslog, crontab, at, mail - Really do **Read All The Words**. You don’t get a second chance to get it right. - Work on the above assignments in your lab period; ask questions. - [Worksheet #08 ODT] – Linux file system permissions (modes) - This Worksheet is a prerequisite for [Assignment #10 HTML] - [Worksheet #08 PDF] – PDF version - [Worksheet #08 HTML] – HTML version - `chmod, ls -lid, umask` Tests and quizzes ----------------- For full marks, read the [Test Instructions] (all the words) before your final exam. 1. All Quizzes are open until the Final Exam, then they are closed. - Quizzes are random samples and thus do not cover all of the questions in the practice test PDF file. Do the PDF file to be fully prepared. 2. Final Exam: 180 minutes; Tuesday April 21 11am to 2pm in room C144 - Take a bathroom break before you sit down for three hours! - A draft third set of practice questions is posted. See [Practice Tests and Answers]. - The final exam emphasizes material after the second midterm test, but it covers the whole course and therefore includes material from **all** the practice question sets. 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 ======================================== - We do a variety of short topics this week. - Some draft practice questions for the final exam are posted. See [Practice Tests and Answers]. - [Assignment #11 HTML] is ready. Real Sysadmin Work ================== 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 midterm tests because questions re-appear. - For practice tests and quizzes, see the [Practice Test README][Practice Tests and Answers] - 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)] 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.” Locked out of Course Linux Server --------------------------------- A second term Linux student makes the usual mistake and gets locked out: Mar 17 20:53:27 Accepted password for xxxxnnnn from 99.240.181.65 Mar 24 16:04:13 Invalid user from 99.240.181.65 Mar 24 16:04:15 Failed none for invalid user from 99.240.181.65 Mar 24 16:04:19 Failed password for invalid user from 99.240.181.65 Mar 24 16:04:19 Failed password for invalid user from 99.240.181.65 Mar 24 16:04:21 Failed password for invalid user from 99.240.181.65 Mar 24 16:04:39 Failed password for invalid user from 99.240.181.65 Mar 24 16:05:14 refused connect from cpe0c473da2de41-cm0c473da2de40.cpe.net.cable.rogers.com (99.240.181.65) Attacks on the Course Linux Server ---------------------------------- - Count the attacks: `fgrep -c "refused connect" /var/log/auth.log` - Another way to count the lines (less efficient): `fgrep "refused connect" /var/log/auth.log | wc` - Only show the last 10 lines: `fgrep 'refused connect' /var/log/auth.log | tail` - See the current list of *evil* host IPs: `less /etc/hosts.evil` * * * * * ![Read All The Words by Alex and Colin] ![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/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 [Delayed and Repeated Scheduled Execution - at, cron, and crontab]: 630_crontab_at_job_scheduler.html [Users and Groups - /etc/passwd, /etc/group, su, sudo, chsh, useradd, gpasswd, etc.]: 700_users_and_groups.html [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap]: 720_partitions_and_file_systems.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 [Worksheet #08 ODT]: worksheet08.odt [Worksheet #08 PDF]: worksheet08.pdf [Worksheet #08 HTML]: worksheet08.html [Test Instructions]: 000_test_instructions.html [Practice Tests and Answers]: PRACTICE_TEST_README.html [Unix Shell I/O Redirection (including Pipes)]: 200_redirection.html [**OpenConcept Consulting**]: http://openconcept.ca [**Drupal**]: http://drupal.org/ [web content management system (CMS)]: http://en.wikipedia.org/wiki/Content_management_system [Read All The Words by Alex and Colin]: ian_algonquin2014_read_all_the_words.jpg "Photo by Alex Lemoine and Colin Hough" [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Plain Text]: week11notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/