% CST8207 Week 09 Notes - Fedora VM Installation, Permissions, umask, chmod % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Winter 2013 - January to April 2013 - Updated Wed May 8 21:01:24 EDT 2013 Readings, Assignments, Labs, and ToDo ===================================== - Fill in your [Course Evaluation Survey] for this course. Only nine questions! Closes April 14. - Read (at least) these things (All The Words): - [Week 09 Notes HTML] - this file - ** Read All The Words ** - [Unix Modes and Permissions] - [chmod, umask, and Permissions] - [List of Commands] - From “Unix for Mac OS X Users” at [lynda.com] - more to come - Read (All The Words), Do, and save (not for hand in) - [Lab Worksheet #05 HTML] - optional BONUS VIM worksheet and assignment: [Lab Worksheet #06 ODT] [Lab Worksheet #06 PDF] [Lab Worksheet #06 HTML] - Fedora 12 Installation in VMware: [Lab Worksheet #07 PDF] - [Installing and Configuring VMware Tools for Fedora 12] - [CST8207 Frequently Asked Questions] - Read (All The Words), Do, and then Submit via Blackboard: - optional BONUS VIM assignment: [Assignment #06 HTML] (optional) - [Assignment #07 HTML] - hard links, disk usage, du - [Assignment #08 HTML] - setting permissions, quoting, linking - **New Due Date** March 22 11am. - Write down the dates of your Final Exams from the [Course Home Page]. Midterm Test #2 - Week 10 - Thursday March 21 - 25% ==================================================== - Midterm test dates are posted on the [Course Home Page]. - Midterm Test #2 (Thu Mar 21) covers: - anything from the previous midterm test, especially questions that were not answered correctly, plus: - [Week 04 Notes HTML] - [Week 05 Notes HTML] - [Week 06 Notes HTML] - [Week 07 Notes HTML] - [Week 08 Notes HTML] - [Week 09 Notes HTML] - [Assignment #05] - [Assignment #07] - [Assignment #08] - [Lab Worksheet #05 ODT] - [Lab Worksheet #08 ODT] - See the [Practice Test #2 PDF] and answer file in the [Class Notes]. The same questions are posted under **Practice** on Blackboard. - For full marks, you must read the [Test Instructions] before the test for important directions on how to enter your answers, your lab section number, and the test version number on the question sheet and the mark-sense forms. - There may be more questions on the test than you can answer in the time allowed; answer the ones you know, first. From the Class Notes link on the Course Home Page ================================================= - Review last week. Did you do everything assigned last week? - Do your Fedora 12 install using [Lab Worksheet #07 PDF] - [Assignment #08 HTML] has a **New Due Date** of March 22 11am - [Unix/Linux Command Reference] The importance of `set -o physical` ----------------------------------- Without permission to use `.` or `..` inside a directory, most commands using these names all fail: $ cd /tmp ; mkdir dir ; cd dir ; pwd /tmp/dir $ chmod u-x . ; ls ls: cannot open directory .: Permission denied $ cd . -bash: cd: .: Permission denied $ ls .. ls: cannot access ..: Permission denied So why does this subsequent command succeed (in BASH)? $ cd .. $ pwd /tmp The answer is here in the `physical` option being disabled: $ set -o | grep 'physical' physical off The shell is secretly internally using the `..` to change the current directory from `/tmp/dir` to just `/tmp` and is using that to do `cd /tmp` instead of doing the `cd ..` that you typed! The shell isn’t actually using and following the `..` pathname! See the updated section on `set -o physical` in [Login and Shell Startup Files, aliases, options: .bash\_profile and .bashrc]. System administrators should always set the `-o physical` option in BASH. Review: `ls -l` --------------- There are three sets of of three read/write/execute permissions set in every inode: one set for the inode’s user/owner, one set for the group, and a third set for all other users. When performing a long directory listing, `ls -ld`, the inode’s permissions (mode) appear as nine characters (three sets of read/write/execute) in the first field (column) of each output line, after the inode’s type indicator character. The second field in the output is a link count. The third field is the user/owner of the inode. The fourth field is the group to which the inode belongs. The fifth field is the date/time the inode was modified. The last field is a name for the inode. (Inodes may have multiple names.) If you use the `-i` option, the inode numbers appear at the start (left) of the output lines: $ ls -il 555 -rw-r----- 3 user1 group1 123 Nov 12 14:14 fileone 928 drwxrwxr-x 2 user1 group1 4096 Nov 12 14:14 directoryone 382 lrwxrwxrwx 1 root root 30 Oct 13 12:39 symlink -> ../some/place - Inode 555 is a plain file named `fileone` owned by `user1` and in group `group1` with size 123 and link count of 3. - Inode 928 is a directory named `directoryone` - Inode 382 symbolic link named `symlink` The permissions and owners of symbolic links are ignored; all that matters are the permissions on the inode being linked to. Symbolic links allow directories to appear to have multiple names. The “inode type” character is the first character before the nine permission characters. It identifies the type of the inode that this name is attached to. The three most common inode types are: - `-` (a hyphen/minus/dash) for a regular file inode - `d` for a directory inode - `l` (lower-case L) for a soft or symbolic link (soft link) linking to a pathname (not to an inode!) In the example above, - `fileone` is typed as a regular file (the type character is a leading `-`) - `directoryone` is a directory (a leading ‘d’) - `symlink` is a symbolic link (a leading ‘l’) that points to pathname `../some/place`\ The permissions, owner, and group of symbolic links are ignored; all that matters are the permissions on the inode being linked to. From the Classroom Whiteboard/Chalkboard ======================================== - Your in-class notes go here. - Fill in your [Course Evaluation Survey] for this course. Only nine questions! Closes April 14. - Fri Mar 8: Expected 90 responses, received 30 `33%` - Read [Last Term’s Course Evaluations] Some Commands ============= Keep a notebook with a [List of Commands] in it. Real Sysadmin Work ================== -- | 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 [Course Evaluation Survey]: https://coursefeedback.algonquincollege.com/etw/ets/et.asp?nxappid=WCQ&nxmid=start [Unix Modes and Permissions]: 500_permissions.html [chmod, umask, and Permissions]: 510_umask.html [List of Commands]: 900_unix_command_list.html [lynda.com]: https://lyceum.algonquincollege.com/Lynda [Lab Worksheet #05 HTML]: worksheet05.html [Lab Worksheet #06 ODT]: worksheet06.odt [Lab Worksheet #06 PDF]: worksheet06.pdf [Lab Worksheet #06 HTML]: worksheet06.html [Lab Worksheet #07 PDF]: worksheet07.pdf [Installing and Configuring VMware Tools for Fedora 12]: 009_vmware_tools.html [CST8207 Frequently Asked Questions]: 007_freqently_asked_questions.html [Lab Worksheet #05 ODT]: worksheet05.odt [Lab Worksheet #08 ODT]: worksheet08.odt [Practice Test #2 PDF]: practicetest2.pdf [Class Notes]: indexcgi.cgi [Test Instructions]: 000_test_instructions.html [Unix/Linux Command Reference]: http://files.fosswire.com/2007/08/fwunixref.pdf [Login and Shell Startup Files, aliases, options: .bash\_profile and .bashrc]: 350_startup_files.html#recommended-sysadmin-shell-options [Last Term’s Course Evaluations]: ../../12f/course_evaluation.html [Plain Text]: week09notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/