0% found this document useful (0 votes)
97 views13 pages

04 1 Linux

The document provides an introduction to Linux operating systems, explaining that Linux allows multiple users to be logged into a system simultaneously running multiple programs. It describes how the Linux kernel keeps each process and user separate and regulates access to system hardware and resources for each. Finally, it covers the Linux file system structure using directories, files, and inodes to store metadata for access permissions of users, groups, and other permissions settings.

Uploaded by

andenet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views13 pages

04 1 Linux

The document provides an introduction to Linux operating systems, explaining that Linux allows multiple users to be logged into a system simultaneously running multiple programs. It describes how the Linux kernel keeps each process and user separate and regulates access to system hardware and resources for each. Finally, it covers the Linux file system structure using directories, files, and inodes to store metadata for access permissions of users, groups, and other permissions settings.

Uploaded by

andenet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Introduction to Linux

UNIX
You can have many users:
logged into a system simultaneously,
each running many programs.

It's the kernel's job to keep:


each process and user separate and
to regulate access to system hardware, including
CPU,
memory,
disk
and other I/O devices.
Introduction to Linux

Directories, Files and Inodes


• Every directory and file is listed in its parent directory.
• In the case of the root directory, that parent is itself.
• A directory is a file that contains a table listing the:
– files contained within it, giving file names to the inode numbers in the list.

• The information about all the files and directories is maintained in


INODE TABLE
• An Inode (Index Nodes) is an entry in the table containing
information about a file (metadata) including file permissions, UID,
GID, size, timestamp, pointers to files data blocks on the disk etc.
Introduction to Linux
Users, Groups and Access
Permissions
In UNIX/LINUX, there is a concept of user and an
associated group

The system determines whether or not a user or group


can access a file or program based on the permissions
assigned to them.

Apart from all the users, there is a special user called


Super User or the root which has permission to access
any file and directory
Introduction to Linux

Access Permissions
There are three permissions for any file, directory or
application program.

The following lists the symbols used to denote each,


along with a brief description:

r — Indicates that a given category of user can read a


file.

w — Indicates that a given category of user can write to


a file.

x — Indicates that a given category of user can execute


the file.
Introduction to Linux

Access Permissions
Each of the three permissions are assigned to three
defined categories of users.
The categories are:

owner — The owner of the file or


application.
group — The group that owns the file or
application.
others — All users with access to the
system.
Introduction to Linux

Access Permissions
One can easily view the permissions for a file by invoking a
long format listing using the command
ls -l

For instance, if the user Ali creates an executable file


named test, the output of the command ls -l test would
look like this:

-rwxrwxr-x 1 Ali student 0 Sep 26 12:25 test


Introduction to Linux

Access Permissions

The permissions for this file are listed at the start of the
line, starting with rwx.

This first set of symbols define owner access.

The next set of rwx symbols define group access

The last set of symbols defining access permitted for


all other users.
Introduction to Linux

Access Permissions
This listing indicates that the file is readable, writable,
and executable by the user who owns the file (user Ali)
as well as the group owning the file (which is a group
named student).

The file is also world-readable and world-executable,


but not world-writable.
Introduction to Linux

Listing the Content of a Directory

ls is used to list the contents of a directory.

If the command ls is written with parameter –l then


the command lists contents of the working directory
with details. Example:

$ ls –l
File permissions

There are two ways to set permissions when


using the chmod command:
Symbolic mode:
testfile has permissions of -r--r--r--
U G O*
$ chmod g+x testfile ==> -r--r-xr--
$ chmod u+wx testfile ==> -rwxr-xr--
$ chmod ug-x testfile ==> -rw--r--r--
U=user, G=group, O=other (world)
File permissions cont.

Absolute mode:
We use octal (base eight) values represented like this:
Letter Permission Value
R read 4
W write 2
X execute 1
- none 0

For each column, User, Group or Other you can set


values from 0 to 7. Here is what each means:
0= --- 1= --x 2= -w- 3= -wx
4= r-- 5= r-x 6= rw- 7= rwx
File permissions cont.

Numeric mode cont:


Example index.html file with typical permission values:
$ chmod 755 index.html
$ ls -l index.html
-rwxr-xr-x 1 root wheel 0 May 24 06:20 index.html

$ chmod 644 index.html


$ ls -l index.html
-rw-r--r-- 1 root wheel 0 May 24 06:20 index.html
Set-user-ID
Set-user-ID(“suid”or“setuid”)bit
–  On executable files, causes the program to run as
file owner regardless of who runs it
–  Ignored for everything else
Set-user-ID
–  In 10-character display, replaces the 4th character
(x or -) with s (or S if not also executable)
-rws r-x r-x: setuid, executable by all
-rwx r-x r-x: executable by all, but not setuid
-rwS r-- r--: setuid, but not executable - not useful

You might also like