Weather            Българска версия   English version



IT news, IT boards, IT articles, IT reviews

 

Find now - documents, manuals, facts, realized and shared business ideas:




Linux for beginners    ( non-edited article - click here for published articles )



Introduction to Linux. Emergence of Linux. History of Linux. Basic distributions. Basic concepts in the Linux kernel, user, root. Principles of free software. GPL license terms



Linux as is understood in most cases when talking about it, is an operating system. The operating system is a short program that manages your computer and its devices. It also helps to communicate with him - ask him commands and receive results on a monitor or other external device. Linux is created based on another very popular in the past operating system - UNIX. UNIX was created in 1969 in the far at Bell Laboratories as a successor of another multi-user operating system - Multics. At that time, UNIX was a unique operating system. Entirely written in C, UNIX was easily portable across platforms, unlike other operating systems at the time, which were written in assembly language. It is this portability has been the engine of UNIX and occurred after a clone. Moreover, UNIX was different in another respect - it is built from many small and fast programs that interact with each other by scripts. This approach keeps still and is different from the approach taken by Windows - multi-purpose, large and heavy programs.
Liniks stems from MINIX - one of many clones of UNIX. MINIX was also a free operating system and its creator Andrew S. Tanenbaum has also provided its code. Just based on that code in 1991 was created the first Linux kernel by the student Linus Torvalds. Versions of this kernel can still be found for free download at http://www.kernel.org/pub/linux/kernel/Historic.
The main difference between Linux and Windows is the principle of open source, based on a Linux kernel is developed. Software that is distributed with open source comply with the rules defined in the Open Source license.
The first requirement of the OSD (Open Source Definition - Definition of open source) is that every open source package should be distributed freely, as this does not preclude its sale.
The second requirement is that apart from the program, you must give the source code of this program. This is based and the open source model for improvement and development of software. Receiving thousands of source code programmers can work over this program to fix bugs and add new functionality.
The third requirement is the modified source code be distributed in the same manner as the original.
The fourth requirement is that a program compiled from modified source code be distributed under the same name and version number as the original.
This basic requirements of open source. The full text can be found at http://opensource.org/docs/definition.php. Overall, the basic idea is the free dissemination and development of software.
Latter which will tell the history of Linux and open source is the history of GNU society. The very name means GNU 'GNU's Not UNIX' or translated 'GNU is not UNIX'.
GNU e announced by Richard Stalman at the end of September, 1983 with the idea to create UNIX - like operating system that can be distributed freely. Factual GNU project officially started in January 1984.
Until then, the distribution of free software has happened without any licenses, which allow many companies to use free software to make commercial products. Precisely this was the reason to think a new license, which would prevent closures and commercialization of products.
This is the so-called GNU General Public License (GPL) license that requires any modification of GPL software to be released under this License. This ensures that free software development and what not stand, will remain free.
GPL license is one of several license applied for distribution of free software. Others are used more often and Artistic License BSD License. Common between them is as follows:
Software can be installed on an unlimited number of computers.
The number of people using the software is also limited.
Software can be copied indefinitely (free or open redistribution).
There are no restrictions on modifying the software, except for retention of the basic functionality for which it was created.
There is no restriction on the dissemination, even selling software.

After the history of Linux and open source, let's clarify what is meant by the operating system. Operating system is called a program that manages your computer and its peripheral devices such as mouse, keyboard, printer, etc.. The operating system also takes care of allocation of resources between programs and users.
In most cases, the average user can not do anything with just the operating system. For it to work with her for additional programs, called application software, or simply applications.
On Windows and DOS of these applications come with the operating system, but Linux is not so. This is because only Likuks core operating system. It can manage devices and tasks, but in itself it is absolutely unusable.
That is what Linux distributions exist which contain in themselves as the core operating system and application software. Each distribution comes with a base set of the necessary programs, they are identical in most Linux distributions. Moreover, many Linux distributions come with a huge range of applications, including browsers, word processors, office suites, development environments for applications, a set of graphical interfaces, etc. Now I will know some of the more popular Linux distributions:

Debian:
Debian is a unique distribution different from others in that it is dependent on donations. It is suitable for experienced users and is one of the largest (CD purposes 7). Another feature in Debian is the method of management packages (such programs before they are installed). Debian package management system is so advanced that it can be installed by two disks and stable Internet connection.

Red Hat:
Red Hat is one of the most common distributions. Its installation is easy and is especially suitable for beginners users. Red Hat is the first commercial distribution. Simultaneously with the purchase of Red Hat users and receives support hours. Advantage of Red Hat is that it is supported by most manufacturers of software for Linux. Recently, however, Red Hat discontinued support free download and no server versions. For residential customers the company launched another distribution called Fedora.

SUSE:
This is a German distribution that is fully localized in German (it does not mean it can not be used in other languages, incl. And Bulgarian). Installation is simple and suitable for beginners. SUSE e Overall a very good distribution. This year, SUSE was bought by the Novel and now the future of this distribution is not very clear.
Slackware:
Slackware is mostly preferred by more advanced Linux users who want to have maximum control over everything, and it will become easier and faster. Under the 'easy' and 'faster' but in Slackware means manually modify the number of configuration files. This makes the distribution is not particularly suitable for beginners, although its stability and security. Moreover idenistvenata Slackware distribution is listed, which has no built-in tool upgrades.

Mandrake:
Mandrake e French distribution based on Red Hat. She possesses an elementary tool for installation, which among other things can work in Bulgarian. Mandrake is generally characterized by ease of administration and convenient user interface. Of these, it is most suitable for beginners.

Although each of the distributions have different target audiences, each of them is based on the Linux kernel. Like any program of core developers is constantly adding something new or improve existing functions. This requires a rigorous and well-defined version numbers of the nuclei. Principle of numbers is as follows: each number is composed of three digits. The first of these changes very rarely, only in principle, different nuclei. It now has only once - in the transition from version 1 to version 2. Is not expected soon switch to version 3. Second number is changed in significant changes in the current kernel. For the stable distribution of nuclei, it is always even, and for unstable (testing kernels) - odd. The latter figure indicates little change in the core. We developed two solid versions of the kernel - the older 2.4.h and modern 2.6.h. Latest versions at the time of writing are 2.4.24 and 2.6.3.
Every Linux kernel is multi-user and multi-tasking. This means that at the same time a Linux machine can run multiple processes from multiple users simultaneously, without affecting in any way the implementation of programs. Since Linux is truly multi-tasking kernel, then run each program in its own area of memory and eventually crash it does not cause a collapse in the operating system.

Introduction to the system. Mnogopotrebitelnost and multitasking operating system. The file system structure and performance of physical and logical devices - directory / dev. Boot


As noted in the previous lecture, Linux is a multiuser and multi-tasking operating system. As multi-tasking Linux operating system at any time from their work supports several active programs in memory.
Most important, while mandatory program is the core (kernel). It deals with managing hardware, memory, allocate resources between ordinary desktop programs, manage network traffic, file system and adds a bunch of important neshta.Ostanalite actively working programs are called processes (process).
Processes can convey information to one another in several ways, most important of which is a communication network (networking). Like telephone conversations between people, each process may try to connect to another process running on syshtiya or remote computer. If the other process 'pick up the phone' (accept TCP connection), began exchanging information.
If your computer has one processor, at any time can run more than one process (or kernel). But the core, using features of both hardware switches active processes that create the illusion of simultaneous operation of all running processes. This new kernel 2.6 introduced the concept of priority multitasking (preemptible). In previous versions, the kernel could not be interrupted during the operation. On Linux 2.6 kernel in most cases can be interrupted during the task, so that other applications can continue their work even if something works for a very low level.
In addition to multi-tasking Linux is a multiuser operating system. It can contain a set of users who identify with it through a username and password. Each user has its own directory, which can keep their files (including configuration files for different programs), this directory is inaccessible to other users. Every Linux system has one svrahpotrebitel called root. It administers the system and has full rights over it. This svrahpotrebitel is created when installing the distribution, and then it creates other users.
All this information (and many others) are kept on the hard disk. File system, generally speaking, is called a set of files structured in some way and stored on a memory store.
One of the main advantages of Linux that supports multiple file systems. This makes it particularly flexible in coexistence with other operating systems. Linux without a problem and supports ext ext2, msdos, ntfs and vfat, xia, minix, umsdos, iso9660, ufs, proc, sysv, ncp, smb, affs, hpfs, raiserfs and others.
Linux, and UNIXTM not use identifiers (eg C: \ or D: \) devices for different file systems, and organize everything into a single hierarchical tree structure. Each new file system, which should be available for Linux are added to this tree structure as its sub-tree. The place where the join (installation) add file system is called the mount point and must exist in the file system on Linux.
Each hard drive must be divided into partitions, each partition is formatted with a filesystem. Under Linux these shares are not visible until they are installed. Shares in Linux are named differently from shares in Windows. The following table shows just how different is named disks in your computer:

IDE0
IDE1
master
hda
hdc
slave
hdb
hdd

Shares of the respective discs are numbered with the name of the disk followed by the number of shares. The numbers of units starts from 1 to 4 for primary partitions and from 5 to logical. For example the first partition on master disk hooked on the first IDE channel (IDE0) is hda1.
File system can be viewed in two aspects. At a high level file system means the location of files and directories under one hierarchy, and low-level formatting is the way the block device. Here we will examine only the file system level, as is usually low in the interests of a narrow circle of specialists.
A typical organization of the directories in a Linux system is as follows:
/
| - Bin
| - Boot
| - Dev
| - Etc
| - Home
| '- Dino
| - Lib
| - Lost + found
| - Mnt
| | - Cdrom
| | - Fat
| '- Floppy
| - Proc
| - Root
| - Sbin
| - Tmp
| - Usr
| | - X11R6
| | - Bin
| | - Doc

| | - Etc
| | - Games
| | - Include
| | - Lib
| | - Local
| | | - Bin
| | | - Doc
| | | - Etc
| | | - Games
| | | - Lib
| | | - Man
| | | - Sbin
| | '- Src
| | - Man
| | - Sbin
| | - Src
| | | - Linux -> linux-2.2.15-5
| | | - Linux-2.2.15-5
| | - Tmp
| - Var


Depending on the specific Linux distribution the upper body can more or less be distinguished. Installation of different file systems can become as automatic loading system and manually with the command mount. Some distros even have a program that monitors the attachment of new devices and install them automatically. This program is called automounter and running continuously. Such programs that are running continuously and monitor events that react are called demons.
As you probably noticed with the devices under Linux are working a little differently than in Windows. Here each device is a file from the filesystem. These hda, hdb, etc. are actually files in the directory / dev. In this directory is located and other devices such as sound cards (/ dev / dsp), network card (/ dev/eth0 etc.), USB devices etc. This scheme is extremely flexible, since the operations of reading and recording devices are restricted in the operations of reading and writing files (simple words). Any device can be either a block device or character device. Each file that indicates a device has two numbers - major and minor. For example, a SCSI device / dev/sda2 (the second part of the first detected SCSI disk), receives major number 8, which is common to all SCSI devices and minor number 2, which indicates the second partition on the disk. Various types of equipment distributed to primary and secondary numbers differently, so can not determine with certainty exactly how many devices can have one Linux system. In 2.4.h nuclei to restriction of primary and secondary numbers is 255 and in modern systems is sometimes insufficient. These limits have been raised with the new kernel 2.6.h - 4096 major facilities and over a million minor.
Key components are:
/ dev / hdx (y) - devices attached to the IDE controller on the motherboard. It may be hard disks, CD / DVD drives etc.
/ dev / sdx (y) - SCSI devices attached to the konproler. may be hard disks, CD / DVD drives etc. Sometimes USB drives and CD / DVD drives emulate SCSI, to work.
/ dev / tty (x) - these are the terminals of Linux.
/ dev / ttyS (x) - serial devices. Eg / dev/ttyS0 is COM1 under DOS / Windows.
/ dev / null - a special device which can not be read. Its purpose is unnecessary information to be routed to it because it does not lead anywhere.
/ dev / zero - a device to read from which users can fill a file with zeros.

As noted above, the launch of the launch begins Linux kernel. This is because a small part of it stored in a special location on disk media. This part alone can not manage the computer, but she knows where to look to full load core. Once loaded, the kernel started checking different hardware devices on your computer and assign certain parameters of these devices. When finished checking the hardware, the Linux kernel passes control to a special program called init. At this point it starts loading the start-up scripts, where of course in what mode the system starts (graphical, console, or multi ednopotrebitelski) and the necessary programs for the normal operation of the operating system. At this stage, run and service the system, which may have different types of server daemon for remote control, etc. At the end of init boot loader login, which invites users to enter a username or password. If graphic mode is set, instead of being charged login program xdm (X Display Manager), which launched a graphic server and desktop environments.

Description of the directories and their function. File types. Bits of files for rights, tips Rights. Set and withdrawal rights.
Each operating system has a directory structure and each
directory has a function. In Linux there are two types of directories:
system and user. Systems are those directories that are
created when you install the operating system. Such
eg directors / dev, / bin, / lib, etc. User is
directories that are created by consumers operating
system in order to protect proprietary information in them. These are
directory / home / student and all subdirectories inside it.
The main system directories are:


* / Bin - contains
main programs of the operating system without which it would not
functioned properly. Most programs of this directory can
performed by all users. It is present in the path of
default for all users.
* / Boot --
contains the core operating system and other files
necessary for the proper functioning of the heart.
* / Dev - contains
responsible for the files on your computer hardware devices.
Files in this directory are only readable by
consumers.
* / Etc - contains
global configuration files and operating system
its programs. Some programs may keep the configuration
files and other places.
* / Home --
contains the home directories of users. Here each
user creates a separate directory which can be
store configuration files or documents of various types.
Specific in these directories is a way of distinguishing the
configuration files and subdirectories from the common, namely
by adding an item to the initiation. Most file managers
hidden file or directory that begins with the point.
* / Lib --
directory contains the most important shared libraries
operating system - glibc-solibs. These libraries are
called shared (shared object), because most of them programs
used in his performance.
* / Lib / modules --
also very important directory. This store kernel modules,
ie drivers of the operating system. Tuy each Linux
system may have more than one core, it is in this directory
create subdirectories with the number of each installed kernel.
* / Mnt --
Optional system directory. It is automatically created
its objective is the unification of all installed components of an
place. Linux does not limit you to mount devices in other
directories.
* / Opt - here
Most distributions install desktop environments like KDE and GNOME.
* / Proc - this is
special directory in which no actual files. Through this
directory you have access to different parameters of the nucleus and
to other information provided directly by the kernel of the operating
system.
* / Root --
svrahpotrebitelya home directory. For the average user
This directory is locked and he has no access to files in
it.
* / Sbin - important
System directory with many management programs
operating and file system. This directory is not included in
default path of normal users. All programs
want this directory root privileges to operate.
* / Tmp --
directory in which recorded programs temporary files. It has
unlimited access for all users. It may, however, has
subdirectories created by programs that are inaccessible to
ordinary users.
* / Usr --
directory with many subdirectories. This kept most
installed programs, and other auxiliary information.
* / Usr/X11R6, / usr/X11
- In this directory to keep files on server, graphic,
His fonts and its libraries.
* / Usr / bin --
contains the binary files of installed programs that are not
important for the normal functioning of the operating system.
* / Usr / doc --
part of the documentation of the programs. This store Linux-HOWTO.
* / Usr / include --
This directory is only required if you install programs
source code. You keep C header files installed
libraries and programs that are needed to install other
programs.
* / Usr / info --
part of the documentation for Linux. Access to it is through
special program - info.
* / Usr / local --
directory where the default installed programs
compiled from source. This copies the directory structure
/ usr.
* / Usr / man --
The largest part of Linux documentation. This store
Manual (manual page) for almost all the installed programs.
Access to this information is done with the program man.
* / Usr / lib --
important directory in which to store more installed
libraries. These libraries are not required to run the
operating system and the work of additional installed
software.
* / Usr / share --
also an important directory. This program installs files
necessary for their proper operation.
* / Usr / src - c
this directory is kept the source code of Linux kernel. It is
needed only when the kernel is precompiled. And here, like
/ lib / modules code can have more than one nucleus. They are
stored in directories with different version number. Into
directory / usr / src attend and link linux, which points to a
directory containing the source code.
* / Var --
system directory contains mostly logs and programs
system and a tail with deferred or upcoming tasks
automatic execution. Directory also contains other information such
Letters arrived, a process locking files and sockets of
running programs.



In most directories typical user has rights to read but not write. Some
directories (such as directory / root and some directories with logs)
average user has no rights. Typical user is
full rights over only the files in its directory and
over their own rights in / tmp directory. This organization
significantly hampered the installation of malicious programs (eg
viruses), as they will only have access to files
consumer who does them.

So far, repeatedly mentioned the concept of consumer rights and will now clarify what this is
right of consumers to perform an action, the types of rights and
how to ask. In every Linux system has several
users organized into groups. Each file can specify three types of
rights to the user, group and three for three for all others. These
rights:


* Have read (r)
* Writable (w)
* And the law
Implementation (x)


Here's what was said in tabular form:

Owner -> rwx
Group -> rwx
All other -> rwx

Rights of each file can be viewed with the command ls-l.
Here is an example of its output:

# ls-l
drwx ------ 40 dino users
1024 Sep 8 14:51. Drwxr-xr-x 7 root root
1024 Aug 18 19:23 ..- rw-r - r - 1 dino users
30 Sep 8 18:17 sample.txtdrwxr-xr-x 2 dino users
1024 Sep 8 18:19 sample
Here the files that start with d are actually directories, and is the only true sample.txt file. In this example, the file has sample.txt
following rights:


* Owner of the file is
dino and he can both read and write to it. It should
be noted that the group belongs to which a file can not
coincides with the group of file owner.
* Group file is
All users in this group can read the file.
* All others may
To read this file.


If you look at the directory, we find that they have a flag for the implementation (execution). Here
However, this flag has another meaning, namely - the right to search
(search). If a user has no such right, he can not
opens the directory, but still access the files in it. To
can read a file in this case, it is necessary
user to know the file name and full path.
In addition to these rights may file has another flag - SUID and GUID. File such flags are
executes with the privileges of the user or with the privileges of
group that performs file. These flags are considered very
dangerous and their use should be restricted.
Commands that change the owner and / or file group and its rights were
chown and chmod. If you must change the rights of
sample.txt, so as to fulfill all, it should be
write the following:
# chmod + x. / sample.txt
The syntax of the command
very simple: + includes a - off a flag. By r, w and x
specifies which flag should be changed.

Thus changing
a right globally. And if you need to change only
owner or group, for example? In this case, the sign + or --
postyava be an option whose rights need to be changed, as the options are
following:


* U - owner (user)
* G - group (group)
* O - others (others)
* A - all (all), this is the default option.



Here is an example for the removal of the right to file for execution by all other users.
# chmod o-x. / sample.txt
Command allows free combination of options, for example:
# chmod u + rwx. / sample.txt
Let us again consider the rights of one file, which included the flag will put edenitsa and where off - 0.
# ls
-l. / sample.txt
-rwxr-xr --
1 dino users 30 Sep 8 18:45 sample.txt

Owner -> r w x -> 1 1 1
Group -> r w x -> 1 0 1
All other -> r w x -> 1 0 0

Now let us consider this sequence of zeros and edenitsi as three binary --
111, 101 and 100:

Owner -> r w x -> 1 1 1 -> 7
Group -> r w x -> 1 0 1 -> 5
All other -> rwx -> 1 0 0 -> 1

Binary arithmetic shows that the numbers are 7, 5 and 4. The reason for all this is that the original
syntax of the command chmod e (on UNIX):
# chmod 744. / sample.txt
This will set the file rights to the table in the table below:
All other Group Owner
r w x r w x r w x
1 1 1 1 0 1 1 0 0
111 101 100
7 4 1
This syntax is more complex, many
more flexible than the typical Linux style. This method is possible
change of all rights simultaneously, something that can not be
achieved in the first way. Method of formation of Rights is as follows:


* 4 - Reading
* 2 - Record
* 1 - performance / search


Once this is sufficient to collect
corresponding figures for the corresponding rights. For example, that reading and
record is given by summing 4 +2 = 6.
In addition to changing the rights, sometimes
need to be changed and the owner or file group. This is
with the command chown.

# chown gosho. / sample.txt
# ls-l. / sample.txt
-rwxr-xr - 1 gosho users 30 Sep 8 18:55 sample.txt
After this change the user dino
no longer owns the file and therefore can not recover its
property. This can be done either gosho or root.

Changing the group going through
command chgrp:

# chgrp root. / sample.txt
# ls-l. / sample.txt
-rwxr-xr - 1 gosho root 30 Sep 8 19:02 sample.txt

Besides the change and chgrp
the group may also be a chown. In this case, the owner and
group changed both:


# chown dino: users. / sample.txt
# ls-l. / sample.txt
-rwxr-xr - 1 dino users 30 Sep 8 19:02 sample.txt

Types of users. Administrator (root) and a normal user. Files with passwords. Hide passwords. Commands for creating and deleting users and groups

Access to any Linux system is through a user account established by the system administrator. This means that each user is assigned a user name for identification, password, and its own directory to set permissions on the system. All this is done through the Administrator account called root.
Root user is created automatically during the installation of the distribution. This user is called svrahpotrebitel (Superuser), because there's nothing that users can not do. Before this user has no prohibitions or restrictions, so work with it is very convenient, but equally dangerous. Because of the importance of the user changes the usual command interpreter prompt the command line.
It is important to note that the name of the user is not necessarily the root, but this is the default name.
Furthermore superpotrebitelya every Linux system can have user accounts. Each account has its own directory tree in the operating system (exceptions are certain system accounts). It's called home (home) directory and the consumer always comes into it after his entrance. Directory is specified when creating the user and the default is: / home / ime_na_potrebitelia.
Typically, the user has full rights to this directory, but it is not mandatory. Example, can limit user rights to certain files in that directory. Classic example is the restriction of rights on the file profile, which is performed after inclusion of users in the system.
All information about users is stored in the file / etc / passwd. This is a simple text file whose owner is superpotrebitelya. Only he can edit its content, and other users have read-only rights. Lines in this file have a strict format:
username: password: userID: groupID: comment: home_directory: login_comm

Let's look at an example file:

root: x: 0:0:: / root: / bin / bash
bin: x: 1:1: bin: / bin:
daemon: x: 2:2: daemon: / sbin:
adm: x: 3:4: adm: / var / log:
lp: x: 4:7: lp: / var / spool / lpd:
sync: x: 5:0: sync: / sbin: / bin / sync
shutdown: x: 6:0: shutdown: / sbin: / sbin / shutdown
halt: x: 7:0: halt: / sbin: / sbin / halt
mail: x: 8:12: mail: /:
news: x: 9:13: news: / usr / lib / news:
uucp: x: 10:14: uucp: / var / spool / uucppublic:
operator: x: 11:0: operator: / root: / bin / bash
games: x: 12:100: games: / usr / games:
ftp:x:14:50::/home/ftp:
smmsp: x: 25:25: smmsp: / var / spool / clientmqueue:
mysql: x: 27:27: MySQL: / var / lib / mysql: / bin / bash
rpc: x: 32:32: RPC portmap user: /: / bin / false
gdm: x: 42:42: GDM: / var / state / gdm: / bin / bash
pop: x: 90:90 OP: /:
nobody: x: 99:99: nobody: /:
sshd: x: 33:33: sshd: /:
dino: x: 1000:100: Dinko ,,,:/ home / dino: / bin / bash
www: x: 1001:102 :,,,:/ home / www: / bin / bash
ffsearch: x: 1002:103:: / home / ffsearch:
stinger: x: 1003:100 :,,,:/ home / stinger: / bin / rzsh
postfix: x: 1004:100:: / home / postfix:

Each line of this file is composed of seven fields separated by colons. If nothing is introduced between two colons field remains empty, but the colons must exist. Here is an explanation of the seven fields:
username - unique username
password - password of the user in an encrypted version
userID (UID) - unique number that identifies the user to the system
groupID (GID) - a unique number that defines the group of users
comment - comment (can be the actual name of the user, etc.)
home_directory - this is the directory where the user falls after its incorporation
login_comm - this is the command to be executed after the user login. Most often this is a shell command.

It should be noted that this structure is the same file, not only for Linux, but UNIX-based operating systems.
As was said above, the operating system saves the password in the second field. Most modern versions do not use this approach because of security problems. They keep your passwords in another file called shadow password fail, which is located in / etc / shadow. When passwords are stored in this file contains the password box x. Here's how it look like shadow file:
root: $ 1 $ EnI1gPEs $ LwH91OIgMRGwPcdqlleU21: 12209:0 :::::
bin: *: 9797:0 :::::
daemon: *: 9797:0 :::::
adm: *: 9797:0 :::::
lp: *: 9797:0 :::::
sync: *: 9797:0 :::::
shutdown: *: 9797:0 :::::
halt: *: 9797:0 :::::
mail: *: 9797:0 :::::
news: *: 9797:0 :::::
uucp: *: 9797:0 :::::
operator: *: 9797:0 :::::
games: *: 9797:0 :::::
ftp: *: 9797:0 :::::
smmsp: *: 9797:0 :::::
mysql: *: 9797:0 :::::
rpc: *: 9797:0 :::::
gdm: *: 9797:0 :::::
pop: *: 9797:0 :::::
nobody: *: 9797:0 :::::
sshd: *: 9797:0 :::::
dino: $ 1 $ Vd11bYBs $ 3NV2tT0FK48OR/CYGM/rD0: 12209:0:99999:7:::
www: $ 1 $ m4as.9uy $ sOJvGN/fJKeSItUDNxl3e0: 12215:0:99999:7:::
ffsearch:!: 12313:0:99999:7:::
stinger: $ 1 $ u8M/xs7r $ YgtlAmXbGsppdUNk6/onw /: 12400:0:99999:7:::
postfix:!: 12411:0:99999:7:::

When the user enters his password, the program makes a simple login check and compares the two passwords. If they match the user is allowed to the system, otherwise it is denied access.
Although conversion to its encrypted password option is a short-term operation, the reverse operation takes a long time. The password field can be used to restrict access. This is done by introducing a site * encrypted password. This is to nobody as user names or lp. Conversely, if this field is left blank, then a user can be incorporated into the system without a password.
Each user has an associated unique number (UID), as its operating system through identifikatsira user. Most UNIX ™ systems use IDs from 0 to 99 for specific UID, but the numbers from 100 up to consumers. Slackware uses a different scheme, namely - the numbers from 1000 up to use for consumers.
Both sample file has a dozen user names created automatically by the operating system. The purpose of the more important of them:
Superpotrebitelya user is root (UID 0)
demon is used for system processes. Only used to have certain processes and to establish their rights properly.
bin is the owner of the binaries
adm holds log files and log
uucp UUCP is used for communication

Most of them have an asterisk in the password box, which prohibits their use for login.
All users are organized into groups. Each group of similar usernames has a unique identification number (GID). It represents the unification of multiple users for any reason. For example, in one group may be people from one department, on the other - your friends or clients. So it is easier to organize the rights to certain files or other devices. Each user can belong to several groups, but at some point he was a member of only one of them. This is related to access rights, since Linux can join only one user ID group.
Information on groups is contained in the file / etc / group, which has the following form:
root:: 0: root
bin:: 1: root, bin, daemon
daemon:: 2: root, bin, daemon
sys:: 3: root, bin, adm
adm:: 4: root, adm, daemon
tty:: 5:
disk:: 6: root, adm
lp:: 7: lp
mem:: 8:
kmem:: 9:
wheel:: 10: root
floppy:: 11: root
mail:: 12: mail
news:: 13: news
uucp:: 14: uucp
man:: 15:
games:: 20:
slocate: x: 21:
smmsp:: 25: smmsp
mysql:: 27:
rpc: x: 32:
gdm:: 42:
ftp::50:
pop:: 90: pop
nobody:: 98: nobody
nogroup:: 99:
users:: 100: nobody
console: x: 101:
sshd:: 33: sshd
www: x: 102: dino, www
ffsearch: x: 103: www
utmp:: 22:
shadow:: 43:
postdrop: x: 104:

File format is as follows:

ime_na_grupata: password: GID: spisak_s_potrebiteli

The band name is a unique symbolic name
Group password must be entered by the user if he wants to join her. Not all distributions use this field.
GID is a unique group identifier
User list contains all users who belong to this group

Every Linux system has several system groups - these are bin, mail, uucp, sys and others. Assignment of users to these groups is a bad idea as this will cause excessive granting of rights to these users.
Each Linux distribution has built programs to add, remove and modify users. The simplest way is to manually edit passwd file. However, this can cause unpredictable situations if an error. In this case the password field is always left blank, a password is then added. The manual change of passwd and group can use the commands accordingly vipw and vigr. They call a special version of the editor vi, which monitors changes in files to be made so as not to damage reaches of the files. It is also possible to use the command adduser or useradd (to add users), userdel (to remove the users) and usermod (to change details of the user).
Most distributions have and programs for handling groups. These are groupadd, groupdel and groupmod. Command shows the groups to which groups a user belongs.
In a well-configured Linux system should not work with root user. In some cases, however, require its use. Logical way user to log off and then came on as root (if it has its password, of course). This approach is not very convenient, so there is an alternative to it. This is by using the command su. Call her at no additional parameters, it tries to switch to root user (of course you will need to enter his password). Apart from this implicit method uses the command allows switching to any existing user:
# su dino
$

Henceforth superpotrebitelya work with the privileges of the user dino. In this case the password is not required, but when the viewer wants to switch to another system always requires a password. Exit from this mode is by pressing Ctrl + D or via the command exit.

Description of the command interpreter. Types of command interpreters

In this lecture we will examine some basic terminology terms that underlie all Linux and UNIX ™ system.
The first of these is the concept of console. This is a historical term that stands behind a long history of computer in general. Early in the console terminal is aware of that has stood the administrator of the machine and which system messages are going out. Broadly speaking, the console is a text output device, which set off the system messages coming from the core of the operating system or program for system messages. In larger computers, console, most often been associated with serial link running standard RS-232 (serial port on your computer). In modern personal computers in the console of course computer monitor. In Linux there is a virtual console concept, which are six terminal window, which can be switched with Alt + F1 to F6. It should be noted that persistent messages out of the first virtual console even if nobody is logged into it. A typical example of this system are the kernel messages that appear when launching the system.
Another important concept was terminal. Terminal with a device (usually hardware) to allow communication with the computer. In principle, the terminal is a combination of monitor and keyboard. This does not, however, when talking about a remote terminal. Remote terminal is a special program consisting of client and server through which users can connect remotely to a computer which has a valid username and password. For a start you should know that the most frequently used programs are telnet and ssh.
In general, the terminal is what stands between the user and the shell (command interpreter). Shell is called using the program on which the system communicates with the consumer. She read the lines introduced by the terminal and perform different operations depending on what is entered. Then, shell tries to convert input structures in the instructions that the kernel is able to understand.
Each user in their logical inclusion in the system starts its copy of the shell in memory. This is to be able to operate without interfering other users of the system.
Shelah seen everything until the first interval as command, but everything else as an argument to this command, and arguments are also separated by spaces.
All (or most) Linux systems have more than one valid shell. They are described in the file / etc / shells. It has the following simple form:

/ bin / bash
/ bin / tcsh
/ bin / csh
/ bin / ash
/ bin / ksh
/ bin / zsh
/ bin / rbash

Linux system can be installed over command interpreters, but they are unavailable for use if not listed in this file. Each user can change its shell by the command chsh. Without parameters the command enters interactive mode, and using option-s, this mode is excluded. Form of the command is as follows:


# chsh-s login_shell user
or just
# chsh

In some distributions, it is possible to check the valid shells by-l switch to the command chsh, but Slackware does not support this key.
Although there are many command interpreters, it is not all used. The most frequently used command interpreters are:
bash - bash command interpreter is compatible with the shell sh. It can execute commands from both the order and by file. Bash has a powerful scripting language, which can write programs operated directly by the command interpreter. Moreover, bash, and has features that are typical of other command interpreters such as ksh and csh.
csh - this is the shell that combines the typical features for a command interpreter such as the automatic completion of file names when pressing Tab, task management and maintenance history of the commands with the syntax of C.
tcsh - an enhanced version of csh, including further adjustments to the syntax and others., while retaining full compatibility with the original csh. Most distros create a symbolic link csh, pointing to tsch.
ksh - KornShell e command interpreter that supports its own programming language and allows the execution of the command as command line and from the file.
zsh - improved version of ksh. Owns many advantages over him, and features built-in syntax checking. Unlike the tcsh and csh, zsh, it is not fully compatible with ksh.

Most of these command interpreters (bash, ksh, zsh) create a symbolic link that starts with r and ends with the name of the shell (rbash, rksh, rzsh), which tells the command interpreter to switch to safe mode. In this mode the user is very limited, such as restrictions depend on the particular shell. The description of the restricted shells in / etc / shells is not recommended, because after moving to such a shell, the user can not return to normal for him a command interpreter.
Most used the above command interpreters is bash. He is also the default shell in Linux. Bash is an abbreviation of the Bourne Again Shell, created by the Free Software Foundation based on the Bourne shell on UNIX ™.
Each shell (environment) has its own environment variables. Their values are established by the command interpreter to run it and have different values for different users. Here is one more reason for any user to run a separate copy of the interpreter. The values of these variables can be changed in the course of work.
For example, if you do not like a dollar sign prompt enough to change the environment variable PS1.
Environment variable can be changed by the command:

$ export PS1 =%
%

for the current session or by changing the file. bash_profile or just. profile, in which case the change becomes active when the user is logged and is permanent. Slackware uses the file. Bash_profile to enter commands or setup bash. This file is loaded whenever the user enters the system. More important to bash options are:
-r, - restricted - tells the shell to enter restricted. In this mode, the user banned following operations: changing directories with the command cd; change the environment variable SHELL, PATH, ENV and BASH_ENV; execution of commands containing characters /; setting / as an argument to the integrated command.; Setting file containing a / as an argument to the integrated command hash; import the definitions of functions at startup, the output redirection with>,> |, <>,> and &>, run the command exec; mode off limits by the commands set + r or set + o restricted. In addition, thus the system of constraints can be incorporated through the implementation of rbash.
-rcfile file - execute commands from file instead of the standard. bashrc.

All command interpreters have multiple variables of the environment. These variables describe the different characteristics of the system. They are read by other programs that use them for setting up its internal parameters, such as interface language, location, system type, operating system version, current directory and more. Bash has a number of environment variables, the most important of which are:
BASH - specifies the full file name used to call this a copy of bash.
BASH_VESRION - shows the version of the command interpreter.
GROUPS - displays a list of groups that user is a member.
HOSTNAME - displays the name of the computer.
OSTYPE - shows what operating system is running a copy of bash
PWD - displays the current directory
RANDOM - at every call, this parameter is changed from 1 to 32,767 at random.
UID - shows the unique identification number of the user that started the copy of bash.
HISTFILE - defines and displays the file in which the executed commands are stored. The default is ~ /. Bash_history.
HISTSIZE - defines and shows the maximum amount of lines that may be contained in the file history of the commands.
HOME - defines and displays the user home directory.
LANG - defines the operating system locale for all categories. Individual categories may be different from that parameter.
LC_MESSAGES - defines the language to display various messages.
PATH - displays and defines the way in which search commands.

Reading these variables can be done with the command echo:

$ echo $ HOME
/ home / dino
$

A new record value is through the command export:

$ export HOME = / home / ftp
$ echo $ HOME
/ home / ftp
$

An important feature is that reading from the variable before it is necessary to put a dollar sign, while its change is not necessary.
In addition to environment variables, which are defined automatically by the command interpreter, almost all programs define their own environment variables.
Bash has a powerful programming language that allows scripting for system administration or other activities that is conducted can be automated. Bash script can be either a series of commands placed in a file that are executed sequentially, or a script written in the language of bash which combine external commands, variables, loops, conditions and bash internal commands. Example of a simple bash script has the following sequence of commands:

$ cat> simple_script
echo 'Building file ....'
ls-l / dev> dev_list
echo 'Number of files:'
wc-l dev_list
rm dev_list
echo 'Exiting'
Ctrl + D
$ chmod + x simple_script
$. / simple_scipt
Building file ....
Number of files:
2633 dev_list
Exiting
$

This simple series of commands are combined in a single text file called a shell script. This file must have the right to implement to enable the command interpreter to execute it. Most shell scripts are not so simple. Examples of complex scripts are commands installpkg, pkgtool etc., which serve to add, remove, or update the programs under Slackware. Through the use of commands and dialog kdialog of shell scripts can be made accordingly and graphical interface for KDE, and a text console. An example of this script is pkgtool and netconfig.
Writing shell scripts is one of the hardest aspects of Linux, but their understanding could lead to full control over the system through a simple set of pre-written scripts.

Basic setup of the system. Configuration directory / etc. Directory structure. Boot scripts

Like any Linux operating system and requires adjustment after its installation. One of the largest facilities of this operating system is easily configurable via simple text files. These files are located in the directory / etc. This directory contains many files and subdirectories, such as joining a subdirectory configuration files status. For example, all scripts through which to run and stop processes, respectively, starting and stopping when the computer is located in the subdirectory rc.d. Subdirectory X11 configuration files together does the graphic server, etc. This lecture will introduce you to the most important files and subdirectories located in the config directory / etc.
Will divide the types of configuration files in five main groups: network setup, setting the shell, setting up users, setting up the modules and setting the starting and stopping the operating system.
1.NASTROYKA NETWORK
Files which adjusts the network configuration of the operating system include:
hosts - this file describes the names of the computers by connecting them with their IP addresses. Every computer can be assigned and a short name or nickname. File format is as follows:
# IP address computer name computer alias
127.0.0.1 localhost
192.168.7.102 server514.mgu.bg server514
192.168.7.103 class514pc1.mgu.bg class514-1
... ... ...
192.168.7.109 class514pc8.mgu.bg class514-8
The first line is mandatory and describes the so-called. loopback on the computer. Lines beginning with # are considered comments.
resolv.conf - use of top file is possible only for small networks or networks do not have DNS server, which translates names into IP addresses. This method can be used for hosts on the Internet where their description would be an impossible task. Therefore, the Internet need a DNS server. Resolv.conf file is used to describe sarvarute to DNS to bind to the computer to translates the name into an IP address. File format is as follows:
search mgu.bg
nameserver 217.75.128.2
nameserver 217.75.128.9
After changing it to require the execution of the command
# killall-HUP inetd
changes to take effect.
HOSTNAME - describes the computer name. It consists of a single line which takes the form:
server514.mgu.bg
host.conf - controls how it works client translates the name into an IP address. It consists of several directives. Form is as follows:
order hosts, bind
multi on
There are multi order and directives, and hosts, bind, and on, their options. Complete details of the file can be found in the man pages for Linux.
hosts.allow, hosts.deny, hosts.equiv - describe the hosts who are allowed or not to connect to your computer. Hosts.equiv file describes the trusted hosts, they are allowed to perform operations through remote commands rlogin and rsh.
inetd.conf - a file that describes which services to meet inet daemon. The difference between using it and start a normal server is such that the inet daemon not start service until it is not stated. This is useful for services that are rarely used because it is slower than standard, but to save memory. File format is as follows:
# ime_na_usluga tip_na_soketa proto. flags need. pat_kam_sarvara arg.
ftp stream tcp nowait root / usr / sbin / tcpd proftpd
talk dgram udp wait root / usr / sbin / tcpd in.talkd
Ime_na_usluga is the name of the service described in the file services, tip_na_soketa depends on the protocol and TCP is a stream dgram Protocol to UDP. Flags field is to set parameters of the inet daemon. User is specifying what field benefits the service will work. Pat_kam_sarvara is the full path to the server support service. Due to security problems, using a special wrapper called tcpd, instead of the real server. Arguments are the arguments brought on tcpd, here as a real server is assigned responsibility for a service.
./rc.d/rc.inet1 - shell script that reads the file rc.inet1.conf and adjusts the computer's IP address, IP address of the gateway and netmask. Their description is done in the file rc.inet1.conf and independent of each network card. After the changes have to be fulfilled the command:
# ./rc.inet1 stop
# ./rc.inet1 start
changes to take effect.

2.NASTROYKA the shell
Setting environment are mainly carried out by the file / etc / profile. It is loaded whenever a user enters the system. Through it you can change the global environment variable and set new ones that will come into effect when the next input. The latest version (9.1) on Slackware uses this file to load the scripts are in subdirectory profile.d. This directory contains several shell scripts that are responsible for different parts of the configuration.
lang.sh, lang.csh - this script can change the interface language of the operating system and its localization. To leave messages on the Bulgarian language is sufficient to change the variable LANG = bg_BG.CP1251. By default, this variable is en_EN.
gtk +. sh, gtk +. csh - a script that sets the parameters concerning the graphical library GTK.
kde.sh, kde.csh - script sets the environment variable used by KDE and its programs.
qt.sh, qt.csh - script which sets the parameters concerning the graphical library QT.
/ etc / shells - shows valid command interpreters.

3. SETUP OF CONSUMERS
Files that are responsible for this have already been addressed here and therefore will only be listed:
passwd - file in which to keep registered users in the system. In older versions of Linux files that are used for keeping the user passwords. passwd-is his backup.
shadow - a file in which to keep the passwords of users. shadow-e a copy.
group - a file whose contents are registered in groups operating system. group-is a copy of the file.
4. MODULE SETUP
The modules are analogous to the drivers for Windows. In Linux, there are two basic file responsible for loading and management modules. These are the files / etc / rc.d / rc.modules, which are set by the modules to be loaded whenever you start the file / etc / modules.conf which are set by the parameters of a module or modules are bound by a particular name device. The first file contains a number of commented lines, each line corresponds to a module. Following is a typical example line:
# / sbin / modprobe 8139too
If this line be removed comments operating system will try to load the module 8139too at each startup (this module is responsible for the network card with Realtek chip 8139). The second file by this module can be assigned to a specific device. For example:
alias eth0 dmfe
alias eth1 8139too
alias char-major-195 nvidia
The first line assigned to a device corresponding to the first network card modules dmfe (network cards Davicom), and the second network card module 8139too. Last line tells the operating system that char device with major number 195 complies module nvidia (module video card with a chip of Nvidia).
5. ADJUSTMENT starting and stopping the operating system
Starting and stopping the operating system is done by shell skripove located in the directory w / etc / rc.d /. Linux has seven modes that may work: single user mode, multi-mode system with a graphical environment, and restart standby mode off. They are marked with the following numbers - 1, 3, 4, 6, 0 named runlevels. Numbers 2 and 5 are not used. For each of the regimes in the directory has one shell script:
rc.0 - this is a symbolic link to rc.6. Otgovarya for runlevel 0 (System Shutdown)
rc.K - responsible for runlevel 1 (ednopotrebitelski mode)
rc.M - responsible for runlevel 3 (multiuser mode)
rc.4 - responsible for runlevel 4 (mode with a graphical environment)
rc.6 - responsible for runlevel 6 (reboot the operating system)
rc.S - not responsible for any of the arrangements since it started before them. Used for initialization of the operating system. This makes verification of correct exclusion of the operating system, start the modules, etc.
Each of these scripts run multiple programs needed for normal operation in this runlevel. By default, the system enters into runlevel 3. This can be changed by changing the file / etc / inittab.
id: 3: initdefault:
should be changed to
id: 4: initdefault:
In addition to these scripts in this directory there are several important script:
rc.local - this script is initially empty. Here the administrator can add your own commands to be executed whenever you start the operating system.
rc.inet2 - here are the scripts run on servers that are installed.
rc.inetd - in the latest version, Slackware adding this simple script that allows you to restart inetd. This happened in the old versions with the command killall-HUP inetd.
rc.sysvinit - allows automatic identification and launching of scripts for Red Hat. Since Red Hat (Mandrake, Debian, Fedora, SUSE) use Sys V type scripts and Slackware BSD style through this file to achieve interoperability.
rc.syslog - process control system called syslog. Monitor and record vaznikanlite errors and major events in the journal file specified.
rc.serial - manage serial devices, such as reading configuration file / etc / serial.conf
Other files are scripts for managing servers and installed depending on the installation.
Other important files that fall within the conditional layout:
/ etc / fstab - describes the devices as hard drives, cameras, CD-ROM, Floppy, etc.. options and their coming into force in mounting. Moreover here you can describe in st are installed automatically when loading the operating system.
/ etc / mtab - lists all installed devices. In each of the hanging and razskachane-arrester, this file is updated.
/ etc / lilo.conf - one of the most important files. By changing its boot loader-and on Linux. In some distributions do not use LILO for this purpose and GRUB. In this case this file does not exist. This file is divided into sections - one for each operating system installed. Linux here slightly beyond this framework, because the single installed Linux may have more than one section. Reason for this is the fact that Linux can be installed on multiple cores, each core is required a separate section. Here is the format of this file:

# LILO configuration file
# Generated by 'liloconfig'
#
# Start LILO global section
boot = / dev / hda
# compact # faster, but won't work on all systems.
prompt
timeout = 300
# End LILO global section
# DOS bootable partition config begins
other = / dev/hda1
label = WinXP
table = / dev / hda
# DOS bootable partition config ends
# Linux bootable partition with ACPI config begins
# image = / boot/kernel-2.4.22-acpi
image = / boot / latest
root = / dev/hda7
label = Linux-2.4
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
append = 'hdc = ide-scsi'
vga = 791
# Linux 2.6.0 bootable partition with ACPI config begins
# image = / boot/kernel-2.6.3
image = / boot/bzImage-2.6.3
root = / dev/hda7
label = Linux-2.6
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
append = 'hdc = ide-cd'
vga = 791
# Linux bootable partition config ends

In addition to these most important files and directories, the directory / etc contains a number of less-critical configuration files. However, here are a few:
/ etc/X11 - directory in which to keep the configuration of the graphical server. The most important file is XF86Config or XF86Config-4. This is the basic configuration file of the X server.
/ etc / fonts - in this directory to keep configuration files belonging to installed fonts. The most important of these is the file fonts.conf, which lists the directories with installed fonts (not only).
cron.daily, cron.hourly, cron.weekly, cron.monthly - in each of these directories can be added to shell scripts, programs or links to programs that will be implemented accordingly once a day, every hour, once a week or once a month.
/ etc / ld.so.conf - file describing directory in which the operating system keeps its libraries. After changing it to execute the command ldconfig, in order to enter the changes into effect. The file ld.so.cache keep cached information about installed libraries.
/ etc / lpd - configuration file of daemon allows printing.
Changing all of these files is only a simple text editor. Most Linux distributions have a shell script through which this change is convenient and easy. Sorry, no Linux distribution has to shell scripts for all possible changes. So universal and most flexible way to configure the operating system is a simple editor.

System configuration. Network configuration

One of the most important aspects of Linux is its work on a network. The main command used to configure the network is ifconfig. Through it can be assigned IP addresses of network cards, network mask, etc. The simplest way for this usage:
# ifconfig
This will display all interfaces which are currently active. Typical output from this command is:
eth0 Link encap: Ethernet HWaddr 00:48:54:51:96:36
inet addr: 217.75.146.24 Bcast: 217.75.146.255 Mask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
RX packets: 167,735 errors: 27 dropped: 24 overruns: 23 frame: 2
TX packets: 33,803 errors: 0 dropped: 0 overruns: 0 carrier: 0
collisions: 0
RX bytes: 63976099 (61.0 Mb) TX bytes: 2873645 (2.7 Mb)
lo Link encap: Local Loopback
inet addr: 127.0.0.1 Mask: 255.0.0.0
UP LOOPBACK RUNNING MTU: 16,436 Metric: 1
RX packets: 1187 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 1187 errors: 0 dropped: 0 overruns: 0 carrier: 0
collisions: 0
RX bytes: 94,999 (92.7 Kb) TX bytes: 94,999 (92.7 Kb)
eth0 and lo are the identifiers of network interfaces such as eth0 is the first network card, a lo interface is providing loopback. This interface is always there, even if your computer has no network card installed. inet addr displays the IP address that is assigned to the corresponding interface; Bcast - broadcast address for the network; Mask - netmask. Link encap shows the type of interface. If a network interface card Hwaddr shows its hardware address (MAC address).
Another way of calling the ifconfig command is the explicit set of interface you want to see:
# ifconfig eth0
eth0 Link encap: Ethernet HWaddr 00:48:54:51:96:36
inet addr: 217.75.146.24 Bcast: 217.75.146.255 Mask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
RX packets: 210,005 errors: 46 dropped: 41 overruns: 40 frame: 6
TX packets: 49,380 errors: 0 dropped: 0 overruns: 0 carrier: 0
collisions: 0
RX bytes: 102780349 (98.0 Mb) TX bytes: 3836101 (3.6 Mb)
In addition to examining the network interfaces, the command allows to manipulate them. For example the suspension and placing the network interface eth0 is the following simple way:
# ifconfig eth0 down
# ifconfig eth0 up
After completion of the first command, and all traffic from eth0 to be interrupted. He recovered after completion of the second command.
The main function of the command, however, is setting the settings of network interfaces. The most important parameters of the command are:
interface - the interface name, which will be set. For example eth0. Interface instead put that name.
up - 'lifted' the interface named interface. After this command, the interface becomes active.
down - 'download' interface named interface. After this command interface is deactivated.
[-] Arp - allows or prohibits use of the ARP protocol on this interface.
[-] promisc - this flag is by stopping or called. promiscuous mode. In this mode, all packets in the network will be deducted from the interface.
metric N - specifies the interface metric.
mtu N - specifies the size of the MTU (Maximum Transfer Unit). This is the size of the packet to be transmitted at one time. By default, an Ethernet card, the size is 1500 bytes.
netmask addr - specifies the netmask of the interface.
[-] Broadcast [addr] - if specified argument (addr), change of address for the broadcast network. If it is set to include or exclude flag IFF_BROADCAST interface.
[-] pointopoint [addr] - if specified argument (addr) is activated mode of point-to-point '(point-to-point). This arrangement means that the connection is made directly between two computers without anyone between. This mode is used by modems when making a connection.
address - the site of this flag is set the IP address of the interface.

Here are some sample configurations:
# ifconfig eth0 192.168.9.100 - set interface eth0 IP address 192.168.9.100
# ifconfig ppp0 mtu 512 - sets the MTU size of 512 bytes. Appropriate for dial-up connections.
# ifconfig eth0 broadcast 192.168.9.0 - set as broudkast address, network address. The default address is 192.168.9.255 broudkast
# ifconfig eth0 netmask 255.255.255.32 - netmask specifies the interface eth0. By default, the mask ma class C network is 255.255.255.0.

Ifconfig command can be used for the entry of several IP addresses to the same network card. They form the 'aliases':
# ifconfig eth0: 1 192.168.10.100 up
Another important command is the route. Through it the administrator can manipulate the kernel routing table of the operating system. The simplest use of the command is:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default moria2.online.b 0.0.0.0 UG 1 0 0 eth0
If using switch-n to stop searching the host name, instead it displays the IP address:
# route-n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 217.75.146.1 0.0.0.0 UG 1 0 0 eth0
In this way of using this command displays the current routing table. Removing a row from the table it with the command:
# route del default
Th



   Page copy protected against web site content infringement by Copyscape
Additional tags