file system security ls -l. first columm d = directory l = symbolic link b = block special file c =...

10
File System Security ls -l

Upload: morgan-walsh

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

rwx – user “owner” permissions: – if you created it, you own it --- rwx --- – group “owner” permissions: – you and other people in the owner’s group rwx – other “world” permissions: – everyone else Second Column

TRANSCRIPT

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

File System Security

ls -l

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

First Columm

• d = directory• l = symbolic link• b = block special file• c = character special file• p = fifo (or named pipe) special file• - = ordinary file• s = named socket special file

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

• rwx --- ---– user “owner” permissions:– if you created it, you own it

• --- rwx --- – group “owner” permissions: – you and other people in the owner’s group

• --- --- rwx– other “world” permissions:– everyone else

Second Column

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

Three types of file access:• Read – List the contents of a file• Write – Update the contents of the file• Execute – If the file is a program, run it

Three types of directory access:• Read – List the files in the directory• Write – Rename or delete files in the directory,

or copy files to the directory• Execute – cd to the directory

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

chmod

• chmod u (user)• chmod g (group)• chmod a (all)

– chmod u+w ./quarters = add write permission to user– chmod g+rwx ./quarters = add all permssions to all– chmod a-wx ./quarters = remove write and execute for all

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

chmodRead Write Execute Octal Outcome Outcome

4 2 1 7 rwx4 2 - 6 rw-4 - 1 5 r-x4 - - 4 r--- 2 1 3 -wx- 2 - 2 -w-- - 1 1 --x

chmod 744 ./quarterschmod 774 ./quarterschmod 544 ./quarters

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

umask

• Change the system-wide default permission• Default permissions for all files created in the

future until umask is changed

• umask 077

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

chown

• chown = change file ownership

• chown hoffmann ./quarters

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

chgrp

• chgrp = change group owner

• chgrp thegame ./quarters

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

newgrp

• switching groups

• newgrp thegame