WK 3 Authenticate and authorise users: file permissions and ownership Flashcards

1
Q

Permissions

A

Permissions are the type of access granted for a file or directory. Permissions are related to authorisation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Authorisation

A

Authorisation is the concept of granting access to specific resources in a system. Authorisation allows you to limit access to specified files or directories. A good rule to follow is that data access is on a need-to-know basis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Three types of permissions in Linux

  1. Read
A

The first type of permission is read. On a file, read permissions means contents on the file can be read.

On a directory, this permission means you can read all files in that directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Three types of permissions in Linux

  1. Write
A

Next are write permissions. Write permissions on a file allow modifications of contents of the file.

On a directory, write permissions indicate that new files can be created in that directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Three types of permissions in Linux

  1. Execute
A

Finally, there are also execute permissions. Execute permissions on files mean that the file can be executed if it’s an executable file.

Execute permissions on directories allow users to enter into a directory and access its files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Three different types of owners

  1. User
A

The first type is the user. The user is the owner of the file. When you create a file, you become the owner of the file, but the ownership can be changed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Three different types of owners

  1. Group
A

Group is the next type. Every user is a part of a certain group. A group consists of several users, and this is one way to manage a multi-user environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Three different types of owners

  1. Other
A

Finally, there is other. Other can be considered all other users on the system. Basically, anyone else with access to the system belongs to this group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

File permissions representation:

drwxrwxrwx.

A

In Linux, file permissions are represented with a 10-character string. For a directory with full permissions for the user group, this string would be: drwxrwxrwx.

Let’s examine what this means more closely. The first character indicates the file type. As shown in this example, d is used to indicate it is a directory. If this character contains a hyphen instead, it would be a regular file.

The second, third, and fourth characters indicate the permissions for the user. In this example, r indicates the user has read permissions, w indicates the user has write permissions, and x indicates the user has execute permissions.

If one of these permissions was missing, there would be a hyphen instead of the letter. In the same way, the fifth, sixth, and seventh characters indicate permissions for the next owner type group.

As it shows here, the type group also has read, write, and execute permissions. There are no hyphens to indicate that any of these permissions haven’t been granted.

Finally, the eighth through tenth characters indicate permissions for the last owner type: other. They also have read, write, and execute permissions in this example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

world-writable file

A

When the user, the group, and other can all write to a file. This type of file is considered a world-writable file. World-writable files can pose significant security risks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to check permissions?

Options

A

So how do we check permissions? First, we need to understand what options are.

Options modify the behavior of the command. The options for a command can be a single letter or a full word. Checking permissions involves adding options to the ls command.

First: ls -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to check permissions?

ls -l

ls -la

A

First, ls -l displays permissions to files and directories. You might also want to display hidden files and identify their permissions. Hidden files, which begin with a period before their name, don’t normally appear when you use ls to display file contents.

Entering ls -a displays hidden files. Then you can combine these two options to do both. Entering ls -la displays permissions to files and directories, including hidden files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly