Privileges: who can control what

Slides:



Advertisements
Similar presentations
The UNIX File System Harry Chen Department of CSEE University of MD Baltimore County.
Advertisements

File Security. Viewing Permissions ls –l Permission Values.
Chapter 10 File System Security. Security Policies security policies are doors maintain a balance between total access and total security UNIX has two.
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.
CS 497C – Introduction to UNIX Lecture 15: - File Attributes Chin-Chih Chang
Linux Linux File System.
Linux File Security. What is Permission ? Specifies what right are granting to users to access the resources available in the computer. So that important.
Getting Started with Linux Linux System Administration Permissions.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Unix System Administration Rootly Powers Chapter 3.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2011 by the Trustees of Indiana University except as noted.
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Editing, vi and Configuration Files Introduction to Linux June 16, 2009 Papeete, French Polynesia Hervey Allen.
1Week 4 - Sep 26, 2005 Week 4 Agenda UNIX Directory Structure Absolute pathname Relative pathname Permissions chmod (symbolic/absolute)
UNIX System Protection. Unix History Developed by Dennis Ritchie and Ken Thompson at AT&T Bell Labs Adapted some ideas from the Multics project in 1969.
Getting Started with Linux Linux System Administration Editors.
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.
Privileges: who can control what Introduction to Unix June 16, 2009 Papeete, French Polynesia Hervey Allen.
Privileges: who can control what Introduction to Unix May 24, 2008 Rabat, Morocco Hervey Allen.
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
PacNOG 6: Nadi, Fiji Editing, vi & Configuration Files Hervey Allen Network Startup Resource Center.
Editing, vi and Configuration Files Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania
The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
CSCI 330 The UNIX System Unit V Permissions. all access to directories and files is controlled UNIX uses discretionary access control (DAC) model each.
Editing, vi and Configuration Files Introduction to Unix May 25, 2008 Rabat, Morocco Hervey Allen.
Editing, vi and Configuration Files Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
UNIX File System By Vishal Desai. Introduction Basic purpose of file system: Represent and organize the system resources. But UNIX File System also maps.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Directories.
Editing, vi and Configuration Files Unix/Linux Preparation Course June 27, 2010 Pago Pago, American Samoa
File System Security ls -l. First Columm d = directory l = symbolic link b = block special file c = character special file p = fifo (or named pipe) special.
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.
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.
Jozef Goetz, expanded by Jozef Goetz, 2008 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
BIF703 File Permissions. As you recall from our previous notes, that Unix/Linux recognizes everything as a file: Regular files to store data, programs,
Getting Started with Linux Linux System Administration Editors.
File System Security in Unix Annie Calpe. Overview Unix Basics File System Security: - Account Security: Passwords - File Permissions - Access Control.
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
Privileges: who can control what
Permissions: who can control what Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
Introduction to Unix – CS 21
File permissions Operating systems I800
Chapter 3 Maintaining Security
Lecture 2 Working with Files and Directories
Chapter 8 File Security.
Editing, vi and Configuration Files
Editing, vi and Configuration Files
Linux System Administration Editors
BIF703 File Permissions.
Unix Access Control Basic CE 2
Permission and CHMOD.
CE Operating Systems Lecture 21
Access Control Lists CSCI Fall 2008 GWU Sources:
Chapter 7 File and file System structure
Presented by, Mr. Satish Pise
UNIX System Protection
Security and File Permission
Engineering Secure Software
The Linux Command Line Chapter 9
Department of School of Computing and Engineering
Chapter Introduction 3.2 The UNIX Model of Ownership
Rootly Powers Chapter 3.
Figure 6-13: Managing Permissions
BASIC FILE ATTRIBUTES.
Presentation transcript:

Privileges: who can control what Introduction to Unix May 24, 2008 Rabat, Morocco Hervey Allen

Goal Understand the following: The Unix security model How a program is allowed to run Where user and group information is stored Details of file permissions

Some philosophy It's available! Wait, what was that? Oh yeah, it's available! It's has some very powerful features. It's ubiquitous in Unix (visudo, vipw, vigr, etc.) Not that hard to learn after initial learning curve. Impress your friends and family with your arcane knowledge of computers.

Users and Groups Unix understands Users and Groups A user can belong to several groups A file can belong to only one user and one group at a time A particular user, the superuser “root” has extra privileges (uid = “0” in /etc/passwd) Only root can change the ownership of a file

Users and Groups cont. User information in /etc/passwd User info in db-format in /etc/pwd.db User password hashes in db-format in /etc/spwd.db Group information is in /etc/group /etc/passwd and /etc/group divide data fields using “:”

A program runs... A program may be run by a user, when the system starts or by another process. Before the program can execute the kernel inspects several things: Looks up the numeric ID values for uid and gid of the user in the file /etc/passwd. Is the execute bit set on the program file? Does whoever ran the program, or the program itself have the required privileges to do what is requested? In most cases, while executing, a program inherits the privileges of the user/process who started it.

A program in detail When we type: ls -l /usr/bin/top We'll see: -r-xr-xr-x 1 root wheel 46112 Apr 28 10:52 /usr/bin/top What does all this mean?

-r-xr-xr-x 1 root wheel 46112 Apr 28 10:52 /usr/bin/top ---------- --- ------- ------- -------- ------------ ------------- | | | | | | | | | | | | | File Name | | | | | | | | | | | +--- Modification Time/Date | | | | | | | | | +------------- Size (in bytes) | | | | | | | +----------------------- Group | | | | | +-------------------------------- Owner | | | +-------------------------------------- Dir. entry refs to file | +---------------------------------------------- File Permissions Group The name of the group that has file permissions in addition to the file's owner. Owner The name of the user who owns the file. File Permissions A representation of the file's access permissions. The first character is the type of file. A "-" indicates a regular (ordinary) file. A "d" would indicate a directory. The second set of three characters represent the read, write, and execution rights of the file's owner. The next three represent the rights of the file's group, and the final three represent the rights granted to everybody else. (Example modified from http://www.linuxcommand.org/lts0030.php)

Access rights Files are owned by a user and a group (ownership) Files have permissions for the user, the group, and other “other” permission is often referred to as “world” The permissions are Read, Write and Execute (R, W, X) The same applies to all files

Some special cases When looking at the output from “ls -l” in the first column you might see: d = directory - = regular file l = symbolic link s = Unix domain socket p = named pipe c = character device file b = block device file

Some special cases cont In the Owner, Group and other columns you might see: s = setuid [when in Owner column] s = setgid [when in Group column] t = sticky bit [when at end] Some References http://www.tuxfiles.org/linuxhelp/filepermissions.html http://www.cs.uregina.ca/Links/class-info/330/Linux/linux.html http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html

File permissions There are two ways to set permissions when using the chmod command: Symbolic mode: testfile has permissions of -r--r--r-- U G O* $ chmod g+x testfile ==> -r--r-xr-- $ chmod u+wx testfile ==> -rwxr-xr-- $ chmod ug-x testfile ==> -rw--r--r-- U=user, G=group, O=other (world)

File permissions cont. Absolute mode: We use octal (base eight) values represented like this: Letter Permission Value R read 4 W write 2 X execute 1 - none 0 For each column, User, Group or Other you can set values from 0 to 7. Here is what each means: 0= --- 1= --x 2= -w- 3= -wx 4= r-- 5= r-x 6= rw- 7= rwx

File permissions cont. Numeric mode cont: Example index.html file with typical permission values: $ chmod 755 index.html $ ls -l index.html -rwxr-xr-x 1 root wheel 0 May 24 06:20 index.html $ chmod 644 index.html -rw-r--r-- 1 root wheel 0 May 24 06:20 index.html

Inherited permissions Two critical points: The permissions of the directory in which a file resides determines what a user can do to the file. The permissions of the file determine what a user can do to the data in the file. Example: If a directory is owned by another user, then you cannot delete a file in the directory, even if you have write (w) access to the file, but you can update the data in the file.

Conclusion To reinforce these concepts let's do some exercises. In addition, a very nice reference on using the chmod command is: An Introduction to Unix Permissions -- Part Two By Dru Lavigne http://www.onlamp.com/pub/a/bsd/2000/09/13/FreeBSD_Basics.html