file permissions. what are the three categories of users that apply to file permissions? owner (or...

7
File Permissions

Upload: luke-sutton

Post on 30-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

File Permissions

Page 2: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

What are the three categories of users that apply to file permissions?

• Owner (or user)

• Group

• All others (public, world, others)

Page 3: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

What command is used to change the owner of a file? Who can use this command?

1. chown [login name | uid] files…

2. On Linux systems, only superuser (root)can use this command. On other versions ofUNIX, the owner of a file can change its ownership.

Page 4: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

What command is used to change the group of a file?Who can issue this command?

• chgrp [group name | gid] file …

• Besides the superuser, only the owner of a file can reassign the group to which it belongs.To change the group, the owner must belong to the group to which it is being changed.(group names can be found in the file /etc/group)

Page 5: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

What command is used to change a file’s permissions? Who can use this command?

• chmod perms file …

• Aside from the superuser, only the owner of a file may change its permissions

Page 6: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

What do permissions mean for files vs. directories

Files Directories

• read – allows access to the content of the file:cat more, grep, cp

• write – allows changing the content of the file:vi > >> editors

• execute – allows running the file as a process

• read – allows viewing the content of a directory:ls … find

• write – allows changing the content of a directory:mv cp ln rm mkdir

• execute – allows a directory to be searched or changed to:cd ls –l find

Page 7: File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)

How does UNIX set the default permissions for files?

• The umask value:– 000 – all normal permissions are allowed

– 777 – all permissions are denied

– 444 – read permission denied

– 222 – write permission denied

– 111 – execute permission denied

– 022 – write permission is denied to group and others