multi-user operating in a same time. Linux is a UNIX like operating system. This operation same to UNIX and Linux.
Linux/Unix Operation System with following commands:
- modify file access rights
- temporarily become the superuser
- change file ownership
- change a file's group ownership
drwx rwx rwx = 111 111 111 -rw- rw- rw- = 110 110 110 -rwx --- --- = 111 000 000 - --- --- --- = 000 000 000
- or d= id directory or not
r = Read the file or Directory w = write the file or Directory x = Execute the file or Directory And it is easy to: rwx = 111 in binary = 7 rw- = 110 in binary = 6 r-x = 101 in binary = 5 r-- = 100 in binary = 4 --- = 000 in binary = 0 example:
--rwxr-xr-- 1 me me 1097374 Sep 26 18:48 file
In above list first one is the file and second one is directory so it
indicate as “drwxr-xr--”.
|777||(rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally |
not a desirable setting.
|755||(rwxr-xr-x) The file's owner may read, write, and execute the file. All others |
may read and execute the file. This setting is common for programs
that are used by all users.
|700||(rwx------) The file's owner may read, write, and execute the file. Nobody |
else has any rights. This setting is useful for programs that only
the owner may use and must be kept private from others.
|666||(rw-rw-rw-) All users may read and write the file.|
|644||(rw-r--r--) The owner may read and write a file, while all others may only |
read the file. A common setting for data files that everybody may
read, but only the owner may change.
|600||(rw-------) The owner may read and write a file. All others have no rights. A |
common setting for data files that the owner wants to keep
|777||(rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new |
files in the directory and delete files in the directory.
Generally not a good setting.
|755||(rwxr-xr-x) The directory owner has full access. All others may list the |
directory, but cannot create files nor delete them. This setting
is common for directories that you wish to share with other users.
|700||(rwx------) The directory owner has full access. Nobody else has any rights. |
This setting is useful for directories that only the owner may use
and must be kept private from others.
SU Command - temporarily become the superuser.
to the superuser's privileges. This program is called su (short for substitute user) and can be used in those cases when you need to be the superuser for a small number of tasks. To become the superuser, simply type the su command. You will be prompted for the superuser's password:
superuser session, type exit and you will return to your previous session.
me@linux:~$ continue with commands as root user
chown - change file ownership.
command as follows
root@linux#chown you some_file
superuser. To do this, our example employed the su command, then we
executed chown, and finally we typed exit to return to our previous
session. chown works the same way on directories as it does on files.
Chgrp - change a files and directories group ownership.