hine macc - linux.it
TRANSCRIPT
Linux-VServer
Lin
ux-
VS
erve
rU
na
mac
chin
a,ta
nte
mac
chin
e.
Mic
kyD
elFa
vero
-D
ino
Del
Fave
ro
mic
ky@
delf
aver
o.it
-di
no@
delf
aver
o.it
BL
UG
-B
ellu
noL
inux
Use
rG
roup
Lin
uxD
ay20
05-
Feltr
e26
nove
mbr
e20
05
Lin
ux-V
Serv
er–
p.1/
??
Linux-VServerC
os’
èV
Ser
ver
Un
sist
ema
dipa
rtiz
iona
men
toba
sato
suiS
ecur
ityC
onte
xts
che
perm
ette
dicr
eare
più
Vir
tual
Priv
ate
Ser
vers
(VP
S)
sim
iliad
unse
rver
norm
ale
che
cond
ivid
ono
lest
esse
risor
seha
rdw
are
elo
stes
soke
rnel
.
Un
VP
Sè
unse
rver
virt
uale
che,
dalp
unto
divi
sta
dei
proc
essi
che
ospi
ta,è
intu
ttoe
per
tutto
ugua
lead
unse
rver
real
e.
Lin
ux-V
Serv
er–
p.2/
??
Linux-VServerC
arat
teri
stic
he
Una
sola
mac
chin
afis
ica
eun
solo
kern
elco
ndiv
isif
ratu
ttiiV
Ser
ver.
Su
ogni
VS
erve
rpu
òve
nir
inst
alla
taun
aqu
alsi
asi
dist
ribuz
ione
.
Ogn
ipro
cess
odi
ogni
VS
erve
rgi
raal
lam
assi
ma
velo
cità
poss
ibile
com
egi
rass
esu
lser
ver
host
.
Qua
lsia
sise
rviz
iopu
òve
nir
lanc
iato
suun
VS
erve
rse
nza
nece
ssità
dim
odifi
caal
cuna
rispe
ttoad
unse
rver
real
e.
Ogn
iVS
erve
rha
ilpr
oprio
data
base
diut
enti
dist
inti
dagl
ialtr
i(in
clus
oro
ot).
Lin
ux-V
Serv
er–
p.3/
??
Linux-VServerV
anta
gg
i
Per
form
ace
iden
tiche
adun
serv
erre
ale,
noov
erhe
ad!
Min
ima
occu
pazi
one
disp
azio
sudi
sco
graz
ieal
laco
ndiv
isio
nede
ibin
arif
raiv
ariV
Ser
ver.
Indi
pend
enza
deiV
Ser
ver
dall’
hard
war
ede
glih
osts
ucu
igira
nopu
rché
l’arc
hite
ttura
sia
com
patib
ile.
Gli
stru
men
tidi
amm
inis
traz
ione
sico
mpo
rtan
oco
me
suun
serv
erre
ale.
Sic
urez
za:
unV
Ser
ver
anch
ese
com
prom
esso
riman
eis
olat
oda
glia
ltri.
Lin
ux-V
Serv
er–
p.4/
??
Linux-VServerTe
cno
log
iad
iLin
ux-
VS
erve
r
Ilke
rnel
stan
dard
forn
isce
mol
tede
llese
curit
yfe
atur
esch
eve
ngon
out
ilizz
ate
daLi
nux-
VS
erve
rpe
rim
plem
enta
reil
sist
ema
divi
rtua
lizza
zion
e:
Linu
xC
apab
ility
Sys
tem
Res
ourc
eLi
mits
File
Attr
ibut
es
Cha
nge
Roo
t
Lin
ux-V
Serv
er–
p.5/
??
Linux-VServerM
od
ifich
eal
kern
el
Alfi
nedi
gara
ntire
l’iso
lam
ento
fra
ivar
iVS
erve
rch
eco
ntem
pora
neam
ente
gira
none
ll’ho
stè
nece
ssar
ioap
port
are
alcu
nem
odifi
che
alke
rnel
,ess
eso
no:
Con
text
Sep
arat
ion
Net
wor
kS
epar
atio
n
The
Chr
ootB
arrie
r
Upp
erB
ound
for
Cap
s
File
syst
emX
IDTa
ggin
g
Lin
ux-V
Serv
er–
p.6/
??
Linux-VServerC
on
text
Sep
arat
ion
Losc
opo
èqu
ello
dina
scon
dere
alco
ntes
topr
eso
ines
ame
tutti
ipro
cess
iald
ifuo
ridi
esso
epr
oibi
requ
alsi
asi
inte
razi
one
fra
proc
essi
appa
rten
enti
aco
ntes
tidi
vers
i.
Siè
resa
nece
ssar
ial’e
sten
sion
edi
alcu
nest
ruttu
reda
tipe
rre
nder
lese
nsib
iliai
cont
esti
epe
rpe
rmet
tere
ladi
ffere
nzia
zion
edi
iden
ticiu
idus
atii
nco
ntes
tidi
ffere
nti.
Un
cont
esto
dide
faul
t,id
entic
oa
tutti
glia
ltri,
èus
ato
per
perm
ette
reil
boot
dell’
host
.
Uno
spec
iale
cons
test
o,S
pect
ator
,per
met
teun
avi
sta
glob
ale
deip
roce
ssip
rese
ntin
ell’h
ost.
Lin
ux-V
Serv
er–
p.7/
??
Linux-VServerN
etw
ork
Sep
arat
ion
Un’
ulte
riore
sepa
razi
one
ène
cess
aria
per
confi
nare
ipr
oces
siin
unso
ttoin
siem
ede
llosp
azio
degl
iind
irizz
idi
rete
disp
onib
ilial
l’hos
t.
Per
gara
ntire
l’iso
lam
ento
biso
gna
tene
rco
nto
dipa
recc
hipr
oble
mic
hepo
treb
bero
sorg
ere,
com
epe
res
empi
oil
pote
r,da
part
edi
unpr
oces
so,f
are
ilbi
ndin
gde
ll’in
diriz
zosp
ecia
leIP
AD
DR
_AN
Y,qu
esto
èga
rant
itoes
sere
poss
ibile
senz
am
odifi
caal
cuna
alpr
oces
soch
egi
rane
lVS
erve
r.
Alfi
nedi
ridur
rel’o
verh
ead
risul
tant
eno
nsi
faus
odi
netw
ork
devi
cevi
rtua
li,si
èin
vece
inte
rven
utis
ulsi
stem
adi
bind
ing
deis
ocke
tede
lpac
kett
rans
mis
sion
all’i
nter
node
lker
nel.
Lin
ux-V
Serv
er–
p.8/
??
Linux-VServerT
he
Ch
roo
tB
arri
er
Uno
deip
robl
emic
heaf
fligg
ono
lach
iam
ata
asi
stem
ach
root
()di
Linu
xè
che
l’inf
orm
azio
neas
soci
ata
ach
root
()è
vola
tile
epu
òve
nir
pers
aal
lasu
cces
siva
chia
mat
a,è
suffi
cien
tech
eun
proc
esso
chia
mio
pen(
),ch
root
()e
fchd
ir()
perc
héqu
esto
avve
nga.
Lepr
ime
vers
ioni
diLi
nux-
VS
erve
rha
nno
cerc
ato
diris
olve
reil
prob
lem
ain
vari
mod
i,at
tual
men
tesi
usa
unm
odo
mol
tose
mpl
ice
edef
ficac
e:un
mar
k,ch
iam
ato
Chr
ootB
arrie
r,m
esso
nella
dire
ctor
ypa
dre
delV
Ser
ver
che
impe
disc
elo
scon
finam
ento
.
Lin
ux-V
Serv
er–
p.9/
??
Linux-VServerU
pp
erB
ou
nd
for
Cap
s
Dat
och
ele
Linu
xC
apab
ility
non
impl
emen
tano
lapa
rte
rela
tiva
alfil
esys
tem
desc
ritta
daP
OS
IXC
apab
ilitie
sch
ere
nder
ebbe
glie
segu
ibili
setu
ide
setg
idsi
curi
ech
eè
più
sicu
roav
ere
unup
per
boun
dsi
curo
per
tutti
ipro
cess
iin
unco
ntes
tosi
èag
giun
taun
aul
terio
rem
asch
era
dica
pabi
lity
che
limita
tutti
ipro
cess
iapp
arte
nent
ialc
onte
sto
della
mas
cher
a.
Lin
ux-V
Serv
er–
p.10
/??
Linux-VServerF
ilesy
stem
XID
Tag
gin
g
Mod
ifica
nece
ssar
iape
rav
ere
unm
aggi
oris
olam
ento
dei
cont
esti
epe
rpo
ter
abili
tare
ilC
onte
stD
isk
Lim
ite
ilP
erC
onte
xtQ
uota
Sup
port
suun
apa
rtiz
ione
cond
ivis
afr
api
ùV
Ser
ver.
Agg
iung
ere
unco
nteX
tID
adog
nifil
eno
nè
bana
lepe
rché
richi
ede
ola
mod
ifica
alla
rapp
rese
ntaz
ione
sudi
sco
del
files
yste
mop
pure
nece
ssita
disf
rutta
requ
alch
ebi
tdel
lest
ruttu
reda
ties
iste
nti.
Una
solu
zion
eno
nin
vasi
vaco
nsis
tene
llosf
rutta
reib
itpi
ùsi
gnifi
cativ
idiU
IDe
GID
per
mem
oriz
zare
loX
ID.
Lin
ux-V
Serv
er–
p.11
/??
Linux-VServerF
ilesy
stem
XID
Tag
gin
g
Una
volta
che
l’inf
orm
azio
nesu
lcon
test
oè
disp
onib
ilein
ogni
inod
ela
succ
essi
vam
odifi
caco
mpr
ende
este
nder
eil
cont
rollo
diac
cess
oin
mod
ota
lech
eco
nsid
eria
nche
ilco
ntes
to.
Attu
alm
ente
tutti
glia
cces
siag
liin
ode
cons
ider
ano
lere
striz
ioni
rigua
rdan
tiil
cont
esto
adec
cezi
one
diqu
elli
fatti
neic
onte
stiH
oste
Spe
ctat
or.
Un
file
che
non
halo
XID
vien
eco
nsid
erat
oap
part
enen
teal
cont
esto
Hos
t.A
llapr
ima
mod
ifica
alfil
elo
XID
cam
bia
edi
vent
aqu
ello
delc
onte
sto
incu
ièav
venu
tala
mod
ifica
.
Lin
ux-V
Serv
er–
p.12
/??
Linux-VServerTa
gg
ing
Met
ho
ds
UID
32/G
ID32
oE
XT
ER
NA
LU
tiliz
zalo
spaz
ioin
utili
zzat
oal
l’int
erno
degl
iino
depe
rm
emor
izza
rel’i
nfor
maz
ione
,ma
richi
ede
mod
ifica
alfil
esys
tem
(ext
2/3
ok,p
rest
ogl
ialtr
i).V
anta
ggi:
UID
eG
IDa
32bi
t.
UID
32/G
ID16
I16
bitp
iùsi
gnifi
cativ
idel
GID
port
ano
l’inf
orm
azio
nere
lativ
aal
loX
IDtr
aspa
rent
emen
te.
Van
tagg
i:fu
nzio
naco
ntu
ttiifi
lesy
stem
.S
vant
aggi
:G
IDrid
otto
a16
bit.
UID
24/G
ID24
Gli
8bi
tpiù
sign
ifica
tivid
iUID
eG
IDpo
rtan
ol’i
nfor
maz
ione
rela
tiva
allo
XID
tras
pare
ntem
ente
.V
anta
ggi:
funz
iona
con
tutti
ifil
esys
tem
.S
vant
aggi
:U
IDe
GID
ridot
tia
24bi
t.
Lin
ux-V
Serv
er–
p.13
/??
Linux-VServerU
lter
iori
feat
ure
s
Linu
x-V
Ser
ver
oltr
ea
gara
ntire
l’iso
lam
ento
deiV
Ser
ver
sull’
host
hain
sèul
terio
rica
ratte
ristic
heim
port
anti:
Uni
ficat
ion
Priv
ate
Nam
espa
ces
Toke
nB
ucke
tExt
ensi
ons
Con
text
Dis
kLi
mits
eP
er-C
onte
xtQ
uota
Lin
ux-V
Serv
er–
p.14
/??
Linux-VServerU
nifi
cati
on
File
com
unia
più
cont
esti
che
real
istic
amen
teno
nca
mbi
ano
mol
tosp
esso
(libr
erie
obi
nari)
poss
ono
esse
reha
rd-li
nkat
irid
ucen
dol’o
ccup
azio
nedi
disc
o,il
cach
ing
degl
iino
dee
lam
appa
inm
emor
iade
llelib
rerie
cond
ivis
e.
Pro
blem
a:co
dice
mal
igno
inun
cont
esto
può
dist
rugg
ere
om
odifi
care
ifile
cond
ivis
imin
ando
lasi
cure
zza.
Ifile
cond
ivis
iven
gono
resi
imm
utab
ilius
ando
l’Im
mut
able
File
Attr
ibut
ee
rimuo
vend
oda
icon
test
ila
capa
bilit
yne
cess
aria
am
odifi
care
ques
toat
trib
uto.
Un
attr
ibut
oad
dizi
onal
epe
rmet
tela
rimoz
ione
cont
esto
-dip
ende
nte
dell’
attr
ibut
oIm
mut
able
per
perm
ette
reag
gior
nam
ento
dilib
rerie
obi
nari
all’i
nter
nodi
unco
ntes
to.
Lin
ux-V
Serv
er–
p.15
/??
Linux-VServerTo
ken
Bu
cket
Ext
ensi
on
s
Usa
tope
rco
ntro
llare
ladi
strib
uzio
nede
lleris
orse
qual
i:H
ard
CP
ULi
mit,
Sch
edul
erP
riorit
ies
eN
etw
ork
Ban
dwid
thLi
mita
tion,
fra
ivar
icon
test
i.
Per
ogni
quan
todi
tem
poT
un“b
ucke
t”di
dim
ensi
one
Sè
riem
pito
con
una
quan
tità
Rdi
“tok
en”.
Ad
ogni
tick
del
cloc
k,un
proc
esso
ines
ecuz
ione
cons
uma
unto
ken
del
buck
et,q
uand
oil
buck
etè
vuot
oil
proc
esso
vien
epo
sto
inun
aco
daho
ldfin
ché
una
quan
tità
min
ima
Mdi
toke
nno
nvi
ene
ripris
tinat
ane
lbuc
ket,
ilpr
oces
sopo
isar
àris
ched
ulat
o.
Lin
ux-V
Serv
er–
p.16
/??
Linux-VServerC
on
text
Dis
kL
imit
se
Per
-Co
nte
xtQ
uo
ta
Co
nte
xtD
isk
Lim
its:
Attr
aver
sol’u
sode
ltag
XID
suifi
levi
ene
tenu
toco
nto
del
num
ero
degl
iino
dee
deib
locc
hius
atip
erog
nifil
esys
tem
rend
endo
poss
ibile
impl
emen
tare
iDis
kLi
mit
per
ogni
cont
esto
.
Ival
orid
iuso
corr
ente
,mas
sim
oe
riser
vato
sono
mos
trat
iad
ogni
richi
esta
sulfi
lesy
stem
com
eog
nico
ntes
tofo
sse
suun
files
yste
mris
erva
to.
Per
-Co
nte
xtQ
uo
ta:
Usa
hash
sepa
rati
per
idiff
eren
tico
ntes
tisu
unfil
esys
tem
cond
ivis
o,no
nè
nece
ssar
iape
rab
ilita
rela
quot
asu
VS
erve
rch
eris
iedo
nosu
diffe
rent
ipar
tizio
ni.
Lin
ux-V
Serv
er–
p.17
/??
Linux-VServerU
nes
emp
iop
rati
co
Sic
ompi
laun
kern
elpa
tcha
toco
nLi
nux-
VS
erve
re
siin
stal
laco
nip
acch
etti
nece
ssar
i:micky@teodora:~$cd/usr/src
micky@teodora:~$wgethttp://www.kernel.org/pub/linux/\
kernel/v2.6/linux-2.6.12.4.tar.bz2
micky@teodora:~$wgethttp://www.13thfloor.at/vserver/\
s_rel26/v2.0/patch-2.6.12.4-vs2.0.diff
micky@teodora:~$tar-jxvflinux-2.6.12.4.tar.bz2
micky@teodora:~$cdlinux-2.6.12.4
micky@teodora:~$bzcat../patch-2.6.12.4-vs2.0.diff.bz2|patch-p1
micky@teodora:~$make-jmenuconfig
micky@teodora:~$fakerootmake-kpkgkernel_image
micky@teodora:~$cd..
micky@teodora:~$su-
root@teodora:~#dpkg-ikernel-image-2.6.12.4-vs2.0_i386.deb
root@teodora:~#apt-getinstallutil-vservervserver-debiantools
Lin
ux-V
Serv
er–
p.18
/??
Linux-VServerU
nes
emp
iop
rati
co
Sic
rea
ilV
Ser
ver:
root@teodora:~#newvserver--hostnamecandy--domainmesina.net\
--ip10.221.34.12
I:Retrievingdebootstrap.invalid_dists_sarge_Release
...
Servercandyisnotrunning
Restartingrebootmgr.
Stoppingtherebootmanager
Startingtherebootmanager
Youshouldnowadjust/etc/vservers/candy.conftosuityourneeds,
orelsejustgoaheadandtype‘vservercandystart’tostart
yournewvirtualserver.
debian/rules!
root@teodora:~#
Lin
ux-V
Serv
er–
p.19
/??
Linux-VServerU
nes
emp
iop
rati
co
Esi
fafa
reil
boot
alV
Ser
ver:
root@teodora:~#vservercandystart
Startingthevirtualservercandy
Hostnameisnowcandy
Newsecuritycontextis49158
Startingsystemlogdaemon:syslogd.
...
root@teodora:~#vservercandyenter
ipv4rootisnow10.221.34.12
Newsecuritycontextis49158
candy:/#
uname-a
Linuxcandy2.6.12.4-vs2.0
candy:/#exit
logout
root@teodora:~#
Lin
ux-V
Serv
er–
p.20
/??
Linux-VServer
Dom
ande
?G
razi
epe
rl’a
ttenz
ione
.
Lin
ux-V
Serv
er–
p.21
/??