CIS 90 - Lesson 7 Lesson Module Status Slides – draft Properties - done Flash cards – No-stress quiz – Web Calendar summary – Web book pages – done Commands.

Slides:



Advertisements
Similar presentations
MORE FILE ATTRIBUTES. ls –l to display file attributes (properties) Listing of a specific directory Ownership and group ownership Different file permissions.
Advertisements

Linux File & Folder permissions. File Permissions In Ubuntu, files and folders can be set up so that only specific users can view, modify, or run them.
UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
1 CSE 303 Lecture 4 users/groups; permissions; intro to shell scripting read Linux Pocket Guide pp , 25-27, 61-65, , 176 slides created by.
File security and Permissions A file is owned by the user who created it That user can then specify who can read, write and execute that file A file when.
Linux+ Guide to Linux Certification, Second Edition
Information Networking Security and Assurance Lab National Chung Cheng University 1 What Linux is? Free Unix Like Open Source Network operating system.
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
Linux Linux File System.
Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.
Guide To UNIX Using Linux Third Edition
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Getting Started with Linux Linux System Administration Permissions.
Introduction to Linux and Shell Scripting Jacob Chan.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Filesystem Hierarchy Standard (FHS) –Standard of outlining the location of set files and directories on a Linux system –Gives Linux software developers.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar.
2 Manual & Filestore. Introduction Using the manual The UNIX filestore File permissions.
Files & Directories Objectives –to be able to describe and use the Unix file system model and concepts Contents –directory structure –file system concepts.
CIS 90 - Lesson 15 Lesson Module Status Slides – draft Properties - done Flash cards – 1 st Minute quiz – NA Web calendar summary – done Web book pages.
Guide To UNIX Using Linux Fourth Edition
Unix Basics Chapter 4.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Linux+ Guide to Linux Certification, Second Edition
1Week 4 - Jan 31, 2005 Week 4 Agenda UNIX Directory Structure Absolute pathname Relative pathname Permissions chmod (symbolic/absolute)
The UNIX File System. The UNIX File A file is a container for storing information and data. Filename limited to 255 characters. Can’t contain / or NULL.
CIS 90 - Lesson 7 Lesson Module Status Slides – draft Properties - done Flash cards – No-stress quiz – Web Calendar summary – Web book pages – done Commands.
CIS 90 - Lesson 15 Lesson Module Status Slides – Properties - Flash cards – No-stress quiz – Web calendar summary – Web book pages – Commands – Lab – done.
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
Introduction to Bash Programming Ellen Zhang. Previous three classes What have we learnt so far ?
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
BIF703 Hard & Symbolic Links. What is a file system Link? A link is a pointer to a file. This pointer associates a file name with a number called an i-node.
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Workbook 4 User & Group Permissions RH030 Linux Computing Essentials.
PacNOG 6: Nadi, Fiji UNIX ™/ /Linux Permissions Hervey Allen Network Startup Resource Center.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Linux Commands C151 Multi-User Operating Systems.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
The Unix File System R Bigelow. The UNIX File System The file system refers to the way in which UNIX implements files and directories. The UNIX file system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Laboratory 1.2a1 First steps with Unix - Lab Boris Steipe Department of Biochemistry Department.
Linux Filesystem Management
Getting Started with Linux
Introduction to Unix – CS 21
Tutorial of Unix Command & shell scriptS 5027
File permissions Operating systems I800
Prepared by: Eng. Maryam Adel Abdel-Hady
Linux 101 Training Module Linux Basics.
Scoutmaster, Scoutmaster he's our man. If he can't do it, nobody can.
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Using Linux Commands Lab 3.
Tutorial of Unix Command & shell scriptS 5027
Presentation transcript:

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, 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 ObjectivesAgenda 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 File Permissions

CIS 90 - Lesson 7 Housekeeping

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 1xxx 2x 3x 4xxxx 5xxxxx 6 7x 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 the three elements that make up a UNIX file? The filename, the inode, and the data

CIS 90 - Lesson 7 Test 1 – Most Missed Questions xxx xxxxxxxxxxxx 17xx 18xxxxxxxx 19xxxxxx 20x 11.Is /boot/grub/grub.conf a relative or absolute path? absolute 12.What is the program called that prompts you for a command, then locates that command and executes it? The Shell 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 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 21xxxxxxx 22xxxxx 23xxxx 24x 25xxxxxxxxx 26xxx 27xx 28xxxxxxxxxxxxx 29x 30xxxxx 21.What is the value of your $PS1 environment variable? \W]\$ 22.What command will set your prompt to: “Your wish is my command: > ”? PS1=”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? 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 and 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 one- liner 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 on Opus. What is Benji’s favorite game to play? gopher 30.Calculate: ( 23^2 * 4 – 100) – sqrt(64) and (using /bin/mail) the answer to rsimms mail rsimms Subject: Q

CIS 90 - Lesson 7 Test 1 – Most Missed Questions 31xxxxxxxxxx 32x 33xxxxxxxxxx 34xxxxxxxxxxxx 35xxxxx 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? 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]? proposal2, proposal3

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 5 Superblock Inode Table ext2 file system Data Blocks ~]$ls -il letter rw-r--r-- 1 simmsben cis Jul letter 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. 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. 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. Alan Sherman bigfile bin letter bigfile bin letter simmsben cis Pointer(s) to data blocks inode number Type Number of links User Group Size Modification time Access Time change time Pointer(s) to data blocks rw-r—r-- Permissions

File Permissions Relevant fields from the inode CIS 90 - Lesson 7 / A.Owner of the file: uid B.Group Membership of the file: gid C.Permissions: read, write, execute rwx 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.

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

File Permissions Relevant Commands CIS 90 - Lesson 7 / 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)  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.

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

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

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

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

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

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

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

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

File Permissions umask - examples CIS 90 - Lesson 7 / Directory3]$ umask 0002 Directory3]$ rm myfile Directory3]$ touch myfile Directory3]$ ls -l total 4 -rw-rw-r-- 1 simmsben cis90 0 Oct 15 14:59 myfile Directory3]$ Directory3]$ umask 000 Directory3]$ rm myfile Directory3]$ touch myfile Directory3]$ ls -l total 4 -rw-rw-rw- 1 simmsben cis90 0 Oct 15 15:00 myfile Directory3]$ Directory3]$ umask 022 Directory3]$ rm myfile Directory3]$ touch myfile Directory3]$ ls -l total 4 -rw-r--r-- 1 simmsben cis90 0 Oct 15 15:00 myfile Directory3]$ rw_rw_r__ rw_rw_rw_ rw_r__r__

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

File Permissions exercise – can owner change these files? CIS 90 - Lesson 7 / /home/cis90/simmsben/Directory1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 /home/cis90/simmsben/Directory1 $ /home/cis90/simmsben/Directory1 $ echo "changes" > file1

File Permissions exercise – can owner change these files? CIS 90 - Lesson 7 / /home/cis90/simmsben/Directory1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 /home/cis90/simmsben/Directory1 $ /home/cis90/simmsben/Directory1 $ echo "changes" > file1 /home/cis90/simmsben/Directory1 $ echo "changes" > file2

File Permissions exercise – can owner change these files? CIS 90 - Lesson 7 / /home/cis90/simmsben/Directory1 $ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 /home/cis90/simmsben/Directory1 $ /home/cis90/simmsben/Directory1 $ echo "changes" > file1 /home/cis90/simmsben/Directory1 $ echo "changes" > file2 /home/cis90/simmsben/Directory1 $ echo "changes" > file3

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

File Permissions exercise – can group user change these files? CIS 90 - Lesson 7 / Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 8 Oct 15 11:48 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 Directory1]$ echo "changes" > file1

File Permissions exercise – can group user change these files? CIS 90 - Lesson 7 / Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 8 Oct 15 11:48 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 Directory1]$ echo "changes" > file1 Directory1]$ echo "changes" > file2

File Permissions exercise – can group user change these files? CIS 90 - Lesson 7 / Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 8 Oct 15 11:48 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 Directory1]$ echo "changes" > file1 Directory1]$ echo "changes" > file2 -bash: file2: Permission denied Directory1]$ echo "changes" > file3

File Permissions exercise – can group user change these files? CIS 90 - Lesson 7 / Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 8 Oct 15 11:48 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 Directory1]$ echo "changes" > file1 Directory1]$ echo "changes" > file2 -bash: file2: Permission denied Directory1]$ echo "changes" > file3 -bash: file3: Permission denied Directory1]$

File Permissions exercise – can other user change these files? CIS 90 - Lesson 7 / ~]$ ls -l /home/cis90/simmsben/Directory1 ls: /home/cis90/simmsben/Directory1: Permission denied ~]$ echo "simmsmar" > /home/cis90/simmsben/Directory1/file1 -bash: /home/cis90/simmsben/Directory1/file1: Permission denied ~]$ echo "simmsmar" > /home/cis90/simmsben/Directory1/file2 -bash: /home/cis90/simmsben/Directory1/file2: Permission denied ~]$ echo "simmsmar" > /home/cis90/simmsben/Directory1/file3 -bash: /home/cis90/simmsben/Directory1/file3: Permission denied ~]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 9 Oct 15 12:15 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 Directory1]$

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

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

File Permissions exercise – can other user delete these files? CIS 90 - Lesson 7 / Directory1]$ ls -ld drwxr-x--x 2 simmsben cis Oct 15 12:42. Directory1]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 ~]$ rm /home/cis90/simmsben/Directory1/file1 rm: cannot remove `/home/cis90/simmsben/Directory1/file1': Permission denied ~]$ rm /home/cis90/simmsben/Directory1/file2 rm: cannot remove `/home/cis90/simmsben/Directory1/file2': Permission denied ~]$ rm /home/cis90/simmsben/Directory1/file3 rm: cannot remove `/home/cis90/simmsben/Directory1/file3': Permission denied ~]$

File Permissions exercise – can owner read these files? CIS 90 - Lesson 7 / ~]$ ls Directory1 file1 file2 file3 ~]$ cat Directory1/* blah blah blah ~]$

File Permissions exercise – can group user read these files? CIS 90 - Lesson 7 / Directory1]$ ls -ld drwxr-x--x 2 simmsben cis Oct 15 12:42. Directory1]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 ~]$ cat../simmsben/Directory1/file* blah blah blah ~]$

File Permissions exercise – can other user read these files? CIS 90 - Lesson 7 / drwxr-x rsimms cis Oct 8 09:47 /home/cis90 ~]$ ls -ld /home/cis90/simmsben/ drwxr-xr-x 12 simmsben cis Oct 15 13:45 /home/cis90/simmsben/ ~]$ Directory1]$ ls -ld drwxr-x--x 2 simmsben cis Oct 15 12:42. Directory1]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 ~]$ cat /home/cis90/simmsben/Directory1/file1 cat: /home/cis90/simmsben/Directory1/file1: Permission denied ~]$ cat /home/cis90/simmsben/Directory1/file2 cat: /home/cis90/simmsben/Directory1/file2: Permission denied ~]$ cat /home/cis90/simmsben/Directory1/file3 cat: /home/cis90/simmsben/Directory1/file3: Permission denied ~]$

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

File Permissions exercise – can group user execute these files? CIS 90 - Lesson 7 / Directory1]$ ls -ld drwxr-x--x 2 simmsben cis Oct 15 12:42. Directory1]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 ~]$ /home/cis90/simmsben/Directory1/file1 -bash: /home/cis90/simmsben/Directory1/file1: Permission denied ~]$ /home/cis90/simmsben/Directory1/file2 blah blah blah ~]$ /home/cis90/simmsben/Directory1/file3 blah blah blah ~]$

File Permissions exercise – can other user execute these files? CIS 90 - Lesson 7 / ~]$ ls -ld /home/cis90 drwxr-x rsimms cis Oct 8 09:47 /home/cis90 ~]$ ls -ld /home/cis90/simmsben/ drwxr-xr-x 12 simmsben cis Oct 15 13:45 /home/cis90/simmsben/ Directory1]$ ls -ld drwxr-x--x 2 simmsben cis Oct 15 12:42. Directory1]$ Directory1]$ ls -l total 24 -rw-rw-r-- 1 simmsben cis90 15 Oct 15 11:13 file1 -rwxr-xr-x 1 simmsben cis90 15 Oct 15 11:13 file2 -r-xr-xr-- 1 simmsben cis90 15 Oct 15 11:13 file3 ~]$ /home/cis90/simmsben/Directory1/file1 -bash: /home/cis90/simmsben/Directory1/file1: Permission denied ~]$ /home/cis90/simmsben/Directory1/file2 -bash: /home/cis90/simmsben/Directory1/file2: Permission denied ~]$ /home/cis90/simmsben/Directory1/file3 -bash: /home/cis90/simmsben/Directory1/file3: Permission denied ~]$

CIS 90 - Lesson 7 Lab 6

CIS 90 - Lesson 7

CIS 90 - Lesson 7 Wrap up

CIS Lesson 7 New commands: chgrpchange file's group chmodchange file permissions chownchange file owner (superuser only) umaskchange permission mask New Files and Directories: NA

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: 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