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
Which configuration allows all permissions for the owner and only read and execute permission for other users?The absolute mode syntax states the desired permissions from left to right. How do I grant the user (owner) read, write, and execute, the group read-only, and all others no access to file2 by using absolute mode? In this example, the user has rwx, the group has r only, and all others have no access to file2 .
What does chmod 755 do?If we implement the command, i.e., chmod 755 filename, we remit everyone to execute and read the file. In this case, the owner of the file is also permitted to write to this file. When we use 755 for any directory, it defines that anyone can access it.
What does chmod 744 mean?chmod 744 file1. sets read, write and execute for the owner and read only for the group and all others. chmod 777 file1. sets read, write and execute for everyone.
How do I give my user permissions as read only?Set the permissions in a role. Click Administration > User Management > Roles.. Click Create Role.. Enter a name and description, and select the permissions needed for the role.. Scroll down to the Devices section.. In the Devices title bar, in the drop-down menu, click Read Only. ... . Click Save.. |