Modify File and Directory Ownership / Configure Special Permissions and Attributes Flashcards
Change owner but not group
chown {user name} {file/directory name}
Change owner and group
chown {user name} :{group name} {file directory name}
Changes owner and group to specified user’s login group
chown {user name}: {file/directory name}
Change group but not owner (Same as chgrp command)
chown :{group name} {file/directory name}
Change a group without using chown
chgrp {group name} {file / directory name}
set SUID on a file using symbolic and absolute mode
chmod u+s {file names}
chmod 4### {file names}
set GUID on file using symbolic and absolute mode
chmod g+s {file names}
chmod 2### {directory names}
Removing SUID and SGID in symbolic and absolute mode
symbolic: use - symbol
absolute: 0###
Special permission bit that ensures only the owner of a file or directory (or root) can delete the file or directory
sticky bit
set sticky bit using symbolic and absolute mode
chmod +t {directory or file name}
chmod 1### {directory or file name}
remove sticky bit using symbolic and absolute mode
chmod -t {directory or file name}
chmod 0###
attribute of a file or directory that prevents it from being modified, even by root
how is it indicated in file attributes?
immutable flag
lowercase i in attributes indicates it
command used to list the attributes of a file or directory
lsattr [options] {file/directory name}
option to list directories like files, instead of listing their contents
-d
option to list the version number of the file
-v