100 likes | 210 Vues
This guide provides an overview of Linux file permissions, types, and commands for managing access control. It explains the significance of the first column in the file system, distinguishing between directories, symbolic links, special files, and ordinary files. It details user, group, and other permissions along with the different types of access: read, write, and execute for both files and directories. Additionally, it covers commands like `chmod`, `chown`, `chgrp`, and `umask` to modify permissions and ownership on files and directories effectively.
E N D
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
Second Column • 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
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
chmod • chmod u (user) • chmod g (group) • chmod a (all) • chmodu+w ./quarters = add write permission to user • chmodg+rwx ./quarters = add all permssions to all • chmod a-wx ./quarters = remove write and execute for all
chmod chmod 744 ./quarters chmod 774 ./quarters chmod 544 ./quarters
umask • Change the system-wide default permission • Default permissions for all files created in the future until umask is changed • umask 077
chown • chown = change file ownership • chownhoffmann ./quarters
chgrp • chgrp = change group owner • chgrpthegame ./quarters
newgrp • switching groups • newgrpthegame