Vous êtes sur la page 1sur 228

Ubuntu Linux




...../
Ubuntu linux
:
*
*
*


,
.
linuxac.org
.


.

* :

.


:
* 04..................................................................
* 07.................................................................
* Ubuntu Linux17.............................................................
* 19...........................................................................
* 37.......................................................................
* 44..........................................................................
* 63..........................................................
* 79.......................................................
* Fat32 91.......................................
* 96...............................................................
* NTFS 99.....................................
* umask 103..............................
* 108.......................................................
* / APT119..........................................................

:
* Apache php/mySql 130................................
* php my admin 140.......................................
* 144............................................................................
* 152...............................................................
* 156........................................................................
* 160......................................................
* 170.............................................
* sudo173..........................................................

* 183..................................................
* 189.................................................
* compilation196....................................................
* 213.......................................................
* upgrade ( Edgy)218............................
* 226..........................................................................

Unix
( )Unix ( )UNIX
( AT&T ) .
: " " " " .

"" "".

Unix
: MIT
( AT&T ) ( )GE
( .(Multics

.
AT&T
.
" "
" " .

" " .DEC PDP-7 .
GE-645.
" "

.
"" Unics .Unix

" "
.PDP-7

PDP-11
. 1970
"" .Assembly
1973
C
.
AT&T
.

" " Western Electric AT&T

AT&T
.Source code
TCP/IP
.

Mini
" " " " " " SunOS
" " Sun Microsystems.
AT&T
1987-1989
"" Xenix
SVR4 AT&T
!
1993 AT&T " "Novel
"" NT


. X/Open


Source code " " SCO
" " .

!

"" .
.
""
. .


( )Linux . ""

"/" "" .


.FreeBSD
( )GPL




.


.

,
.


.
2003 40
60,000


[ . ]1
.


Freax Free
Freak X , Ari Lemmke

FTP Linux Linus
. Minix
.
Tux Torvalds Unix



27 1983

.

.

( )
. .
()
1991
.

.
.

.
8

.LILO

.

( ) .


GNU ,
1985
, ( )
Hurd
, Hurd
,
,
.
""
,
/ ,


Minix
,

.


.
. .
.
.
386
, Minix

( )


.
.


IBM HP / .



.


.

- .-


RISC
. Mini / Mainframe
10



.

.


0.01 1991 0.02
5 0.03
0.10 .
. AT
. 0.11
VGA EGA Hercules .
0.12 0.95 0.96
kernel.org 2.6

0 1 2 2

2.5.0 2.4 2.6


.
rcX gitX pre
.

Linux
"" ,
11


" :" . [ ]2

.
Hello
. ( )Linus Torvalds
.

Hello, this is Linus Torvalds, and I pronounce
.! ""Linux" as "Linux [ ]3 [ . ]4
: ..
Leenooks Leen-nouks
[ ]5
+ ..
Unix .Minix
( U)
+ X
. :
.


:
, 64
, 14
, .
: 1992 Ext

12

2 255 ,
.
: Ext
Xia Ext Ext2
, Ext Xia , Xia
Ext2 , Ext2
.

,

" "LAMP Linux, Apache, MySQL, ( :
)Perl/PHP/Python
, .
,
.
Symbian OS
, . . .
. TiVo .
firewall router
.router
. supercomputer
2005 500 , ,
)%74.2( 371 , ,
.

13


80386

z9 IBM

( )




.


. wine

.

14


"
, "distro

installer system Package Manager
.
computer
, architecture ,
.

, ]1[ .
, ,
, Unix shell ..
compiler
.



.
. . geek

.

.
. .
15


.
.
]2[ .

"" "" , .
. "[
Since then, there have been numerous independent ]3
]studies and articles ]4 ..
.




- -
.

.
.


ar.wikipedia.org:

16



ubuntu

ubuntu linux
..
..
:
-1 Fedora SuSe debian

-2

-3
3
....
ubuntu
:
-1
debian
-2

-3

17

irc.freenode.net
linux live help
#ubuntu ubuntu
ubuntu Dapper
drake ubuntu+1

1 2
3 4
Real Linux Live Help

,
24 .

Add/Remove Programs





ubuntu

18


ubuntu






intel ubuntu-alternate-i386.iso

cd burn
nero bios cd
Rom drive
Cd

19

install in oem mode


ubuntu Gnome

20

Enter
other

21

american English
enter

22

hostname
Ip gateway dns

configure network manually

: static ip gateway
dns hostname
:

23

Adsl Dsl

:
12 ubuntu

24

manually edit partition table


25

26





ubuntu
13.8 fat32
9

fat32
enter
resizing
enter
delete the partition enter

27

enter fat32
FREE SPACE
FREE SPACE
enter

28

Automatically partition The Free


Space

29



finish partitioning and write changes to the disk

yes

30

creation file system

31

32

( GPl
)

33

software

34

software
enter restart ubuntu

35



ubuntu


36






:


You will be able to log the system as "oem " user with the
password u selected ealier

Oem

ubuntu kernel

kernel 2.6.15-20-386 )recovery mode (:


37

Kernel

38

oem

39

40

41



ubuntu

ubuntu Graphical user interface





The benefits of leaving root disabled by default include the
following
The installer has to ask fewer questions
Users don't have to remember an extra password, which
they are likely to forget
It avoids the "I can do anything" interactive login by
default -you will be prompted for a password before major
changes can happen, which should make you think about
the consequences of what you are doing
Sudo adds a log entry of the command)s( run )In
/var/log/auth.log(. If you mess up, you can always go back
and see what commands were run. It is also nice for
auditing
Every cracker trying to brute-force their way into your box
will know it has an account named root and will try that
first. What they don't know is what the usernames of your
other users are
Allows easy transfer for admin rights, in a short term or
long term period, by adding and removing users from

42

groups, while not compromising the root account


sudo can be setup with a much more fine-grained security
policy


ubuntu
ubuntu Gnome
Dapper drake

.


. GuI
GUI


Command Line
ubuntu
Sudo .
ubuntu

43

:
-1
ubuntu
.fonts fonts
!


-2 Ubuntu
Synaptic Package Manager
(
)
Add/remove application

compiling

-3 search
,

44


DeskTop desktop



( ) mazda kabura concept model

desktop
ubuntu

45

home folder

46

47

tahoma
simplified Arabic Desktop vmware
workstation


copy .fonts

48

49





50

Accessories
Terminal



.

configuration
.

51


...





Accessories
Terminal

52




:
cd /usr/share/fonts/truetype

:
sudo nano -w fonts.cache-1

/usr/share/fonts/truetype
sudo nano -w fonts.cache-1 myfonts

sudo nano -w fonts.cache-1
sudo
sudo

nano
notepad
w- nano
fonts.cache-1

terminal

53

54

System >administration> language support


language support
arabic apply oK
package

55

package

56

update

57




System >preferences >keyboard

58

Add

59

60

61

62




2



synaptic package manager

System > Administration >Synaptic Package Manager

63

synaptic package manager


ubuntu

ubuntu

64

Terminal Applications
Terminal
Accessories

sources.list nano
-w sources.list nano

nano -w sources.list

65

sources.list
sources.list
cp

66


System >Administration >synaptic package manager
Reload

67

Reload Update

update
Close Cd-rom

68

Close

69



Emacs
Editors

Mark For InsTallation


Emacs Mark

70

Apply

71

72

73





(
)

74

Add/remove
Applicatios > Add/Remove

75

sources.list

packages

:
/etc/apt/

......

76






:
sudo apt-get install XXXXX

77


:
sudo apt-get remove XXXXX
XXXXX
ubuntu


:
sudo apt-cache search XXXXX
XXXXX
.

78



ubuntu


....
:


ubuntu
.

ubuntu /etc/apt/sources.list





http://www.4shared.com/file/4611512/7dfc247a

79

Desktop
EXtract here :
:
cd Desktop
sudo cp -p sources.list /etc/apt/sources.list
:
:
System => administration => Synaptic package manager


Reload


update

:
sudo apt-get update
upgrade :
:
sudo apt-get upgrade

:
80

System -> Administration -> Update Manager


easyubuntu
plugins flash
player Java codecs

easyubuntu :
:
wget http://easyubuntu.freecontrib.org/fi...u-3.022.tar.gz
tar -zxf easyubuntu-3.022.tar.gz
cd easyubuntu
sudo python easyubuntu.in


easyubuntu automatix

:
:
sudo nano -w /etc/apt/sources.list
:
:
deb http://www.getautomatix.com/apt dapper main
deb http://packages.freecontrib.org/plf dapper free non-free

81

deb-src http://packages.freecontrib.org/plf dapper free non-free


deb http://archive.canonical.com/ubuntu dapper-commercial main
deb http://download.skype.com/linux/repos/debian/ stable non-free

kubuntu
:
deb http://www.getautomatix.com/apt kubuntu main
enter ctrl+o
: ctrl+x
:
wget http://www.getautomatix.com/apt/key.gpg.asc
gpg --import key.gpg.asc
gpg --export --armor 521A9C7C | sudo apt-key add
:
sudo apt-get update
sudo apt-get install zenity
sudo apt-get install automatix


:
automatix

82


:
Applications => System Tools => Automatix
P:
:
J2SE Runtime Environment )JRE( with Plug-in for Mozilla
Firefox
:
:
sudo apt-get install sun-java5-jre sun-java5-plugin
AGree J2SE
default java virtual machine
:
sudo update-alternatives --config java
J2SE
plugin
:
Flash Player )Macromedia Flash( Plug-in for Mozilla
Firefox
:
83

:
sudo apt-get install flashplugin-nonfree
sudo update-flashplugin

:
alsa-oss package
:
sudo apt-get install alsa-oss

:
gksudo gedit /etc/firefox/firefoxrc

:
FIREFOX_DSP=""

:
FIREFOX_DSP="aoss"
:
PDF Reader )Adobe Reader( with Plug-in for Mozilla
Firefox
:
:
84

sudo apt-get install acroread mozilla-acroread acroread-plugins

SCIM adobe
acrobate 7 SCIM
SCIM
:
:
gksudo gedit /usr/bin/acroread

:
#!/bin/sh
#

:
#!/bin/sh
#
GTK_IM_MODULE=xim

adobe acrobate 7
ftp http
Download For X
:
sudo apt-get install d4x

85

gwget
:
sudo apt-get install gwget
gftp ftp client
:
sudo apt-get install gftp
)Azureus( P2P Torrent
:
sudo apt-get install azureus
( P2P Torrent
)BitTornado
:
sudo apt-get install bittornado
sudo apt-get install bittornado-gui
)aMule( P2P Emule Client
:
sudo apt-get install amule
) Forst Wire( P2P Genutella Client
:
wget -c http://www.users.on.net/~stubby/FrostWire-4.10.9-2.i586.deb

86

sudo dpkg -i FrostWire-4.10.9-2.i586.deb


:
:
Applications -> Internet -> FrostWire
(
)Skype
:
sudo apt-get install skype
Applications -> Internet -> Skype *
For the Skype 1.3 Beta dowload the debian package *
:
http://www.skype.com/download/skype/linux/13beta.html

In the terminal
:
sudo dpkg -i skype-beta-1.3.0.37-1_i386.deb
:
Applications -> Internet -> Skype
87

MultiMedia codecs
:
sudo apt-get install gstreamer0.10-ffmpeg
gstreamer0.10-gl gstreamer0.10-plugins-base \
gstreamer0.10-plugins-good gstreamer0.10-pluginsbad gstreamer0.10-plugins-bad-multiverse
\gstreamer0.10-plugins-ugly gstreamer0.10-pluginsugly-multiverse w32codecs
MP3
,RM,WAV

: Mplayer
:
sudo apt-get install mplayer
VLC with plug-in for Mozilla
Firefox
:
sudo apt-get install vlc vlc-plugin-* mozilla-plugin-vlc
:
:
sudo apt-get install avahi-daemon
sudo apt-get install avahi-utils

88


Totem with plug-in for Mozilla Firefox
:
sudo apt-get install totem-gstreamer-firefox-plugin
realplayer amarok
:
sudo apt-get install amarok
sudo apt-get install realplay
compiled HTML help
kchmviewer xchm
:
sudo apt-get install xchm
sudo apt-get install kchmviewer

CDS DVDS k3b


GnomeBaker

:
sudo apt-get install k3b libk3b2-mp3
sudo apt-get install gnomebaker

Gparted
89

:
sudo apt-get install gparted
:
rar .rar
unrar-free
:
sudo apt-get install rar
sudo apt-get install unrar-free
Compilers

build-essential
:
sudo apt-get install build-essential
.rpm .deb Alien
:
sudo apt-get install alien

90


mount
mount



Cd DVD

mount
mount / ( )root
unmount umount
FAT32
mount Suse 10
/windows
ubuntu dapper beta
release
mount

/dev :
IDE\ATA

91

primary master /dev/hda


primary slave /dev/hdb
secondary master /dev/hdc
secondary slave /dev/hdd

:
========================================
primary master
/dev/hda1 c
/dev/hda5 d
/dev/hda6 e
a b c d
secondary master /dev/hdc 1 ?

d 5 ? 2
========================================
primary ( extended
) )primary
d logical extended
extended 4 2 3
primary c d
primary 2 primary
extended logical .

92

mount
/mnt c,d,e
:
:
:
oem@ubuntu:~$ cd /mnt
oem@ubuntu:/mnt$ sudo mkdir q w r t
oem@ubuntu:/mnt$
cd /mnt

/mnt
/ root
* q w r T :
5 c,d,e,f,g sudo mkdir c d e f g


/mnt
:
mount -t vfat /dev/hda1 /mnt/c
:
mount -t vfat /dev/hda5 /mnt/d
mount -t ntfs /dev/hda6 /mnt/e
mount -t ntfs /dev/hda7 /mnt/f
/mnt
mount

93


fstab /etc
:
sudo nano -w /etc/fstab
sudo
nano -w
nano
-w

fstab : *
:
GNU nano 1.3.10 File: /etc/fstab
.etc/fstab: static file system information/ #
#
file system> <mount point> <type> <options> <dump>> #
<<pass
proc /proc proc defaults 0 0
dev/hda6 / ext3 defaults,errors=remount-ro 0 1/
dev/hda1 /media/hda1 vfat defaults,utf8,umask=007,gid=46/
0 1/dev/hda5 /media/hda5 vfat
defaults,utf8,umask=007,gid=46 0 1/dev/hda7 none swap sw
00
dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0/
dev/fd0 /media/floppy0 auto rw,user,noauto 0 0/
media/hda5/mido.iso /media/cdimage iso9660 ro,loop 0 0/
dev/hdc6 /media/msr ntfs-3g umask=000 0 0/
dev/hdc8 /media/msr2 ntfs-3g umask=000 0 0/
94

mount
mount 5

> <file system
/dev/hda1 ><mount point
/mnt /mnt/c >
<type
vfat )vfat=fat32( the same >
<options
codepage=864,iocharset=utf8 ><dump
0 > <pass 1

:
/dev/hda1 /mnt/c vfat codepage=864,iocharset=utf8 0 1

d ,e,f ,g
ctrl+o ctrl+x
mount
mount
.

95

:

mount
(
)
:
wget http://www.ubuntulinux.nl/files/diskmounter

:
wget i

diskmounter ( )

enter
:
oem@ubuntu:~$ wget http://www.ubuntulinux.nl/files/diskmounter
http://www.ubuntulinux.nl/files/diskmounter --22:47:46-=< `'diskmounter
Resolving www.ubuntulinux.nl... 87.250.150.84
.Connecting to www.ubuntulinux.nl|87.250.150.84|:80... connected
HTTP request sent, awaiting response... 200 OK
]Length: 4,864 )4.8K( ]text/plain
]<====================================[100%
23.23K/s 4,864
]KB/s( - `diskmounter' saved ]4864/4864 23.22( 22:47:47

96


:
sudo bash diskmounter

enter
:
sudo bash diskmounter
:Password
By default the disks will be writable only by root and
)Do you want to make the disk writable by all users instead? )y/n
y

enter


y
n
y or n :
:
As of Ubuntu 6.04 )Dapper Drake( there is slightly more NTFS
writing support
through a very experimental NTFS FUSE module. Using this
seems to work but
]is NOT recommended. Do you want to use this? ]no


mount
ntfs
97

no
enter mount
mount
/media mount
:
'Added /dev/hda1 as '/media/hda1
'Added /dev/hda5 as '/media/hda5
All windows and mac partitions will now be mounted every
time you boot
You do not need to reboot, the partitions are mounted
now too




: ubuntu
sudo root

98




NTFS
NTFS
ntfs-3g


:
gksu gedit /etc/apt/sources.list
sources.list
:
: mirror .
:
(#Givre's repository )ntfs-3g & fuse 2.5.3
deb http://givre.cabspace.com/ubuntu/ dapper main
deb-src http://givre.cabspace.com/ubuntu/ dapper main
:
(#Givre's repository )ntfs-3g & fuse 2.5.3
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main
deb-src http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main

99

:
(#Givre's repository )ntfs-3g & fuse 2.5.3
deb http://flomertens.keo.in/ubuntu/ dapper main
deb-src http://flomertens.keo.in/ubuntu/ dapper main
:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ntfs-3g
fstab

:
:
sudo cp /etc/fstab /etc/fstab.bak
gksu gedit /etc/fstab
NTFS
2
:
ntfs-3g

>/media/<mount point

>/dev/<your partition
umask=000 0 0


/mnt /media
:

100

:
>sudo mkdir /media/<the name you want

:
>sudo mkdir /mnt/<the name you want
fstab

fuse :
:
gksu gedit /etc/modules
fuse modules
NTFS (
) READ + WRITE FULL ACCESS
:
:
sudo modprobe fuse
sudo umount -a
sudo mount -a

101


sudo
yast yum

NTFS
ubuntu

102



Permissions Mount
chmod
READ WRITE
EXECUTE umask

:

:
-1
-2
-3 Fat32 NTFS
-4 Dial-Up
Connection





(
)
:
-1
-2
103


.

umask

fstab
:
sudo nano -w /etc/fstab

:
#

# <file system> <mount point> <type> <options>


<dump> <pass>
proc
/proc
proc defaults
0
0
/dev/hdb2
/
ext3 defaults,errors=remountro 0
1
/dev/hda1
/media/hda1
vfat umask=000
0
0
/dev/hdb1
none
swap sw
0
0
/dev/hdc
/media/cdrom0 udf,iso9660 user,noauto
0
0
/dev/fd0
/media/floppy0 auto rw,user,noauto 0
0
/dev/hda2 /media/windows ntfs ro,nls=utf8,umask=0222 0
0
/dev/hdd1 /media/storage ntfs ro,nls=utf8,umask=0222 0
0
/dev/hdd5
/media/fat
vfat umask=000 0 0
104

usmak modifier

umask modifier

chmod 777
file !
umask
fstab umask

umask =

:0222 READ + WRITE
root
: 000 READ + WRITE

: : umask
fmask : files
dmask : directories
umask .
umask

105


-1 mount mount
umount
:
sudo umount /dev/xxxx

xxxx mount hda1 , hda5 , hda6


-2 fstab
:
sudo nano -w /etc/fstab
: sudo ubuntu
su - sudo su-
password

fstab

:
0

vfat

/media/hda1

/dev/hda1

READ+WRITE
umask=000 :

106

:
0

umask=000

vfat

/media/hda1

/dev/hda1

ctrl+o
enter ctrl+x
mount

:
sudo mount -a

volume Permissions .


: sudo
root


https://help.ubuntu.com/community/VolumePermissions

107

Dialup Modem How to IN Ubuntu Linux



ubuntu

.



: driver
: Dial-up Connection

Release Versions
Driver Installing
the driver for your modem
modems :
PCI -1
USB -2
-3 modems built-in laptops
3
modems linmodems.org
. modems
driver driver

108

source compiling
Compiler :
:
sudo apt-get install build-essential

linux-headers-2.6.15-26-386_2.6.15-
26.46_i386.deb
http://security.ubuntu.com/ubuntu/pool/main/l/linuxsource-2.6.15/linux-headers-2.6.15-26-386_2.6.1526.46_i386.deb

:
cd Desktop
sudo dpkg -i linux-headers-2.6.15-26-386_2.6.15-26.46_i386.deb



/http://www.linmodems.org
scanModem
http://132.68.73.235/linmodems/packages/scanModem.gz
Desktop

109

: scanmodem.gz Desktop copy


Desktop

:
$ cd ~/Desktop
$ gunzip scanModem.gz
$ chmod +x scanModem
$sudo bash scanModem
:
Gunzip
chmod executable executable
( ) exe
bash scanModem
root
ubuntu sudo root

:
oem@ubuntu:~/Desktop$ bash scanModem
UPDATE=2006_August_02
ONLY use scanModem downloaded as:
http://linmodems.technion.ac.il/packages/scanModem.gz
scanModem should ONLY be run within a Linux/UNIX
.partition
If within a MicroSoft/DOS partition, abort with Ctrl-C

110

!!! now
.Copy scanModem.gz to your Linux partition and restart
rm: cannot remove `Modem/scanout.txt': No such file or
directory
ls: /usr/bin/gcc-*: No such file or directory
Providing detail for device at 0000:02:03.0
with vendor-ID:device-ID
----:---Class 0780: 14f1:2f00 Communication controller: Conexant
)HSF 56k HSFi Modem )rev 01
SubSystem 14f1:2004 Conexant Dynalink 56PMi
Flags: bus master, medium devsel, latency 32, IRQ 10
-PCI_IDs------- --CompilerVer----Feature List: Primary Subsystem Distr KernelVer kernel
default CPU
scanModem test 14f1:2f00 14f1:2004 Ubuntu 2.6.15-26-/.
386 4.0.3 none i686
.14f1:2f00 is a Conexant HSF modem

A subfolder Modem/ has been written, containing these


:files with more detailed Information
----------------------------------------------------------------------------------------1stRead.txt Conexant.txt DriverCompiling.txt
InfoGeneral.txt ModemData.txt Rational.txt scanout.txt
Slmodem-ALSA.txt Slmodem.txt SoftModem.txt Testing.txt
111

UNSUBSCRIBE.txt YourSystem.txt
-----------------------------------------------------------------------------------------.Please read 1stRead.txt first for Guidance
$oem@ubuntu:~/Desktop
Desktop folder
Modem
1stRead.txt:
ModemData.txt:


1stRead.txt:
Modem
:
YourModem.txt - Guidance about operating your particular
System, for your benefit
It should NOT be sent to Discuss@linmodems.org
.Rational.txt - Motivations of this scanModem package
DriverCompiling.txt - Explains the roles of additional files
which may have to be installed
to support compiling of modem drivers, and the steps to
.take
112

SoftModem.txt - Information and instructions about "soft


."modems
For these modems, additional steps may be necessary for
.choice of supporting software
The primary PCI ID is that of the host audio or modem
controller, which can support diverse Subsystems. It is the
chipset of the Subsystem which determines the software
.needed
Slmodem.txt - The slmodem software from SmartLink
.supports a variety of soft modems
However new Users need to be aware of its special port
.setup features
.Slmodem-ALSA.txt About ALSA mode usage for slmodem
.
ModemTesting.txt SHOULD be read, but after drivers have
.been installed
scanout.txt - Ignore, it is a scanModem maintenance tool
InfoGeneral.txt has general information about the status of
,winmodem support under Linux
Do read it if ModemData.txt reports that your current
.modem is not supported under Linux
Unsubscribe.txt - Howto terminate email tranmissions from
the List

113

Modem
linmodems.org

:
Generic Soft chip Conexant HSF 56k
HSFi Modem
chip driver

http://www.linuxant.com/drivers/hsf/full/downloads.php
Generic package with source
Format DPKG
hsfmodem_7.47.00.01full_i386.deb.zip
( ):p
http://www.linuxant.com/drivers/hsf/full/archive/hsfmodem7.47.00.01full/hsfmodem_7.47.00.01full_i386.deb.zip
Desktop zip
Desktop extrcat here

hsfmodem_7.47.00.01full_i386.deb.zip_FILES
hsfmodem_7.47.00.01full_i386.deb
cut Paste Desktop
install packages
Double Click Grant
114



:
sudo hsfconfig


:
oem@ubuntu:~$ sudo hsfconfig
:Password
Conexant HSF softmodem driver, version 7.47.00.01full
If you need license keys, assistance or more information,
:please go to
/http://www.linuxant.com
When reporting a problem for the first time, please send
."us the file generated by "hsfconfig --dumpdiag
No pre-built modules for: Ubuntu-6.06.1 linux-2.6.15-26386 i686
...Trying to automatically build the driver modules
this requires a C compiler and proper kernel sources to(
)be installed
Where is the linux source build directory that matches
?your running kernel
115

]lib/modules/2.6.15-26-386/build/[
Building modules for kernel 2.6.15-26-386, using source
directory
...lib/modules/2.6.15-26-386/build. Please wait/
.done
"Automatically guessed region )using timezone(: "EGYPT
Please enter region name for modem unit 0 ]EGYPT[:
EGYPT
"Setting region for modem unit 0: "EGYPT
To change, use "hsfconfig --region" or
"<"AT+GCI=<T35code
The current region can be displayed by entering "ATI9" in
.a terminal program
Note: we respect user privacy. Email addresses are not
communicated
!nor used for any purpose other than to manage licenses
]Please enter your email address ]unknown
Please enter region name for
]modem unit 0 EGYPT

P:

116

license key

https://www.linuxant.com/store/index.php
license key FREE
14.4kbps S:
ISP
phone number >= System => Administration
Networking
Modem Connections Properties



https://help.ubuntu.com/community/DialupModemHowto

:
-1 ubuntu sudo
sudo ubuntu
packages
:
Complier gcc -1
-2 linux-headers-2.6.15-26-386_2.6.15-26.46_i386
-3 scanModem
117

http://132.68.73.235/linmodems/packages/scanModem.gz
-4 driver

https://www.linuxant.com/drivers/hsf/full/downloads.php
* HSF
HCF
https://www.linuxant.com/drivers/hcf/full/downloads.php

/https://www.linuxant.com/drivers
========================================

https://help.ubuntu.com/community/DialupModemHowto
/http://www.linmodems.org


118




APT

APT
.
APT
ubuntu

APT
APT Debian
update APT

xmms winamp
source

libglib1.2 libgtk1.2 libgtk1.2-common

APT
libraries dependencies

119

APT
APT Debian
APT
install
.tar.gz install
compiling
executable .


dependencies
config upgrade
.
APT Debian APT
RedHat
rpm
APT Advanced Packaging Tool

.

APT
: sudo
root

120


sources.list

:
apt-get update


:
apt-get install XXXX
XXXX
upgrade

:
apt-get upgrade
upgrade

:
apt-get dist-upgrade

config

121

:
apt-get remove XXXX
XXXX config

config
:
:
apt-get --purge remove XXXX
XXXX config

apt-cache



:
apt-cache search XXXX
XXXX

aptitude
122

aptitude

aptitude - Curses viewer of packages installed or available.
Aptitude can be used from the command-line in a similar
way to apt-get, but only for some commands - install and
remove being the most common. However, because
aptitude keeps track of more information than apt-get
does, it can be considered better at install and remove
.operations

,
dependencies
:
apt-cache showpkg XXXX
XXXX
packages
package
:
apt-cache dumpavail
packages ntfs-3g NTFS
:

123

:
Package: ntfs-3g-nautilus-tools
Version: 0.10-1
Priority: optional
Section: utils
<Maintainer: Florent Mertens <flomertens@yahoo.fr
Depends: ntfs-3g, nautilus-script-manager, file, zenity,
gawk | mawk, pmount, gksu, libnotify-bin
Architecture: i386
Filename: dists/dapper/main/binary-i386/ntfs-3gnautilus-tools_0.10-1_i386.deb
Size: 5706
Installed-Size: 64
MD5sum: a26a0a7e05782893db2b577cddd5020f
Description: A nautilus-script to mount ntfs device
with ntfs-3g
With this package, you will be able to mount and
unmount
.easily and safely your NTFS USB device using ntfs-3g
.
This script is enable for all user by default
: To disable it for any user, simply launch in a terminal
nautilus-script-manager disable mount_with_ntfs-3g
nautilus-script-manager disable unmount_ntfs-3g



:
apt-cache show XXXX
124


XXXX
packages

:
apt-cache pkgnames

apt-get install
apt-get install xxxx
.deb extra libraries
dependencies xxx.deb
packages

:
apt-get autoclean

games

racing
game apt-
cache search xxxx Terminal
:
sudo apt-cache search racing game
125

:
slune - 3D racing and car-crashing game
torcs - 3D racing cars simulator game using OpenGL

trocs

:
sudo apt-cache show torcs
( )
requirements processor rams


:
sudo apt-get install trocs

shortcut trocs

command not found
trick

" "usr/bin/ /usr

126

:
cd /usr/games

ls trocs




:
sudo apt-get remove trocs

MySQL config

:
sudo apt-get --purge remove trocs


trick

127

:
sudo apt-get install xxxx

agi xxxx
:
:
sudo gedit ~/.bashrc
bashrc
:
alias acs='apt-cache search'
alias agu='sudo apt-get update'
alias agg='sudo apt-get upgrade'
alias agd='sudo apt-get dist-upgrade'
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'
save

:
l1nux3r@P0w3R:~$ agi amsn
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
docker imlib-base imlib11 libssl0.9.7 sox tcltls
Suggested packages:
128

mozilla galeon konqueror imagemagick imlib-progs


The following NEW packages will be installed:
amsn docker imlib-base imlib11 libssl0.9.7 sox tcltls
0 upgraded, 7 newly installed, 0 to remove and 0 not
upgraded.
Need to get 4939kB of archives.
After unpacking 14.6MB of additional disk space will be
used.
Do you want to continue ]Y/n[?


ubuntu wiki
https://help.ubuntu.com/community/AptGetHowto

129

Apache php/mySql
amine00 :

"" Apache " "
mySql " " .php .

(install from )source deb rpm .


.

.
apache php .

.
. .
( ).
:
libxml
:
apt-get install libxml2-dev
( apt-get install libxml2 )
:
urpmi libxml2-devel

130

( urpmi libxml2 )
::
/opt
. :
:
/usr/local
. :
Apache 2.2.3http://httpd.apache.org/download.cgi :
php 5.1.5http://www.php.net/downloads.php :
mySql 5.0.22:
http://dev.mysql.com/downloads/mysql/5.0.html#Source

.1 mySql
Apache mySql php
mysql : mysql
:
groupadd mysql
useradd -g mysql mysql
mySql

131

:
/opt/src
:
:
cd /opt/src
tar zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
:
:
./configure --prefix=/opt/mysql
:
--prefix
: :
:
make
make install
mySql :
:
cp /opt/src/mysql-5.0.22/support-files/my-small.cnf /etc/my.cnf
chown root /etc/my.cnf
chgrp root /etc/my.cnf
chmod 644 /etc/my.cnf

vi :

132

:
vi /etc/my.cnf

:
[]mysqld
:
user = mysql
.
mysql : mySql
:
/opt/mysql/bin/mysql_install_db --user=mysql
var .mySql ( )var
.mySql
mysql .
:
:
chown -R root /opt/mysql
chown -R mysql /opt/mysql/var
chgrp -R mysql /opt/mysql
.mySql
:
:
& /opt/mysql/bin/mysqld_safe --user=mysql

133

:
:
& pc-amine:/opt# ./mysql/bin/mysqld_safe --user=mysql
]2[ 32608
pc-amine:/opt# Starting mysqld daemon with databases
from /opt/mysql/var
. ( ).
.root
mySql root .
:
:
/opt/mysql/bin/mysql -u root
:
:
Welcome to the MySQL monitor. Commands end with; or
\g.
Your MySQL connection id is 2 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>mysql
quit .
root
. root (
:)secret

134

:
/opt/mysql/bin/mysqladmin -u root flush-privileges password secret

:
:
/opt/mysql/bin/mysql -u root -p

/opt/mysql/bin/mysql -u root --password=secret

: newPass secret
:
/opt/mysql/bin/mysqladmin -u root --password=secret flushprivileges password newPass

:
:
/opt/mysql/bin/mysqladmin -u root -p shutdown


:
support-files mysql.server
:)mySql (
:
cp /opt/src/mysql-5.0.22/support-files/mysql.server /etc/init.d/mysql

chmod 755 /etc/init.d/mysql

:
:
update-rc.d mysql defaults
:
:
chkconfig --add mysql

135

chkconfig mysql on

Apache
Apache

.
. www ( apache2
) :
:
groupadd www
useradd apache2 -g www -d /dev/null -s /bin/false

Apache :
:
tar jxvf httpd-2.2.3.tar.bz2

tar zxvf httpd-2.2.3.tar.gz

:
cd httpd-2.2.3
:
:
./configure --help | less
:

136

:
./configure --prefix=/opt/apache2 --enablemodules=most
make
make install
Apache
: vi
:
vi /opt/apache2/conf/httpd.conf
:
:
"DocumentRoot "/opt/apache2/htdocs
: Apache
.
.
. :
:
DocumentRoot /opt/www

DocumentRoot /www
:
:
>"<Directory "/opt/apache2/htdocs

137

. :
:
>"<Directory "/opt/www
:
:
User daemon
Group daemon
apache
: daemon
:
User apache2
Group www

:
:
chown -R apache2 /opt/www/
chgrp -R www /opt/www/
chmod -R 750 /opt/www/
. :
:
/opt/apache2/bin/apachectl start

138

DocumentRoot .
html index.html .
:
:
><html><body><h1>It works!</h1></body></html

index.html .
:
http://localhost

http://192.168.0.2

.index.html
.
:
:
/opt/apache2/bin/apachectl stop

:
apachectl init.d /etc :
:
cp /opt/apache2/bin/apachectl /etc/init.d/
chmod 755 /etc/init.d/apachectl

:
:
update-rc.d apachectl defaults

:
:
chkconfig --add apachectl
chkconfig apachectl on

139

php my admin
amine00 :

lamp ( )Linux Apache Mysql Php
phpMyAdmin php
mySql
.
( : )2.9.0.2
http://www.phpmyadmin.net/home_page/downloads.php
all-languages.tar.bz2 all-languages.tar.gz
http
:
/opt/www
/path/to :
:
cd /opt/www
tar jxvf /path/to/phpMyAdmin-2.9.0.2-all-languages.tar.bz2

tar zxvf /path/to/phpMyAdmin-2.9.0.2-all-languages.tar.gz

: apache (
apache2 )www

140

phpMyAdmin-2.9.0.2-all-
: languages
:
chown -R apache2 phpMyAdmin-2.9.0.2-all-languages
chgrp -R www phpMyAdmin-2.9.0.2-all-languages
phpMyAdmin-2.9.0.2-
all-languages :phpMyAdmin
:
ln -s phpMyAdmin-2.9.0.2-all-languages/ phpMyAdmin
.
symbolic links
( ) . :
:
mv phpMyAdmin-2.9.0.2-all-languages phpMyAdmin

. config
phpMyAdmin :
:
cd phpMyAdmin
mkdir config
chmod o+rw config

http://localhost/phpMyAdmin/scripts/setup.php

add Servers :
Server hostname = localhost
Connection type = tcp
141

Authentication type = config


User for config auth = root
= Password for config auth mysql
Add . save
Configuration
config.inc.php config
phpMyAdmin : config
:
cp config/config.inc.php .
#
rm -rf config
( )phpMyAdmin
http://localhost/phpMyAdmin :
:

142

143

Linux Security Policy HowTo


B!n@ry :
..
(Physical Security )1



..

17-16
..
...
..

hardware
..
availability
physical sec BIOS
BOOT loeder
kernel

144

(User Security )2
root
...
3 admin
..
root ..
log file
admin root

.. admin admin
.. ..
sudo
.. admins
root ..

(File & Filesystem Security)3


fs
mount ..

fs

.. fs
mount
ro
rw . fs mount umount
fs man mount man fs

145

:
) 1 owner

) 2
owner

) 3

umask
..
ext3
attributes

:
file

+i

chattr

immutable
..
stickybit setGUID SUID
SUDI

Integrity checker binaries
mount ..
tripwire
opentripewire sourceforge

...
trojan horse

root
146

MDS checksum GPG


rpm
...
(Password Security & Encryption)4

.. Public
Network PGP Public Key
Encryption ..
public key public
key Main Authority
Verisign
.. ssl https verification

MIME type
.. MIME type
standard ..
.. secure shell .. remotely
ssh ..
Signiture
.. PAM Pluggable Authentication Modules ..
Modules

PAM

147

(Kernel Security)5


.. ..
..
..
:
) 1 % 90

) 2 Firewall
Box
) 3 sysctl.conf
ping
:
echo "net.ipv4.icmp_echo_ignore_all = 1" >> /etc/sysctl.conf

tcp-syn****ies DOS
..
..... ... google
Kernel
Devices
:
/dev/urandome

:
/dev/random
Random Number's ...
PGP keys ssh
...
148

... Google ..
(Network Security)6
..
.. ..
.. iptables
sAFA7_eLNeT
.. tcp-wrappers

:
/etc/hosts.deny

:
/etc/hosts.allow
FFp ssh
pop3 ... sAFA7_eLNeT
.. DNS
DNS ...
.. MTA ( Mail Transport
) Agent overlog
...
.. Network file system .. NFS
mount
.. ... NFSHowTo
149

.. Network Information Service


NIS YP Yallow Pages
..
..
NIS LDAP ..
.. .. :
ports nmap
ports ...
.. ports

packets ... sniffers dsniff
ethreal ...
sniffers sAFA7_eLNeT
... port scanning
.. ! ! ..
.. ...

..

150

(Before Going Public)7


... Online
Plugged to the
outworld :
) 1 Backup
..
.. Backup
...
..
) 2 ..
..
) 3 log

syslogd crond
) 4

.. .. ..
..

amine00
% 100 % 99
" " ...

151

GnuPG
B!n@ry :
...
...
... G P G
Kgpg ...
...
:GPG ... GNU Privacy Gaurd
...
... Digital Certificates
... OpenPGP ...
g p g :
:
:
gpg --gen-key
... 1 4
2 ... Enter
:
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
(Key is valid for? )0

152

...
... 0 ...
:
Key does not expire at all
(Is this correct? )y/N
y ...
:
You need a user ID to identify your key; the software
constructs the user ID
from the Real Name, Comment and Email Address in
this form:
("Heinrich Heine )Der Dichter
"><heinrichh@duesseldorf.de
Real name:
...
...
:
Real name: Abu Mohammed
Email address: arabnix@arabnix.net
Comment: Just for Testing
...
...

153

:
You selected this USER-ID:
"Abu Mohammed )Just for Testing(
<arabnix@arabnix.net>"
Change )N(ame, )C(omment, )E(mail or )O(kay/)Q(uit?
O
... Okay
:
You need a Passphrase to protect your secret key.
...
...
:
We need to generate a lot of random bytes. It is a good
idea to perform
some other action )type on the keyboard, move the
mouse, utilize the
disks( during the prime generation; this gives the
random number
generator a better chance to gain enough entropy.
........++++++++++
.++++++++++
gpg: key 403E34E2 marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb

154

gpg: 3 marginal)s( needed, 1 complete)s( needed, PGP


trust model
gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n,
0m, 0f, 2u
pub 2048R/403E34E2 2006-10-14
Key fingerprint = 6881 418B 21DD DCE8 8520
0AAC 6A16 97BA 403E 34E2
uid
Abu Mohammed )Just for Testing(
<arabnix@arabnix.net>
... ...
:
:
gpg --list-keys Abu Mohammed
pub 2048R/403E34E2 2006-10-14
uid
Abu Mohammed )Just for Testing(
<arabnix@arabnix.net>

155

.. GnuPG
sAFA7_eLNeT :
GPG
.

http://www.securitygurus.net/forum/i...showtopic=1885

""
.
-1 IT ..
"
.. "

..
:
:
gpg -e -r FD0245153BA20E2E untitled.bmp
-e : .. -r ID ID
..
untitled.bmp.gpg ..
:

156

:
gpg -d untitled.bmp.gpg > friend.bmp
.. ..
.. .
-2


..gpg
:
gpg -e -r FD0245153BA20E2E -r DC87D14A3AB2CE5E
pass.txt
ID
-r .
key ID
-3

key .. :
:
gpg --keyserver wwwkeys.eu.pgp.net --send-keys
0xDC7D9E2B

ID :

157

:
gpg --recv-key --keyserver wwwkeys.eu.pgp.net
0xDC7D9E2B
-4 Key key
hackobacko
redhat 7
redhat
key .. :
:
gpg --search-keys --keyserver wwwkeys.eu.pgp.net hackobacko

key 3
.. OS reload .
-5
..
s- sign .. ..
:
:
gpg -e -s -r C7243A8E7EF95C18 bug.txt
Marcelo .. :

158

gpg: Signature made Fri Nov 10 03:07:42 2006 EET


using DSA key ID 3BA20E2E
(!gpg: Good signature from "SoFy )Live Free 0r Die
"><SoFy.Guru@gmail.com
SoFy .. .
GPG
GPG

:
gpg --help
man gpg
.

159



HowTo


F-Prot
license keys cracks
serials
firewall iptables
Howto ubuntu


:


%.000000000000000001




antivirus

160

anitvirus

anitivirus



F-Prot


F-Prot
ubuntu

:
:
:
update
upgrade
install build-essential
install libwww-perl
install libgtk2.0-dev
install checkinstall

161

apt-get
apt-get
apt-get
apt-get
apt-get
apt-get

sudo
sudo
sudo
sudo
sudo
sudo


http://www.f-prot.com/download/trial...ux-ws-deb.html
intended use home user
numbers of computers in your network 10-1
Submit and start download
XFPROT-1.15 :
http://web.tiscali.it/sharp/xfprot/xfprot-1.15.tar.gz
packages
:
:
cd Desktop
sudo dpkg -i fp-linux-ws.deb
: fp-linux-ws Desktop
cd

xfprot Desktop :
:
tar zxvf xfprot-1.15.tar.gz
cd xfprot-1.15
./configure --with-gtk2 --with-sudo --autodetect --without-debug -with-install-dir=/usr/local
make

162

sudo checkinstall
sudo dpkg -i xfprot_1.15-1_i386.deb

System Application
Tools

:
sudo gedit /usr/share/applications/fprot.desktop

:
]Desktop Entry[
Name=F-Prot
Comment=Anti-Virus Application
Exec=xfprot
Icon=/usr/local/xfprot/icons/antivirus-48x48.png
Terminal=false
Type=Application
;Categories=Application;System
exit save
:
Applications=>System tools=>F-Prot

163

:


:
sudo apt-get install f-prot-installer
enter

Download and install


164

:
:
Downloading file fp-linux-ws.tar.gz.md5 from ftp://ftp.f/prot.com/pub/linux
URL: ftp://ftp.f-prot.com/pub/linux//fp-linux- 18:09:37
]ws.tar.gz.md5 ]53[ -> "fp -linux-ws.tar.gz.md5" ]1
.md5sum looks O.K
ftp://ftp.f-prot.com/pub/linux//fp-linux- --18:09:37-ws.tar.gz
'fp-linux-ws.tar.gz` <=
Resolving ftp.f-prot.com... 213.220.100.10
Connecting to ftp.f-prot.com|213.220.100.10|:21...
.connected

165

!Logging in as anonymous ... Logged in


.SYST ... done. ==> PWD ... done <==
.TYPE I ... done. ==> CWD /pub/linux/ ... done <==
PASV ... done. ==> RETR fp-linux-ws.tar.gz ... <==
.done
)Length: 4,299,527 )4.1M( )unauthoritative
+++++++++++++++++++++++++++++++++[100%
K/s--.-- 4,299,527 ]++++
B/s( - `fp-linux-ws.tar.gz' saved 0.00( 18:37:43
]]4299527
.
fp-linux-ws.tar.gz successfully downloaded from
./ftp://ftp.f-prot.com/pub/linux
.
Patching /tmp/fp-unpack.XXXGZJ9Q9/f-prot/tools/check... updates.pl
Patching /tmp/fp-unpack.XXXGZJ9Q9/f... prot/man_pages/check-updates.pl.8
...Checking if virus definitions need to be updated
***************************************
* F-Prot Antivirus Updater *
***************************************
:There's a new version of
.Document/Office/Macro viruses" signatures on the web"
...Starting to download
.Download completed

166

:There's a new version of


Application/Script viruses and Trojans" signatures on"
.the web
...Starting to download
.Download completed
Preparing to install Application/Script viruses and
.Trojans signatures
Application/Script viruses and Trojans signatures have
.successfully been install ed
Preparing to install Document/Office/Macro viruses
.signatures
Document/Office/Macro viruses signatures have
.successfully been installed

**********************************
* .Update completed successfully *
**********************************

f-prot
hda1 scan
:
f-prot /media/hda1
mashary scan

167

:
l1nux3r@P0w3R:~$ f-prot /media/hda1/mashary
Virus scanning report - 18 September 2006 @ 21:53
F-PROT ANTIVIRUS
Program version: 4.6.6
Engine version: 3.16.14
VIRUS SIGNATURE FILES
SIGN.DEF created 18 September 2006
SIGN2.DEF created 18 September 2006
MACRO.DEF created 18 September 2006
Search: /media/hda1/mashary
Action: Report only
Files: "Dumb" scan of all files
Switches: -ARCHIVE -PACKED -SERVER

:Results of virus scanning


Files: 10
MBRs: 0
Boot sectors: 0
Objects scanned: 0
Time: 0:00
No viruses or suspicious files/boot sectors were found.

168






http://ubuntuforums.org/showthread.p...ight=antivirus

169

:
amine00 :


.
: login.defs
login.defs /etc :
:
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_WARN_AGE 7
:
: PASS_MAX_DAYS ( 60
)
: PASS_MIN_DAYS (
0 )
: PASS_WARN_AGE
( 7 )
:
:
/etc/default/useradd
:
:
# INACTIVE=-1

170


.

:
:
# EXPIRE
: EXPIRE .
. YYYY-MM-DD
:
:
INACTIVE=14
EXPIRE=2007-07-01
: .
chage :
amine :
:
chage -M 60 amine
:
:
chage -m 2 amine

7 :

171

:
chage -W 7 amine
:

:
chage -E 2007-01-01 amine
:
:
chage -E -1 amine
:
:
chage -l amine
: ldap
.

172

sudo
amine00 :

sudo SuperUser DO /
.
( )root .

root .
su
. ( )log
" ".
sudo .
.
sudo :
: sudo .
: etc/sudoers/ .
: visudo sudo .

. :
:
visudo
( ):

173

:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command
as root.
#
# See the man page for details on how to write a
sudoers file.
#
Defaults

env_reset

# Host alias specification


# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=)ALL( ALL
:
: )alias(
Host( IP ) User alias(
.)Cmnd alias( ) alias
:
.

174

:
( User_Alias
).
.Cmnd_Alias

.Host_Alias
:
amine ahmed .hassan
.apt-get
.passwd
sudoers :
:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command
as root.
#
# See the man page for details on how to write a
sudoers file.
#
env_reset

Defaults

# Host alias specification


# User alias specification
User_Alias
ADMINS=amine,ahmed,hassan
# Cmnd alias specification
175

Cmnd_Alias
ADMINTASKS=/usr/bin/aptget,/usr/bin/passwd
# User privilege specification
root ALL=)ALL( ALL
ADMINS ALL=ADMINTASKS
. :
:
ADMINS=amine,ahmed,hassan

User_Alias

.
ADMINS
.
:
Cmnd_Alias
ADMINTASKS=/usr/bin/aptget,/usr/bin/passwd
ADMINTASKS
:
ADMINS ALL=ADMINTASKS
ADMINS
ADMINTASKS .ALL
:
:
ALL=/usr/bin/apt-get,/usr/bin/passwd
amine apt-get passwd

176

amine

) 192.168.0.1 localhost (
:
:
Host_Alias

HOSTS= localhost, 192.168.0.1

. HOSTS
: HOSTS ALL
:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command
as root.
#
# See the man page for details on how to write a
sudoers file.
#
Defaults

env_reset

# Host alias specification


Host_Alias
HOSTS= localhost, 192.168.0.1
# User alias specification
User_Alias
ADMINS=amine,ahmed,hassan
# Cmnd alias specification
Cmnd_Alias
ADMINTASKS=/usr/bin/aptget,/usr/bin/passwd
# User privilege specification
root ALL=)ALL( ALL

177

ADMINS HOSTS=ADMINTASKS
: :
:
visudo -c
(
: ) amine
:
sudo -l
: .
:
amine@pc-amine:~$ sudo -l
We trust you have received the usual lecture from the
local System
Administrator. It usually boils down to these three
things:
#1( Respect the privacy of others.
#2( Think before you type.
#3( With great power comes great responsibility.
Password:
User amine may run the following commands on this
host:
)root( /usr/bin/apt-get, /usr/bin/passwd
amine@pc-amine:~$

178

amine ( apt-get
)update :
:
amine@pc-amine:~$ apt-get update
E: Could not open lock file /var/lib/apt/lists/lock - open
()13 Permission denied
E: Unable to lock the list directory
:
:
amine@pc-amine:~$ sudo apt-get update
: sudo 15
. . 15

============oOo
ALL
:
ADMINS ALL=ADMINTASKS
ALL
amine HOSTS=ALL
amine root .HOSTS
ALL ALL=ALL
. .

179


.
. (
devel ) :
:
DEVELOPERS=amine,%devel

User_Alias

DEVELOPERS amine
.devel
( ) :
:
%devel ALL=/usr/bin/reboot
(!)
.
passwd
root root .
Cmnd_alias :
:
Cmnd_Alias
ADMINTASKS=/usr/bin/aptget,/usr/bin/passwd,!/usr/bin/passwd root

root
:
ALL=)ahmed(/usr/bin/whoami

amine

amine whoami ahmed :

180

:
amine@pc-amine:~$ sudo -u ahmed whoami
ahmed
amine : ahmed
:
ALL=)ahmed(ALL

amine

amine ahmed
:
:
sudo -u ahmed rm -rf /home/ahmed
sudo
sudo
.NOPASSWD :
:
ADMINS ALL=NOPASSWD:ADMINTASKS
amine ALL=)ahmed(NOPASSWD:/usr/bin/whoami

sudo 15
( .)NOPASSWD
:
:
timestamp_timeout=30

Defaults

.
0
.
.sudo -k

181

:
:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command
as root.
#
# See the man page for details on how to write a
sudoers file.
#
Defaults
Defaults

env_reset
timestamp_timeout=45

# Host alias specification


# User alias specification
User_Alias
ADMINS=amine
# Cmnd alias specification
Cmnd_Alias
ADMINTASKS=/usr/bin/aptget,/usr/bin/passwd
# User privilege specification
root ALL=)ALL( ALL
ADMINS ALL=ADMINTASKS
sudo .
:
: sudo
http://www.courtesan.com/sudo

182

Mini How to IPtables


sAFA7_eLNeT :

/ IPTables
.
: IPTables

ipchains ipfwadm
x.2.0 ipchains x.2.2 Russty
IPTables x.2.4
.
: IPTables

-1 /Filter .
-2 /Filter ipv4 ipv6
.
-3 ..NAT/NPAT etc. /

183

-4 .
-5
.
!
: IPTables


iptables -V
iptables
redhat
service iptables start
.
:

iptables -L
Policy
..

184

: INPUT / /

: FORWARD /
.
: OUTPUT / /


NAT
PREROUTING
. POSTROUTING


IPTables

: -P Policy
iptables -L
()policy ACCEPT
()policy DROP
/ P-
iptables -P INPUT DROP
.

185

: -A

iptables -A INPUT -p icmp -j DROP


icmp INPUT + -A
-A
. INPUT 0r OUTPUT ..etc
: -L
.
: -s IP
-d
: -p .
: -N IPTables
-N

iptables -N SOFY

iptables -L
SOFY .

186

: -X SOFY
.
: -R
iptables -R INPUT 1 -p icmp -j ACCEPT
icmp
.
: -F !

.
: -D
iptables -D INPUT 1
INPUT .
.. ..
:

: ACCEPT
:DROP IPTables
DROP

187


DROP .
: LOG
ACCEPT DROP
.. .
REJECT

SOFY
IP/

SOFY Policy
DROP INPUT 80
SOFY -s

.


man iptables
...

188

Mini How to Restrict Services


sAFA7_eLNeT :


..

()Firewall iptables -1
()TCP Wrappers -2


.
..
1980


Main frame


PC , Mini Computer



..

.
189



..

IPtables
*
iptables -A INPUT -p tcp --dport 22 -s 10.0.0.5 -j DROP
10.0.0.5 22

.

..

iptables -N port22
iptables -A INPUT -p tcp --dport 22 -j port22
iptables -A port22 -s 10.0.0.8 -j ACCEPT
iptables -A port22 -j DROP
port22
22
port22
10.0.0.8
.

190

:
22
!

22
22 port22
port22
10.0.0.8

port22 22
.
SSH




.

191

..
TCP Wrappers


/
daemonname list/user



!

/etc/hosts.allow

/etc/hosts.deny
/
1
/etc/hosts.allow
sshd : 10.0.0.8
/etc/hosts.deny
sshd : all

192


SSH
ALL
.

/etc/hosts.allow

/etc/hosts.deny ..
2
/etc/hosts.deny
sshd : ALL EXCEPT 10.0.0.8
Ssh

/etc/hosts.deny .
EXCEPT /etc/hosts.deny
3
/etc/hosts.allow
sshd : 10.0.0.8 127.0.0.1
/etc/hosts.deny
sshd : 10.0.0.8

193

SSH
!
10.0.0.8

/etc/hosts.allow

4
/etc/hosts.allow
httpd : LOCAL
/etc/hosts.deny
httpd : ALL


LOCAL .

SSHD
httpd
in.tftpd
..


" PAM "
:


194


/..


man iptables
man 5 hosts_access
..

195

HowTo Kernel Compilation



compiling


http://www.linuxac.org/showthread.php?t=378

compiling Debian ubuntu
kubuntu


compiling
-1 compiler gcc gcc 4.0.3
-2 kernel-package , libncurses5 ,
libncurses5-dev , libqt3-mt-dev , bin86

ubuntu

:
update
install build-essential
install kernel-package
install gcc
install gcc-3.4
196

apt-get
apt-get
apt-get
apt-get
apt-get

sudo
sudo
sudo
sudo
sudo

install libncurses5
install libncurses5-dev
install libqt3-mt-dev
install bin86
root

apt-get
apt-get
apt-get
apt-get
passwd

sudo
sudo
sudo
sudo
sudo

:
su
:
:
CC=gcc-3.4
export CC
exit
CC=gcc-3.4
export CC
packges packges
ubuntu
* : nvidia
modules


structure processor
:

197

:
uname -a
compilation
/http://www.kernel.org/pub/linux/kernel/v2.6

linux-2.6.18.tar.bz2
-3
Desktop /usr/src
:
* ubuntu
sudo .
: cd Desktop
:
:
sudo cp linux-2.6.18.tar.bz2 /usr/src

-4
bz2 :
:
sudo tar -jxf linux-2.6.18.tar.bz2

198

gz :
:
sudo tar -zxf linux-2.6.18.tar.gz
-5
directory linux-2.6.18 linux
:
:
sudo ln -s /usr/src/linux-2.6.18 /usr/src/linux
-6
make :
:
cd /usr/src/linux
-7 config
/usr/src/linux load configuration
:
:
sudo cp /boot/boot/config-2.6.15-23-386 .config
: config-2.6.15-23-386 .config
config
:

199

:
ls -a /boot



http://linuxac.org/showthread.php?t=378

text-based GUI-Based
-8 make menuconfig /
/usr/src/linux :
:
sudo make menuconfig
:

200

-9
load an Alternate Configuration File Enter
:

201

-10 enter
Save Configuration to an Alternate File
:

202

-11 .config :

203

-12 enter right arrow


Exit
-13 hackobacko :menuconfig

* :
select help exit
:exit
help .
space bar

*
M module
libraries
libraries
* built
in kernel
*
M modules

bootable disk
modules
.
(
) ubuntu

204

-14 :
:
sudo make-kpkg clean
-15 :
:
sudo make-kpkg --initrd --append-to-version=-custom
kernel_image kernel_headers modules_image

* : custom

-16
ls
linux :
:
kernel-image-2.6.12-custom_10.00.Custom_i386.deb
kernel-headers-2.6.12-custom_10.00.Custom_i386.deb
-17 :
:
sudo dpkg -i kernel-image-2.6.12-custom_10.00.Custom_i386.deb
sudo dpkg -i kernel-headers-2.6.12-custom_10.00.Custom_i386.deb

restart
205

10 ubuntu

* : ubuntu
make kpkg
Suse Fedora

GUI-Based make
xconfig :
::
sudo make xconfig

make xconfig :

206

save
load .config load

compilation
modules compiling

207

Processor type and features -A "Symmetric multi-processing support" SMP


processor

-B Processor Family
processor ( ) i386
uname -a
scroll High Memory
Support Ram 1
4G


kernel hacking
OS concepts kernel stack
modems
kernel hacking

make xconfig :
:
make bzImage
:
make modules

208

:
make_modules_install
:
make install
( 9
)
* :
: Tip compiling
ctrl+c

/usr/src/linux make bzImage

boot loader lilo
:
:
nano -w /etc/lilo.conf
:
:
image = /vmlinuz
label = linux
root = /dev/hda1

209

:
:
image = /usr/src/linux/arch/i386/boot/bzImage
label = new
:
:
root = /dev/hda1
ctrl+x Y
new

:
:
cd /usr/src/linux
make install /vmlinuz

grub boot loader
:
menu.lst :

210

:
nano -w /boot/grub/menu.lst

nano -w /etc/grub.conf
:
title
Ubuntu, kernel 2.6.15-23-386
root
)hd0,2(
kernel
/boot/vmlinuz-2.6.15-23-386
root=/dev/hda3 ro quiet splash
initrd
/boot/initrd.img-2.6.15-23-386
savedefault
boot
:
:
title
Ubuntu, kernel 2.6.18
root
)hd0,2(
kernel
/boot/vmlinuz-2.6.18 root=/dev/hda3 ro
initrd
/boot/initrd.img-2.6.18
savedefault
boot
title
Ubuntu, kernel 2.6.15-23-386
root
)hd0,2(
kernel
/boot/vmlinuz-2.6.15-23-386
root=/dev/hda3 ro quiet splash
initrd
/boot/initrd.img-2.6.15-23-386
savedefaul

211

boot
compilation




212









grub


:
System has recovered from serious problem that may cause
damage to your computer



(
) master boot
record

213


ubuntu

cd Desktop
alternate cd cd-rom bios cd-
rom first boot device
cd Ubuntu cd
installation in oem mode

:
Rescue a borken system
cd

:
choose language ======>english

:
choose your location ======> other ======> egypt

keyboard
:

214

your keyboard ======>american keyboard


cd

configure network DHCP
DHCP continue

:
configure network manually
enter ip
Netmask gateway dns
hostname

:
Enter rescue mode

:
Device to use as root filesystem

:

215

/dev/discs/disc0/part1/
/dev/discs/disc0/part2/
/dev/discs/disc0/part5/
/dev/discs/disc0/part6/
/dev/discs/disc0/part7/

root
d
d part5 e
part6


:
Rescue operation


Execute a shell in /dev/discs/disc0/part5

shell
environment
:

216

:
Reinstall Grub boot Loader

grub

:
? do you want to install grub to the master boot record

yes grub hd0



:
Reinstall Grub boot Loader
hd0 grub



217


HowTo
ubuntu dapper
6.06
upgrade ubuntu Edgy Eft
6.1

http://freewarearabia.com/news.php?readmore=106
upgrade GUI

:

:
Application => Accessories => Terminal
:
:
sudo update-manager -c

218

New distribution release "6.1" is


available

219

upgrade :

220

start upgrade

: Third party sources disabled


close
:
: dial-up
lol
221

start upgrade :

222

restart :

223

restart
:
:
sudo lsb_release -a
ubuntu edgy 6.1 upgrade
:
:
sudo sh /cdrom/cdromupgrade
:
:
sudo apt-cdrom add
sudo apt-get update
sudo apt-get dist-upgrade
:

224

:
sudo apt-get -f install
sudo dpkg --configure -a

225



......
rashaad2010 , dr_pc :
:


.....
.
:
aklman_10@hotmail.com:

226

227

228