1.11 – Ownership in Linux & Mac Flashcards
Ownership
*Linux & Mac OS both share origins with OS known as Unix
—Have many similarities when it comes to controlling file access
chown
used to change the owner & group of a file
syntax
chwon user: groupfile
EX: chown juan: instructors class_presentation
—changes the owner to juan
—changes the group to instructor
chmod
used to change permissions of a file or folder
owner / group / everyone
owner permissions apply to the original file creator
group permissions apply to the group of accounts that have been given access
read / write / execute
are different permissions that can be granted to a user or group of users
read(r)
+4 permission
= allows someone to view the contents of a file
write(w)
+2 permission
= allows someone to save changes to a file
execute(x)
+1 permission
= allows someone to execute programs or scripts
Assign Full Permissions
assign read+ write+ execute or 4+2+1 = 7
read / write / execute
EXAMPLE
chmod 764 class_presentation
chmod u+rwx / g+rw / a+r
*sets owner to have full permissions [7]
*group has read & write [6]
everyone has just read [4]