The Unix-like operating systems, such as Linux differ from other computing systems in that they are not only multitasking but also multi-user. Show
What exactly does this mean? It means that more than one user can be operating the computer at the same time. While a desktop or laptop computer only has one keyboard and monitor, it can still be used by more than one user. For example, if the computer is attached to a network, or the Internet, remote users can log in
via The multi-user capability of Unix-like systems is a feature that is deeply ingrained into the design of the operating system. If we remember the environment in which Unix was created, this makes perfect sense. Years ago before computers were "personal," they were large, expensive, and centralized. A typical university computer system consisted of a large mainframe computer located in some building on campus and terminals were located throughout the campus, each connected to the large central computer. The computer would support many users at the same time. In order to make this practical, a method had to be devised to protect the users from each other. After all, we wouldn't want the actions of one user to crash the computer, nor would we allow one user to interfere with the files belonging to another user. This lesson will cover the following commands:
File PermissionsOn a Linux system, each file and directory is assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, to write a file, and to execute a file (i.e., run the file as a program). To see the permission settings for a file, we can use the [me@linuxbox me]$ Here we can see:
In the diagram below, we see how the first portion of the listing is interpreted. It consists of a character indicating the file type, followed by three sets of three characters that convey the reading, writing and execution permission for the owner, group, and everybody else.
chmodThe It is easy to think of the permission settings as a series of bits (which is how the computer thinks about them). Here's how it works: rwx rwx rwx = 111 111 111 rw- rw- rw- = 110 110 110 rwx --- --- = 111 000 000 and so on... rwx = 111 in binary = 7 rw- = 110 in binary = 6 r-x = 101 in binary = 5 r-- = 100 in binary = 4 Now, if we represent each of the three sets of permissions (owner, group, and other) as a single digit, we have a pretty convenient way of expressing the possible permissions settings. For example, if we wanted to set [me@linuxbox
me]$ Here is a table of numbers that covers all the common settings. The ones beginning with "7" are used with programs (since they enable execution) and the rest are for other kinds of files.
Directory PermissionsThe
Here are some useful settings for directories:
Becoming the Superuser for a Short WhileIt is often necessary to become the superuser to perform important system administration tasks, but as we know, we should not stay logged in as the superuser. In most distributions, there is a program that can give you temporary access to the superuser's privileges. This program is called [me@linuxbox me]$ After executing the In most modern distributions, an alternate method is used. Rather than using [me@linuxbox me]$ In fact, modern distributions don't even set the root account password thus making it impossible to log in as the root user. A
root shell is still possible with [me@linuxbox me]$ Changing File OwnershipWe can change the owner of a file by using the [me@linuxbox me]$ Notice that in order to change the owner of a file, we must have superuser privileges. To do this, our example employed
the
Changing Group OwnershipThe group ownership of a file or directory may be changed with [me@linuxbox me]$ In the example above, we changed the group ownership of Further Reading
What is the permission value for a file read only for the group owner?755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only. Some directory permission examples: 777 - all can read/write/search.
What is chmod R 644?Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.
What is 755 permission Linux?755 means read and execute access for everyone and also write access for the owner of the file. When you perform chmod 755 filename command you allow everyone to read and execute the file, the owner is allowed to write to the file as well.
What is the permission value for a file read only for the group owner 040?Absolute form. |