0% found this document useful (0 votes)
48 views

Afficher Les Cartes Reseaux:: Root@debiantpeval: # Ifconfig Résultat

The document discusses configuring network interfaces, storage, users and groups on a Debian system. It shows how to: - View network interfaces and configure a static IP using ifconfig - Add a new disk and partition it - Create physical volumes, volume groups and logical volumes for storage using LVM - Format and mount the new storage - Create users and groups and assign permissions and homes on the new storage - Install and configure Apache to serve files from the new storage location

Uploaded by

Malick Diatta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Afficher Les Cartes Reseaux:: Root@debiantpeval: # Ifconfig Résultat

The document discusses configuring network interfaces, storage, users and groups on a Debian system. It shows how to: - View network interfaces and configure a static IP using ifconfig - Add a new disk and partition it - Create physical volumes, volume groups and logical volumes for storage using LVM - Format and mount the new storage - Create users and groups and assign permissions and homes on the new storage - Install and configure Apache to serve files from the new storage location

Uploaded by

Malick Diatta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Afficher les cartes réseaux :

root@debiantpeval:~# ifconfig

Résultat :

eth0 Link encap:Ethernet HWaddr 00:0c:29:98:61:02


inet adr:192.168.75.135 Bcast:192.168.75.255 Masque:255.255.255.0
adr inet6: fe80::20c:29ff:fe98:6102/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:65 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:8036 (7.8 KiB) TX bytes:7768 (7.5 KiB)

lo Link encap:Boucle locale


inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@debiantpeval:~# ifconfig –a

eth0 Link encap:Ethernet HWaddr 00:0c:29:98:61:02


inet adr:192.168.75.135 Bcast:192.168.75.255 Masque:255.255.255.0
adr inet6: fe80::20c:29ff:fe98:6102/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:353 errors:0 dropped:0 overruns:0 frame:0
TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:32450 (31.6 KiB) TX bytes:35304 (34.4 KiB)

eth1 Link encap:Ethernet HWaddr 00:0c:29:98:61:0c


BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Boucle locale


inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Configuration ip statique :

Sauvegarder d’abord le fichier de config


root@debiantpeval:~# cp /etc/network/interfaces /etc/network/interfaces.old
root@debiantpeval:~# ls -lrt /etc/network/interfaces.old

-rw-r--r-- 1 root root 277 août 19 09:44 /etc/network/interfaces.old


root@debiantpeval:~# ls -lrt /etc/network/

modification du fichier de conf :

root@debiantpeval:~# nano /etc/network/interfaces

## The loopback network interface


auto lo
iface lo inet loopback

## The primary network interface


allow-hotplug eth0
iface eth0 inet dhcp
# The primary network interface
#allow-hotplug eth1
#iface eth1 inet dhcp

auto eth1
iface eth1 inet static
address 192.0.2.8
netmask 255.255.255.0

après redémarrage

root@debiantpeval:~# ifconfig –a

eth0 Link encap:Ethernet HWaddr 00:0c:29:98:61:02


inet adr:192.168.75.135 Bcast:192.168.75.255 Masque:255.255.255.0
adr inet6: fe80::20c:29ff:fe98:6102/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:70 errors:0 dropped:0 overruns:0 frame:0
TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:8624 (8.4 KiB) TX bytes:8110 (7.9 KiB)

eth1 Link encap:Ethernet HWaddr 00:0c:29:98:61:0c


inet adr:192.0.2.8 Bcast:192.0.2.255 Masque:255.255.255.0
adr inet6: fe80::20c:29ff:fe98:610c/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:1382 (1.3 KiB) TX bytes:510 (510.0 B)

lo Link encap:Boucle locale


inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Mise à jour :

root@debiantpeval:~# apt-get update

vérifier présence disque dur ajoutée :

root@debiantpeval:~# ls -lrt /dev/sd*

brw-rw---T 1 root disk 8, 16 août 19 10:22 /dev/sdb


brw-rw---T 1 root disk 8, 0 août 19 10:22 /dev/sda
brw-rw---T 1 root disk 8, 2 août 19 10:22 /dev/sda2
brw-rw---T 1 root disk 8, 5 août 19 10:22 /dev/sda5
brw-rw---T 1 root disk 8, 1 août 19 10:22 /dev/sda1

root@debiantpeval:~# fdisk -l | more

Périphérique Amorce Début Fin Blocs Id Système


/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 41940991 20719617 5 Étendue
/dev/sda5 501760 41940991 20719616 8e LVM Linux

Disque /dev/sdb : 3221 Mo, 3221225472 octets


255 têtes, 63 secteurs/piste, 391 cylindres, total 6291456 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x00000000

root@debiantpeval:~# fdisk /dev/sdb

Creation de PV :

Création des FS :

root@debiantpeval:~# mkfs -t ext3 /dev/sdb1

Allocation des tables de groupe : complété


Écriture des tables d'i-noeuds : complété
Création du journal (8192 blocs) : complété
Écriture des superblocs et de l'information de comptabilité du système de
fichiers : complété

root@debiantpeval:~# mkfs -t ext3 /dev/sdb2

Allocation des tables de groupe : complété


Écriture des tables d'i-noeuds : complété
Création du journal (8192 blocs) : complété
Écriture des superblocs et de l'information de comptabilité du système de
fichiers : complété

Création dossier de montage :

root@debiantpeval:~# mkdir /data


root@debiantpeval:~# mkdir /appli

Création des PV :

root@debiantpeval:~# pvcreate /dev/sdb1

Writing physical volume data to disk "/dev/sdb1"


Physical volume "/dev/sdb1" successfully created

root@debiantpeval:~# pvcreate /dev/sdb2


Writing physical volume data to disk "/dev/sdb2"
Physical volume "/dev/sdb2" successfully created

Création VG :

root@debiantpeval:~# vgcreate vg01 /dev/sdb1


Volume group "vg01" successfully created

root@debiantpeval:~# vgrename vg01 vgdata


Volume group "vg01" successfully renamed to "vgdata"

root@debiantpeval:~# vgcreate vgappli /dev/sdb2


Volume group "vgappli" successfully created

Création des VG :

root@debiantpeval:~# lvcreate -n lv_data -L 512M vgdata


Logical volume "lv_data" created
Création FS

root@debiantpeval:~# mkfs -t ext4 /dev/vgdata/lv_data

Allocation des tables de groupe : complété


Écriture des tables d'i-noeuds : complété
Création du journal (4096 blocs) : complété
Écriture des superblocs et de l'information de comptabilité du système de
fichiers : complété
montage :

root@debiantpeval:~# mount -t ext4 /dev/vgdata/lv_data /data

Creation LV
root@debiantpeval:~# lvcreate -n lv_appli -L 1G vgappli
Logical volume "lv_appli" created

mkfs -t ext4 /dev/vgappli/lv_appli

Allocation des tables de groupe : complété


Écriture des tables d'i-noeuds : complété
Création du journal (8192 blocs) : complété
Écriture des superblocs et de l'information de comptabilité du système de
fichiers : complété

root@debiantpeval:~# mount -t ext4 /dev/vgappli/lv_appli /appli

Montage automatiquement :

root@debiantpeval:~# nano /etc/fstab

ajouter ces deux lignes :

UUID=ea80272b-f4e6-4534-bd8a-458b6b7ff96c /boot ext2 defaults 0$


/dev/mapper/debiantpeval-home /home ext4 defaults 0 2
/dev/mapper/debiantpeval-tmp /tmp ext4 defaults 0 2
/dev/mapper/debiantpeval-usr /usr ext4 defaults 0 2
/dev/mapper/debiantpeval-var /var ext4 defaults 0 2
/dev/mapper/debiantpeval-swap_1 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/vgappli/lv_appli /appli ext4 defaults 0 2
/dev/vgdata/lv_data /data ext4 defaults 0 2

verification :

root@debiantpeval:~# mount –a

Modification shell useradd


root@debiantpeval:~# nano /etc/default/useradd

SHELL=/bin/bash

HOME=/home/user/

SKEL=/etc/skel

root@debiantpeval:/etc/skel# mkdir dossierbienvenu


root@debiantpeval:/etc/skel# touch alire

root@debiantpeval:~# nano .bashrc

alias ll='ls $LS_OPTIONS -ltr'

alias motd='ls -ltr /etc/motd'

root@debiantpeval:~# ls -l /data/
total 28
drwxr-xr-x 2 root root 4096 août 19 11:51 admin
drwxr-xr-x 2 root root 4096 août 19 11:51 commun
drwx------ 2 root root 16384 août 19 11:11 lost+found
drwxr-xr-x 2 root root 4096 août 19 11:49 users

root@debiantpeval:~# chmod -R 775 /data/commun

root@debiantpeval:~# chmod g+s /data/commun

root@debiantpeval:~# groupadd commun


root@debiantpeval:~# groupadd appli
root@debiantpeval:~# groupadd admin

root@debiantpeval:~# useradd User1 -g commun -m


root@debiantpeval:~# useradd Appli1 -g appli -G commun -m
root@debiantpeval:~# useradd Admin1 -g admin -G commun -m
root@debiantpeval:~#

root@debiantpeval:~# chown root /data/commun


oot@debiantpeval:~# chgrp commun /data/commun
root@debiantpeval:~# chmod 741 /data/users
root@debiantpeval:~# chown root /data/users
root@debiantpeval:~# chgrp root /data/users
root@debiantpeval:~# chmod 770 /data/admin
root@debiantpeval:~# chgrp admin /data/admin

root@debiantpeval:~# apt-get install apache2

il marche si je tape 192.168.75.135 sur mon navigateur

root@debiantpeval:~# cp -r /var/www/ /appli/


<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>modification ok yattaaa</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>

root@debiantpeval:~# cd /etc/apache2/sites-available/
cp default default.old

mettre /appli/var au lieu /www/var


root@debiantpeval:/etc/apache2/sites-available# /etc/init.d/apache2 restart

ca marche .

root@debiantpeval:/etc/apache2/sites-available# ls -lrt /appli/www


total 4
-rw-r--r-- 1 root root 208 août 19 12:43 index.html

root@debiantpeval:/etc/apache2/sites-available# chgrp -R appli /appli/www


root@debiantpeval:/etc/apache2/sites-available# ls -lrt /appli/www
total 4
-rw-r--r-- 1 root appli 208 août 19 12:43 index.html

verification droit
root@debiantpeval:/etc/apache2/sites-available# ls -lrt /etc/init.d/apache2
-rwxr-xr-x 1 root root 7820 juil. 20 07:04 /etc/init.d/apache2

Appli1@debiantpeval:~$ /etc/init.d/apache2 status


Apache2 is running (pid 3901).

Essaie d’arret ne marche pas


Appli1@debiantpeval:~$ /etc/init.d/apache2 stop
[....] Stopping web server: apache2/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not
permitted)
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for
ServerName
. ok

visudo

Appli1 ALL= /etc/init.d/apache2

Appli1@debiantpeval:~$ sudo /etc/init.d/apache2 stop


[sudo] password for Appli1:
[....] Stopping web server: apache2apache2: Could not reliably determine the server's fully qualified
domain name, using 127.0.1.1 for ServerName
[ ok waiting .

augmenter la taille
root@debiantpeval:~# lvextend -L +512M /dev/vgappli/lv_appli
Extending logical volume lv_appli to 1,50 GiB
Logical volume lv_appli successfully resized

root@debiantpeval:~# resize2fs /dev/vgappli/lv_appli


resize2fs 1.42.5 (29-Jul-2012)
Le système de fichiers de /dev/vgappli/lv_appli est monté sur /appli ; le changement de taille doit être
effectué en ligne
old_desc_blocks = 1, new_desc_blocks = 1
En train d'effectuer un changement de taille en ligne de /dev/vgappli/lv_appli vers 393216 (4k) blocs.
Le système de fichiers /dev/vgappli/lv_appli a maintenant une taille de 393216 blocs.

Création compte Samba

root@debiantpeval:~# smbpasswd -a User1


New SMB password:
Retype new SMB password:
Added user User1.
root@debiantpeval:~# smbpasswd -a Appli1
New SMB password:
Retype new SMB password:
Added user Appli1.
root@debiantpeval:~# smbpasswd -a Admin1
New SMB password:
Retype new SMB password:
Added user Admin1.

[commun]
path = /data/commun
comment = partage des log
browseable = no
writeable = no
valid users = commun

[admin]
path = /data/admin
comment = partage des log
browseable = no
writeable = no
valid users = Admin1

[appli]
path = /appli
comment = partage des log
browseable = no

creation et verification
root@debiantpeval:~# ls /data/commun/
motd_bis

creation rebond

root@debiantpeval:/data/admin# useradd rebond -d /home/rebond -m

You might also like