Chapter 14 Flashcards
Every file has an associated blank and an associated blank.
owner
group
The security model for Linux is based on blank.
Unix
The blank number associates a file with an owner, whereas the blank number associates a file with a group.
UID
GID
As blank, you can change the owner of a file or reassign the group, but only to a group that the owner is part of.
root
What file manager can you run as root to change file permissions?
nautilus or GNOME Files
The command to change the ownership of a file in the preferred text-mode manner is blank
chown
When using chown, what do you have to include to signify a change to the group
owner:group
What command allows you to change the group without changing the owner?
chgrp
What option can you use with chown or chgrp to change the ownership of all the files in the same directory tree?
-R or –recursive
What command (and option) should you use to see a file’s permissions?
ls -l
The ls -l command returns what 7 columns
1) File permissions
2) Number of Links
3) Username
4) Group Name
5) File Size
6) Time Stamp
7) Filename
The first character in the file permission’s is the blank
The file type code
Which file type code is a normal data file?
-
Which file type code is a directory
d
Which file type code is a Symbolic link
l
Which file type code is a named pipe
p
Which file type code is a socket
s
Which file type code is a block device
b
Which file type code is a character device
c
What are the three types of file permissions?
Owner Permissions
Group Permissions
World (or Other) Permissions
In the three sets of permissions, what are the three types of access
read
write
execute
In a file permission string (after the file type code), what does the dash represent?
absence of a permission
What is the code for the ability to read a file?
r
What is the code for the ability to write a file?
w
What is the code for the ability to execute a file?
x
The other way to display file permissions is a blank
octal code
In octal code, what do you add to the starting permission of 0 to indicate the owner(or group or other) has permission to write a file
add 2
In octal code, what do you add to the starting permission of 0 to indicate the owner(or group or other) has permission to read a file
add 4
In octal code, what do you add to the starting permission of 0 to indicate the owner(or group or other) has permission to execute a file
add 1
The octal code is a blank number
three digit
Convert the permission string to octal code - rwxrwxrwx
777
Convert the permission string to octal code - rwxrw-rw-
755
Convert the permission string to octal code - rwxr-x—
750
Convert the permission string to octal code - rw-rw-rw-
666
Convert the permission string to octal code - rw-r–r–
644
Convert the permission string to octal code - r——–
400
Convert the permission string to octal code - rw——-
600
Directories use the blank to grant permission to enter the directory and access files
execute bit
Directories are files that are interpreted in a special way. As such, if a user can can blank to a directory, that user can create, delete, or rename files in the directory, even if the user isn’t the owner of those files and does not have permission to write to those files
write
Permissions on symbolic links are always blank, but the access applies only to the link file itself, not to the linked-to-file itself
777
Many of the file permission rules don’t apply to blank. They can read and write to any file, but they still need an execute bit set to run a program.
root
Do you need root access to change the file permissions on the files you own?
No
In the text-mode shell, you can use blank to change permissions
chmod
When using chmod, you can specify the file permissions in what two ways?
octal or symbolic code
When using chmod, changing via symbolic code consists of what three parts
A code for what set of permissions you want to change
A symbol indicating whether you want to add, delete, or set the mode equal to the initial value
A code setting the r,w,x values
When using chmod, changing via symbolic code what does the a, u, g and o codes each stand for?
all
user(owner)
group
other
The blank determines the default permissions for new files and directories by removing the octal code provided from the default 666 for file permissions or 777 for directory permissions
user mask, or umask
Typically, the umask file appears in a blank, like /etc/profile or in a blank like ~/.bashrc
system configuration file
user configuration file
Modifying a file requires the ability to write to the file, but creating or deleting a file requires blank
write access to the directory in which it resides
With the blank set on a directory, Linux will permit you to delete a file only if you own it or the containing directory
sticky bit
Name the two ways that you can set the sticky bit
1) Using chmod with octal code and a preceding 1(turn on) or 0(turn off) before the octal code
2) Using chmod on the o option with a +t to add sticky bit or -t to turn off sticky bit
If a program needs to run with elevated privileges (like passwd), the blank option tells Linux to run the program with the permissions of whoever owns the file rather than with the permissions of the user who runs the program. It changes the x in symbolic code for the user to s
Set User ID (SUID)
If a program needs to run with elevated privileges (like passwd), the blank option tells Linux to set the group of the running program to the group of the file. It changes the x in the group in symbolic code to s.
Set Group ID (SGID)
Name the two ways to set the SUID and SGID
octal code - leading value (aside from the 777) to 4 for SUID, 2 to SGID or 6 for both
symbolic code - chmod for just userid do u+(or- to turn off)s for SUID, g+(or-)s for SGID, or ug+(-)s for both
What is the naming convention to hide files from commands like the ls command
put a preceding .(dot) to the file name to create a dot file
What option can you include with ls to see dot files?
-a
In the ls -la listing, if you see just a dot(.) where filename normally is what does that mean?
the current directory is hidden
In the ls -la listing, if you see just a .. where filename normally is what does that mean?
the parent directory is hidden
If you’re working in a directory that holds many subdirectories, and if you use the wildcard with ls that matches one or more subdirectories, the result will show blank instead of the information on the subdirectories themselves
the files in the matched subdirectory
If you use the blank option with ls -l, you will get information on subdirectories rather than the contents of those subdirectories
-d
What command would you use type (as root) to change the ownership of somefile.txt from ralph to tony?
A) chown ralph:tony somefile.txt
B) chmod somefile.txt tony
C) chown somefile.txt tony
D) chown tony somefile.txt
E) chmod tony somefile.txt
D
Typing ls -ld wonderjaye reveals a symbolic file mode of drwxr-xr-x. Which of the following are true (select all that apply)?
A) wonderjaye is a symbolic link
B) wodnerjaye is an executable program
C) wonderjaye is a directory
D) woderjaye may be read by all users of the system
E) wonderjaye may be written by any member of the file’s group
C,D,
Which of the following commands can you use to change a group?
A) groupadd
B) groupmod
C) chmod
D) ls
E) chown
E
True or False: A file with permission of 755 can be read by all users on the computer, assuming all users can read the directory in which it resides
True
True or False: Only root users can use the chmod command
False
True or False: Only root can change a file’s ownership with chown
True
The blank option causes chown to change ownership of an entire directory
-R
The three character symbolic string blank represents read and execute permissions but no write permissions
r-x
The chmod symbolic representation blank allows all users execute file access to a file without affecting other permissions
a+x
You want to set the sticky bit on an existing directory, subdir, without otherwise altering its permissions. To do so, you would type chmod blank subdir
o+t