Updated: 2015-01-04 12:54 EST

1 Readings, Assignments, Labs, and ToDo

1.1 Midterm Test #1 and Quiz

1.2 Assignments and Lab work this week

Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant.

1.2.1 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 HTML – Using standard Linux commands I
    • PS1, cd, find, less, ls, man, mkdir, passwd, pwd, rmdir
  • Worksheet #03 HTML – Using standard Linux commands II
    • cat, clear, cp, find, grep, history, less, man, mv, rm, sleep, touch
  • Worksheet #04 HTML – GLOB Patterns and Aliases
    • bash GLOB patterns (wildcards), alias, sum
  • Worksheet #05 HTML – I/O Redirection and Pipes
    • bash I/O redirection (including pipes), date, head, nl, tail, tr, wc

1.2.2 Optional Bonus VIM Assignment – extra marks

3 From the Classroom Whiteboard/Chalkboard

3.1 Scanning the Log File

Here are command pipelines that extract information from the system authorization log file /var/log/auth.log on who is trying to attack the Course Linux Server (may require privileged read permission on the log files). The format of each line in this file is like this:

Jan  2 09:51:17 idallen-ubuntu sshd[28008]: Failed password for root from port 33092 ssh2

Each line starts with the date, followed by some text. (Different log files may have different date formats.)

I worked through these pipe examples below in class this week.

Each of these commands below is one, long single command line, but to make the long lines easier to read in this document the long lines have been split into multiple lines by using a backslash at the end of a line to mean “continue this with the next line”. You can either type the lines with the backslashes at the end, as shown below, or else simply type one long line and omit the trailing backslashes:

fgrep 'Failed password' /var/log/auth.log \
        | awk '{print $9}' | sort | uniq -c | sort -nr | head
fgrep 'Failed password' /var/log/auth.log \
    | fgrep 'Jan ' \
    | awk '{print $9}' | sort | uniq -c | sort -nr | head
fgrep 'Failed password' /var/log/auth.log \
    | fgrep 'Feb ' \
    | awk '{print $9}' | sort | uniq -c | sort -nr | head
Jan  2 02:18:27 idallen-ubuntu sshd[18078]: refused connect from (

fgrep 'refused connect' /var/log/auth.log \
    | fgrep 'Feb ' \
    | awk '{print $10}' | sort | uniq -c | sort -nr | head

4 Real Sysadmin Work

4.1 EC recommends supporting open document format

Take Notes in Class

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

Campaign for non-browser-specific HTML   Valid XHTML 1.0 Transitional   Valid CSS!   Creative Commons by nc sa 3.0   Hacker Ideals Emblem   Author Ian! D. Allen