CIS 90 Lesson 7 Lesson Module Status Slides

  • Slides: 48
Download presentation
CIS 90 - Lesson 7 Lesson Module Status • Slides – draft • Properties

CIS 90 - Lesson 7 Lesson Module Status • Slides – draft • Properties - done • Flash cards – • No-stress quiz – • Web Calendar summary – • Web book pages – done • Commands – done • Lab – • Supplies – • Class PC's – NA • Hide script – Next class

CIS 90 - Lesson 7 Quiz Please close your books, turn off your monitor,

CIS 90 - Lesson 7 Quiz Please close your books, turn off your monitor, take out a blank piece of paper and answer the following questions: • What option for the rm command provides confirmation when deleting files? • What command is used to rename a file? • If two files are hard linked do they have the same or different inode numbers?

CIS 90 - Lesson 7 File Permissions Objectives Agenda • Be able to reassign

CIS 90 - Lesson 7 File Permissions Objectives Agenda • Be able to reassign user and group file ownerships • Identify permissions for ordinary and directory files • Use chmod to set and change file permissions • Define the default permissions for new files • Quiz • Review test results • Question on previous material • File permissions • Wrap up = hands on exercise for topic

CIS 90 - Lesson 7 Housekeeping

CIS 90 - Lesson 7 Housekeeping

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 1 2 3

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 1 2 3 4 5 6 7 8 9 10 xxx x x xxxxx x 1. How are executable files (binary files or shell scripts) displayed in ls command output? They are the green ones. With the -l option the x permission bits are seen, with the -F option they will have a * 2. What UNIX command prints your current working directory? pwd 3. Is. . /guest/Poems a relative or absolute path? relative 4. In what file are all the user accounts stored? /etc/passwd 5. What environment variable is used by the shell to determine which directories to search when locating a command? PATH 6. What metacharacter allows you to put multiple commands on one line? ; (semicolon) 7. Who initiated, and with the help of other programmers, developed the first Linux kernel? Linux Torvalds 8. With /bin/mail, where do all messages that have been read go after issuing the quit command? Into the mbox file in the users home directory. 9. Was UNIX/Linux designed for single user or multi-user operation? multi-user 10. What are three elements that make up a UNIX file? The filename, the inode, and the data

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 11 12 13

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 11 12 13 14 15 16 17 18 19 20 xxx 11. Is /boot/grub. conf a relative or absolute path? absolute 12. What is the program called that prompts you for a command, then locates that command executes it? The Shell xxxxxx xx xxxxxx x 13. What command shows the name of the computer you are using? hostname 14. What option on the ls command will show inode numbers? ? I 15. What day of the week is May 5, 1993? Wednesday 16. What is the name and version of the Linux kernel you are using? Linux #1 SMP Thu May 22 09: 01: 29 EDT 2008 17. In your home directory you will find another directory called depot. What is the last line of text in the file named hello. txt? ISN’T THIS FUN? ? ? 18. What terminal type are you using? xterm 19. Type the command cat /etc/shadow. Which program writes the error message? cat 20. Type the command Cat /etc/shadow. Which programs writes the error message? bash

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 21 22 23

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 21 22 23 24 25 26 27 28 29 30 xxxxxxx x xxxxx xx xxxxxxx x xxxxx 21. What is the value of your $PS 1 environment variable? [u@h W]$ 22. What command will set your prompt to: “Your wish is my command: > ”? PS 1=”Your wish is my command: > ” 23. Starting in /u and descending down subfolders, what are the names of the two files in the last and deepest folder? dorothy, toto 24. What is the inode number of /etc/passwd? 198660 25. What is the relative path from your home directory to the file /etc/passwd ? . . /etc/passwd 26. What is the absolute path to the file /etc/passwd ? /etc/passwd 27. What command option will show the permissions, owner and size of /etc/passwd? ls –l /etc/passwd 28. From your home directory change to the Poems/Yeats/ directory. What oneliner command would clear the screen and print the last line of all three Yeats poems without having to type the names of each individual poem file name? clear; tail -n 1 * 29. Check your email on Opus. What is Benji’s favorite game to play? gopher 30. Calculate: (23^2 * 4 – 100) – sqrt(64) and email (using /bin/mail) the answer to rsimms mail rsimms Subject: Q 30 2008

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 31 32 33

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 31 32 33 34 35 xxxxxxxxxx xxxxx 31. In what directory is the crash command found? /usr/bin 32. What does the shred command do? Overwrite the specified FILE(s) repeatedly, in order to make it harder for even very expensive hardware probing to recover the data. 33. How many words are in the whitebirds poem? 173 34. How can you keep a copy of messages you send with /bin/mail? cc: yourself 35. What files in your home directory match p*[23]? proposal 2, proposal 3

CIS 90 - Lesson 7 Previous material and assignment 1. Questions on last Lab

CIS 90 - Lesson 7 Previous material and assignment 1. Questions on last Lab assignment? 2. Questions on File Management commands?

CIS 90 - Lesson 7 Permissions

CIS 90 - Lesson 7 Permissions

CIS 90 - Lesson 5 bigfile 102574 bin 102575 letter 102609 inode number -

CIS 90 - Lesson 5 bigfile 102574 bin 102575 letter 102609 inode number - Type rw-r—r-- Permissions 1 Number of links simmsben User cis 90 Group 1044 Size 2001 -07 -20 Modification time 2008 -08 -08 Access Time ext 2 file system Superblock Hello Mother! Hello Father! Here I am at Camp Granada. Things are very entertaining, and they say we'll have some fun when it stops raining. Inode Table All the counselors hate the waiters, and the lake has alligators. You remember Leonard Skinner? He got ptomaine poisoning last night after dinner. Now I don't want this to scare you, but my bunk mate has malaria. You remember Jeffrey Hardy? Their about to organize a searching party. Take me home, oh Mother, Father, take me home! I hate Granada. Don't leave me out in the forest where I might get eaten by a bear! Take me home, I promise that I won't make noise, or mess the house with other boys, oh please don't make me stay -- I've been here one whole day. Data Blocks Dearest Father, darling Mother, how's my precious little brother? I will come home if you miss me. I will even let Aunt Bertha hug and kiss me! Wait a minute! It's stopped hailing! Guys are swimming! Guys are sailing! Playing baseball, gee that's better! Mother, Father, kindly disregard this letter. 2008 -06 -20 Alan Sherman Pointer(s) to data blocks [simmsben@opus ~]$ls -il letter 102609 -rw-r--r-- 1 simmsben cis 90 1044 Jul 20 2001 letter change time Pointer(s) to data blocks

CIS 90 - Lesson 7 File Permissions Relevant fields from the inode A. Owner

CIS 90 - Lesson 7 File Permissions Relevant fields from the inode A. Owner of the file: uid B. Group Membership of the file: gid C. Permissions: read, write, execute rwx rwx owner group other 1. the Read permission has a numeric value of 4 2. the Write permission has a numeric value of 2 3. the EXecute permission has a numeric value of 1 The total permissions assigned to a file for a particular identity is the sum of these three values. /

CIS 90 - Lesson 7 File Permissions Viewing relevant fields from the inode [simmsben@opus

CIS 90 - Lesson 7 File Permissions Viewing relevant fields from the inode [simmsben@opus ~]$ ls -li letter 102609 -rw-r--r-- 2 simmsben cis 90 1044 Jul 20 2001 letter [simmsben@opus ~]$ stat letter File: `letter' Size: 1044 Blocks: 16 IO Block: 4096 regular file Device: 805 h/2053 d Inode: 102609 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 1160/simmsben) Gid: ( cis 90) Access: 2008 -10 -15 14: 15: 43. 00000 -0700 Modify: 2001 -07 -20 15: 04: 39. 00000 -0700 Change: 2008 -10 -15 14: 16: 13. 00000 -0700 [simmsben@opus ~]$ / 103/ 102609 inode number - Type rw-r—r-- Permissions 1 Number of links simmsben User cis 90 Group 1044 Size 2001 -07 -20 Modification time 2008 -10 -15 Access Time 2008 -10 -15 Pointer(s) to data blocks change time Pointer(s) to data blocks

CIS 90 - Lesson 7 File Permissions Relevant Commands chown - Changes the ownership

CIS 90 - Lesson 7 File Permissions Relevant Commands chown - Changes the ownership of a file. (Only superuser has this privilege) chgrp - Changes the group of a file. (Only groups that you belong to) chmod - Changes the permissions of a file. • Numeric: chmod 640 letter (sets the permissions for a file) • Mnemonic: chmod ug+rw letter (changes the permission settings) v Mnemonic: u=user(owner), g=group, o=other r=read, w=write, x=execute umask - / Sets the default mask applied to permissions for newly created files.

CIS 90 - Lesson 7 File Permissions chown and chgrp command - examples [simmsben@opus

CIS 90 - Lesson 7 File Permissions chown and chgrp command - examples [simmsben@opus Directory 3]$ touch myfile [simmsben@opus Directory 3]$ ls -l Only root total 4 can use -rw-rw-r-- 1 simmsben cis 90 0 Oct 15 14: 40 myfile chown [simmsben@opus Directory 3]$ chown rsimms myfile chown: changing ownership of `myfile': Operation not permitted [simmsben@opus Directory 3]$ chgrp users myfile [simmsben@opus Directory 3]$ ls -l total 4 -rw-rw-r-- 1 simmsben users 0 Oct 15 14: 40 myfile [simmsben@opus Directory 3]$ chgrp cis 90 myfile [simmsben@opus Directory 3]$ ls -l total 4 -rw-rw-r-- 1 simmsben cis 90 0 Oct 15 14: 40 myfile [simmsben@opus Directory 3]$

CIS 90 - Lesson 7 File Permissions chmod command - examples [simmsben@opus Directory 3]$

CIS 90 - Lesson 7 File Permissions chmod command - examples [simmsben@opus Directory 3]$ total 4 -rwxrwxr-- 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rw-rw-r-- 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rw-rwxr-x 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rw------- 1 simmsben cis 90 [simmsben@opus Directory 3]$ ls -l 0 Oct 15 14: 40 myfile chmod -x myfile ls -l 0 Oct 15 14: 40 myfile chmod og+x myfile ls -l 0 Oct 15 14: 40 myfile chmod go-rwx myfile ls -l 0 Oct 15 / 14: 40 myfile

CIS 90 - Lesson 7 File Permissions chmod command - examples [simmsben@opus Directory 3]$

CIS 90 - Lesson 7 File Permissions chmod command - examples [simmsben@opus Directory 3]$ total 4 -rw-rw-r-- 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rwxrwxrwx 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rw-r----- 1 simmsben cis 90 [simmsben@opus Directory 3]$ total 4 -rw-r--r-- 1 simmsben cis 90 chmod 664 myfile ls -l 0 Oct 15 14: 40 myfile chmod 777 myfile ls -l 0 Oct 15 14: 40 myfile chmod 640 myfile ls -l 0 Oct 15 14: 40 myfile chmod 000 myfile ls -l / 14: 40 myfile 0 Oct 15 chmod 644 myfile ls -l 0 Oct 15 14: 40 myfile

CIS 90 - Lesson 7 File Permissions Commands that require file permissions Permission File

CIS 90 - Lesson 7 File Permissions Commands that require file permissions Permission File Directory Read (4) cat, more, file, head, tail, cp ls Write (2) vi, saving mail cp, mv, rm, ln Execute (1) $ command cd, ls -l, find /

CIS 90 - Lesson 7 File Permissions examples [simmsben@opus ~]$ chmod u-w Directory 3

CIS 90 - Lesson 7 File Permissions examples [simmsben@opus ~]$ chmod u-w Directory 3 [simmsben@opus ~]$ ls -ld Directory 3 dr-xrwxr-x 2 simmsben cis 90 4096 Oct 15 15: 00 Directory 3 [simmsben@opus ~]$ cd Directory 3 [simmsben@opus Directory 3]$ ls -l total 4 -rw-r--r-- 1 simmsben cis 90 0 Oct 15 15: 00 myfile [simmsben@opus Directory 3]$ rm myfile rm: cannot remove `myfile': Permission denied [simmsben@opus Directory 3]$ chmod 777 myfile [simmsben@opus Directory 3]$ ls -l total 4 -rwxrwxrwx 1 simmsben cis 90 0 Oct 15 15: 00 myfile [simmsben@opus Directory 3]$ rm myfile rm: cannot remove `myfile': Permission denied [simmsben@opus Directory 3]$ /

CIS 90 - Lesson 7 File Permissions example [simmsben@opus ~]$ ls -ld Directory 3

CIS 90 - Lesson 7 File Permissions example [simmsben@opus ~]$ ls -ld Directory 3 drwxr-xr-x 2 simmsben cis 90 4096 Oct 15 15: 00 Directory 3 [simmsben@opus ~]$ cd Directory 3 [simmsben@opus Directory 3]$ chmod 000 myfile [simmsben@opus Directory 3]$ ls -l total 4 ----- 1 simmsben cis 90 0 Oct 15 15: 00 myfile [simmsben@opus Directory 3]$ rm myfile rm: remove write-protected regular empty file `myfile'? yes [simmsben@opus Directory 3]$ /

CIS 90 - Lesson 7 File Permissions example [simmsben@opus ~]$ ls -ld Directory 3

CIS 90 - Lesson 7 File Permissions example [simmsben@opus ~]$ ls -ld Directory 3 drwxr-xr-x 2 simmsben cis 90 4096 Oct 15 15: 00 Directory 3 [simmsben@opus ~]$ cd Directory 3 [simmsben@opus Directory 3]$ chmod 000 myfile [simmsben@opus Directory 3]$ ls -l total 4 ----- 1 simmsben cis 90 0 Oct 15 15: 00 myfile [simmsben@opus Directory 3]$ rm myfile rm: remove write-protected regular empty file `myfile'? yes [simmsben@opus Directory 3]$ /

CIS 90 - Lesson 7 File Permissions Default permissions • Default permissions for an

CIS 90 - Lesson 7 File Permissions Default permissions • Default permissions for an ordinary file: • Default permissions for directories: rw-rw-rwrwxrwxrwx 666 777 The umask is a three digit octal value whose bits strip away (mask off) default permissions: • umask 777 - strips off all permissions from a file or directory • umask 000 - leaves the default permissions alone • umask 022 - strips off write permissions from group and other /

CIS 90 - Lesson 7 File Permissions umask - examples [simmsben@opus Directory 3]$ umask

CIS 90 - Lesson 7 File Permissions umask - examples [simmsben@opus Directory 3]$ umask 0002 [simmsben@opus Directory 3]$ total 4 -rw-rw-r-- 1 simmsben cis 90 [simmsben@opus Directory 3]$ [simmsben@opus Directory 3]$ total 4 -rw-rw-rw- 1 simmsben cis 90 [simmsben@opus Directory 3]$ [simmsben@opus Directory 3]$ total 4 -rw-r--r-- 1 simmsben cis 90 [simmsben@opus Directory 3]$ rm myfile touch myfile ls -l 0 Oct 15 14: 59 myfile umask 000 rm myfile touch myfile ls -l 666 -002 664 rw_rw_r__ 666 -000 666 rw_rw_rw_ 0 Oct 15 15: 00 myfile umask 022 rm myfile/ touch myfile ls -l 0 Oct 15 15: 00 myfile 666 -022 644 rw_r__r__

CIS 90 - Lesson 7 File Permissions exercise - setup /home/cis 90/simmsben $ mkdir

CIS 90 - Lesson 7 File Permissions exercise - setup /home/cis 90/simmsben $ mkdir Directory 1 Directory 2 /home/cis 90/simmsben $ chmod 751 Directory 1 /home/cis 90/simmsben $ chmod 775 Directory 2 /home/cis 90/simmsben $ ls -ld Directory* drwxr-x--x 2 simmsben cis 90 4096 Oct 15 11: 11 Directory 1 drwxrwxr-x 2 simmsben cis 90 4096 Oct 15 11: 11 Directory 2 /home/cis 90/simmsben $ cd Directory 1 /home/cis 90/simmsben/Directory 1 $ echo "blah blah" > file 2 /home/cis 90/simmsben/Directory 1 $ echo "blah" > file 3 /home/cis 90/simmsben/Directory 1 $ chmod 664 file 1 /home/cis 90/simmsben/Directory 1 $ chmod 755 file 2 /home/cis 90/simmsben/Directory 1 $ chmod 554 file 3 /home/cis 90/simmsben/Directory 1 $/ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files? /home/cis 90/simmsben/Directory 1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 /home/cis 90/simmsben/Directory 1 $ / echo "changes" > file 1

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files? /home/cis 90/simmsben/Directory 1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 1 /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 2 /

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files? /home/cis 90/simmsben/Directory 1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 1 /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 2 /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 3 /

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner change these files? /home/cis 90/simmsben/Directory 1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 /home/cis 90/simmsben/Directory 1 $ /home/cis 90/simmsben/Directory 1 -bash: file 3: Permission denied /home/cis 90/simmsben/Directory 1 $ echo "changes" > file 2 $ echo "changes" > file 3 $ /home/cis 90/simmsben/Directory 1 $ cat f* changes / blah /home/cis 90/simmsben/Directory 1 $

CIS 90 - Lesson 7 File Permissions exercise – can group user change these

CIS 90 - Lesson 7 File Permissions exercise – can group user change these files? [roddyduk@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 8 Oct 15 11: 48 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [roddyduk@opus Directory 1]$ echo "changes" > / file 1

CIS 90 - Lesson 7 File Permissions exercise – can group user change these

CIS 90 - Lesson 7 File Permissions exercise – can group user change these files? [roddyduk@opus Directory 1]$ total 24 -rw-rw-r-- 1 simmsben cis 90 -rwxr-xr-x 1 simmsben cis 90 -r-xr-xr-- 1 simmsben cis 90 [roddyduk@opus Directory 1]$ ls -l 8 Oct 15 11: 48 file 1 15 Oct 15 11: 13 file 2 15 Oct 15 11: 13 file 3 echo "changes" > file 1 echo "changes" > file 2 /

CIS 90 - Lesson 7 File Permissions exercise – can group user change these

CIS 90 - Lesson 7 File Permissions exercise – can group user change these files? [roddyduk@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 8 Oct 15 11: 48 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [roddyduk@opus Directory 1]$ echo "changes" > file 1 [roddyduk@opus Directory 1]$ echo "changes" > file 2 -bash: file 2: Permission denied [roddyduk@opus Directory 1]$ echo "changes" > file 3 /

CIS 90 - Lesson 7 File Permissions exercise – can group user change these

CIS 90 - Lesson 7 File Permissions exercise – can group user change these files? [roddyduk@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 8 Oct 15 11: 48 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [roddyduk@opus Directory 1]$ echo "changes" > file 1 [roddyduk@opus Directory 1]$ echo "changes" > file 2 -bash: file 2: Permission denied [roddyduk@opus Directory 1]$ echo "changes" > file 3 -bash: file 3: Permission denied [roddyduk@opus Directory 1]$ /

CIS 90 - Lesson 7 File Permissions exercise – can other user change these

CIS 90 - Lesson 7 File Permissions exercise – can other user change these files? [simmsben@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 9 Oct 15 12: 15 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [simmsben@opus Directory 1]$ [simmsmar@opus ~]$ ls -l /home/cis 90/simmsben/Directory 1 ls: /home/cis 90/simmsben/Directory 1: Permission denied [simmsmar@opus ~]$ echo "simmsmar" > /home/cis 90/simmsben/Directory 1/file 1 -bash: /home/cis 90/simmsben/Directory 1/file 1: Permission denied [simmsmar@opus ~]$ echo "simmsmar" > /home/cis 90/simmsben/Directory 1/file 2 -bash: /home/cis 90/simmsben/Directory 1/file 2: Permission denied [simmsmar@opus ~]$ echo "simmsmar" > /home/cis 90/simmsben/Directory 1/file 3 / -bash: /home/cis 90/simmsben/Directory 1/file 3: Permission denied [simmsmar@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can owner delete these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner delete these files? [simmsben@opus Directory 1]$ ls -ld drwxr-x--x 2 simmsben cis 90 4096 Oct 15 12: 42. [simmsben@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [simmsben@opus Directory 1]$ rm file 1 [simmsben@opus Directory 1]$ rm file 2 [simmsben@opus Directory 1]$ rm file 3 rm: remove write-protected regular file `file 3'? y [simmsben@opus Directory 1]$ /

CIS 90 - Lesson 7 File Permissions exercise – can group user delete these

CIS 90 - Lesson 7 File Permissions exercise – can group user delete these files? [simmsben@opus Directory 1]$ drwxr-x--x 2 simmsben cis 90 [simmsben@opus Directory 1]$ total 24 -rw-rw-r-- 1 simmsben cis 90 -rwxr-xr-x 1 simmsben cis 90 -r-xr-xr-- 1 simmsben cis 90 ls -ld 4096 Oct 15 12: 42. ls -l 15 Oct 15 11: 13 file 1 15 Oct 15 11: 13 file 2 15 Oct 15 11: 13 file 3 [roddyduk@opus ~]$ rm. . /simmsben/Directory 1/file 1 rm: cannot remove `. . /simmsben/Directory 1/file 1': Permission denied [roddyduk@opus ~]$ rm. . /simmsben/Directory 1/file 2 rm: remove write-protected regular file `. . /simmsben/Directory 1/file 2'? y / rm: cannot remove `. . /simmsben/Directory 1/file 2': Permission denied [roddyduk@opus ~]$ rm. . /simmsben/Directory 1/file 3 rm: remove write-protected regular file `. . /simmsben/Directory 1/file 3'? y rm: cannot remove `. . /simmsben/Directory 1/file 3': Permission denied [roddyduk@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can other user delete these

CIS 90 - Lesson 7 File Permissions exercise – can other user delete these files? [simmsben@opus Directory 1]$ drwxr-x--x 2 simmsben cis 90 [simmsben@opus Directory 1]$ total 24 -rw-rw-r-- 1 simmsben cis 90 -rwxr-xr-x 1 simmsben cis 90 -r-xr-xr-- 1 simmsben cis 90 ls -ld 4096 Oct 15 12: 42. ls -l 15 Oct 15 11: 13 file 1 15 Oct 15 11: 13 file 2 15 Oct 15 11: 13 file 3 [simmsmar@opus ~]$ rm /home/cis 90/simmsben/Directory 1/file 1 rm: cannot remove `/home/cis 90/simmsben/Directory 1/file 1': Permission denied [simmsmar@opus ~]$ rm /home/cis 90/simmsben/Directory 1/file 2 rm: cannot remove `/home/cis 90/simmsben/Directory 1/file 2': Permission denied / [simmsmar@opus ~]$ rm /home/cis 90/simmsben/Directory 1/file 3 rm: cannot remove `/home/cis 90/simmsben/Directory 1/file 3': Permission denied [simmsmar@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can owner read these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner read these files? [simmsben@opus ~]$ ls Directory 1 file 2 file 3 [simmsben@opus ~]$ cat Directory 1/* blah blah blah [simmsben@opus ~]$ /

CIS 90 - Lesson 7 File Permissions exercise – can group user read these

CIS 90 - Lesson 7 File Permissions exercise – can group user read these files? [simmsben@opus Directory 1]$ drwxr-x--x 2 simmsben cis 90 [simmsben@opus Directory 1]$ total 24 -rw-rw-r-- 1 simmsben cis 90 -rwxr-xr-x 1 simmsben cis 90 -r-xr-xr-- 1 simmsben cis 90 ls -ld 4096 Oct 15 12: 42. ls -l 15 Oct 15 11: 13 file 1 15 Oct 15 11: 13 file 2 15 Oct 15 11: 13 file 3 [roddyduk@opus ~]$ cat. . /simmsben/Directory 1/file* blah blah blah / [roddyduk@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can other user read these

CIS 90 - Lesson 7 File Permissions exercise – can other user read these files? drwxr-x--- 31 rsimms cis 90 4096 Oct 8 09: 47 /home/cis 90 [simmsben@opus ~]$ ls -ld /home/cis 90/simmsben/ drwxr-xr-x 12 simmsben cis 90 4096 Oct 15 13: 45 /home/cis 90/simmsben/ [simmsben@opus ~]$ [simmsben@opus Directory 1]$ ls -ld drwxr-x--x 2 simmsben cis 90 4096 Oct 15 12: 42. [simmsben@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [simmsmar@opus ~]$ cat /home/cis 90/simmsben/Directory 1/file 1 cat: /home/cis 90/simmsben/Directory 1/file 1: Permission denied / [simmsmar@opus ~]$ cat /home/cis 90/simmsben/Directory 1/file 2 cat: /home/cis 90/simmsben/Directory 1/file 2: Permission denied [simmsmar@opus ~]$ cat /home/cis 90/simmsben/Directory 1/file 3 cat: /home/cis 90/simmsben/Directory 1/file 3: Permission denied [simmsmar@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can owner execute these files?

CIS 90 - Lesson 7 File Permissions exercise – can owner execute these files? ==> file 1 <== #!/bin/bash echo "blah" exit 0 ==> file 2 <== #!/bin/bash echo "blah" exit 0 [simmsben@opus Directory 1]$ ls -l total 32 -rw-rw-r-- 1 simmsben cis 90 41 Oct 15 -rwxr-xr-x 1 simmsben cis 90 41 Oct 15 -r-xr-xr-- 1 simmsben cis 90 41 Oct 15 -rw-rw-r-- 1 simmsben cis 90 41 Oct 15 [simmsben@opus Directory 1]$. /file 1 -bash: . /file 1: Permission denied [simmsben@opus Directory 1]$. /file 2 blah [simmsben@opus Directory 1]$. /file 3 blah [simmsben@opus Directory 1]$ 13: 16 13: 17 13: 18 13: 16 / file 1 file 2 file 3 program ==> file 3 <== #!/bin/bash echo "blah" exit 0

CIS 90 - Lesson 7 File Permissions exercise – can group user execute these

CIS 90 - Lesson 7 File Permissions exercise – can group user execute these files? [simmsben@opus Directory 1]$ drwxr-x--x 2 simmsben cis 90 [simmsben@opus Directory 1]$ total 24 -rw-rw-r-- 1 simmsben cis 90 -rwxr-xr-x 1 simmsben cis 90 -r-xr-xr-- 1 simmsben cis 90 ls -ld 4096 Oct 15 12: 42. ls -l 15 Oct 15 11: 13 file 1 15 Oct 15 11: 13 file 2 15 Oct 15 11: 13 file 3 [roddyduk@opus ~]$ /home/cis 90/simmsben/Directory 1/file 1 -bash: /home/cis 90/simmsben/Directory 1/file 1: Permission denied [roddyduk@opus ~]$ /home/cis 90/simmsben/Directory 1/file 2 blah / [roddyduk@opus ~]$ /home/cis 90/simmsben/Directory 1/file 3 blah [roddyduk@opus ~]$

CIS 90 - Lesson 7 File Permissions exercise – can other user execute these

CIS 90 - Lesson 7 File Permissions exercise – can other user execute these files? [simmsben@opus ~]$ ls -ld /home/cis 90 drwxr-x--- 31 rsimms cis 90 4096 Oct 8 09: 47 /home/cis 90 [simmsben@opus ~]$ ls -ld /home/cis 90/simmsben/ drwxr-xr-x 12 simmsben cis 90 4096 Oct 15 13: 45 /home/cis 90/simmsben/ [simmsben@opus ~]$[simmsben@opus Directory 1]$ ls -ld drwxr-x--x 2 simmsben cis 90 4096 Oct 15 12: 42. [simmsben@opus Directory 1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis 90 15 Oct 15 11: 13 file 1 -rwxr-xr-x 1 simmsben cis 90 15 Oct 15 11: 13 file 2 -r-xr-xr-- 1 simmsben cis 90 15 Oct 15 11: 13 file 3 [simmsmar@opus ~]$ /home/cis 90/simmsben/Directory 1/file 1 -bash: /home/cis 90/simmsben/Directory 1/file 1: Permission denied / [simmsmar@opus ~]$ /home/cis 90/simmsben/Directory 1/file 2 -bash: /home/cis 90/simmsben/Directory 1/file 2: Permission denied [simmsmar@opus ~]$ /home/cis 90/simmsben/Directory 1/file 3 -bash: /home/cis 90/simmsben/Directory 1/file 3: Permission denied [simmsmar@opus ~]$

CIS 90 - Lesson 7 Lab 6

CIS 90 - Lesson 7 Lab 6

CIS 90 - Lesson 7 http: //simms-teach. com/docs/cis 90 lab 6. html

CIS 90 - Lesson 7 http: //simms-teach. com/docs/cis 90 lab 6. html

CIS 90 - Lesson 7 Wrap up

CIS 90 - Lesson 7 Wrap up

CIS 191 - Lesson 7 New commands: chgrp chmod chown umask New Files and

CIS 191 - Lesson 7 New commands: chgrp chmod chown umask New Files and Directories: NA change file's group file permissions file owner (superuser only) permission mask

CIS 90 - Lesson 7 Next Class Assignment: Check Calendar Page on web site

CIS 90 - Lesson 7 Next Class Assignment: Check Calendar Page on web site to see what is due next week. Quiz questions for next class: 6 osts b P a L ve Fi • With a umask of 002 what permissions would a newly created file have? • What is the numeric permission equivalent of rwxr_xr__ ? • Does chmod o+w give write permission to the owner or to other users?

CIS 90 - Lesson 7 Backup

CIS 90 - Lesson 7 Backup