UE31 - M3102 : Services Réseaux



Documents pareils
Corrigé du TP 6 Réseaux

UE31 - M3102 : Services Réseaux

Administration Linux - FTP

Configuration réseau Basique

Couche application. La couche application est la plus élevée du modèle de référence.

Quelques protocoles et outils réseaux

FTP & SMTP. Deux applications fondamentales pour le réseau Internet.

ftp & sftp : transférer des fichiers

INSTALLATION DEBIAN. Installation par le réseau

ASRb/Unix Avancé II. Chapitre 2. Utilitaires réseaux. Arnaud Clérentin, IUT d Amiens, département Informatique

DHCPD v3 Installation et configuration

Corrigé du TP 6 Réseaux

Instructions Mozilla Thunderbird Page 1

FTP. Table des matières

Plan. Le système de transfert de fichiers d'internet. Introduction aux systèmes de transfert de fichiers Le protocole FTP.

Serveur DHCP et Relais DHCP (sous Linux)

Connexion à un réseau local: Configuration et dépannage

Imprimantes et partage réseau sous Samba avec authentification Active Directory

TP SECU NAT ARS IRT ( CORRECTION )

Serveur Linux : FTP. Mise en place d un service FTP sous Linux. Bouron Dimitri 20/04/2014

TP DHCP et DNS. Université Pierre Mendès France U.F.R. Sciences de l Homme et de la Société Master IC²A

Réseau - VirtualBox. Sommaire

1 Configuration des Fichiers Hosts, Hostname, Resolv.conf

INFO-F-404 : Techniques avancées de systèmes d exploitation

WEBMESTRE : CONCEPTION DE SITES ET ADMINISTRATION DE SERVEURS WEB

Administration UNIX. Le réseau

PPe jaune. Domingues Almeida Nicolas Collin Leo Ferdioui Lamia Sannier Vincent [PPE PROJET FTP]

Administration Réseau sous Ubuntu SERVER Serveur DHCP

Projet Administration Réseaux

Serveur de messagerie sous Debian 5.0

Internet Protocol. «La couche IP du réseau Internet»

TP LINUX : LINUX-SAMBA SERVEUR DE FICHIERS POUR UTILISATEURS WINDOWS

HAUTE DISPONIBILITÉ DE MACHINE VIRTUELLE AVEC HYPER-V 2012 R2 PARTIE CONFIGURATION OPENVPN SUR PFSENSE

Services Réseau SSH. Michaël Hauspie. Licence Professionnelle Réseaux et Télécommunications

TP LINUX : MISE EN PLACE DU SERVEUR DE MESSAGERIE QMAIL

FTP est défini au dessus de TCP et utilisent deux connexions TCP IP pour fonctionner comme illustré dans la figure suivante

CONFIGURATION DE OPENVPN AVEC CLIENT FEDORA ET CLIENT WINDOWS. Distribution : Fedora 14 Noyau GNU/Linux : Version document : 1

Introduction au Système d Exploitation Unix/Linux

SSH, le shell sécurisé

CH3 Réseaux. Rappels sur les réseaux

Le service FTP. M.BOUABID, Page 1 sur 5

Les commandes relatives aux réseaux

ASR4 Réseaux Département Informatique, IUT Bordeaux 1. DHCP Prénom : Nom : Groupe :

FTP & SMTP. File Transfert Protocol. Deux applications fondamentales pour le réseau Internet. Un protocole d échange de fichier «au dessus» de TCP :

Installer un domaine DNS

TP n 2 : Installation et administration du serveur ProFTP. Partie 1 : Fonctionnement du protocole FTP (pas plus de 15min)

(1) Network Camera

Micronator SME-8.0 & Service FTP

Attribution dynamique des adresses IP

DOCUMENTATION - FRANCAIS... 2

pare - feu généralités et iptables

Instructions pour mettre à jour un HFFv2 v1.x.yy v2.0.00

TABLE DES MATIERES A OBJET PROCEDURE DE CONNEXION

IceWarp serveur sur Linux : Guide d'installation

Guide Installation de Fully Automated NAGIOS 2.3 sur Hyper-V

Introduction. Adresses

Vanilla : Virtual Box

Enoncé du TP 7 Réseaux

Administration Système & Réseau. Domain Name System Historique & Concepts Fonctionnalités & Hiérarchie Requêtes & Base de donnée DNS

Atelier La notion de session utilisateur sous Linux

WiFi Security Camera Quick Start Guide. Guide de départ rapide Caméra de surveillance Wi-Fi (P5)

IP & Co. 1. Service DHCP. L'objectif de ce TP est de voir l'ensemble des services élémentaires mis en oeuvre dans les réseaux IP.

VTP. LAN Switching and Wireless Chapitre 4

Enoncé du TP 7 Réseaux

Administration du WG302 en SSH par Magicsam

Configuration d un firewall pour sécuriser un serveur WEB

Mise en œuvre de Rembo Toolkit

Guide Installation Serveur Extensive Testing

WEB page builder and server for SCADA applications usable from a WEB navigator

Installation d'un Contrôleur Principal de Domaine SAMBA 4

BAP E Gestionnaire de parc informatique et télécommunications MI2 / MI3 Ouverts au titre de 2010 Arrêté du 7/04/10 - J.

Micro-ordinateurs, informations, idées, trucs et astuces utiliser le Bureau à distance

Guide Installation Serveur Extensive Testing

Sécurité des systèmes d exploitation

Gestion des journaux

Protocoles Applicatifs

Réseaux. 1 Généralités. E. Jeandel

TP : Introduction à TCP/IP sous UNIX

Administration Système

L3 informatique TP n o 2 : Les applications réseau

Ocs Inventory et GLPI s appuie sur un serveur LAMP. Je vais donc commencer par installer les paquets nécessaires.

Chapitre IX : Virtualisation

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

Table des matières. 1. Installation de VMware ESXI Pré-requis Installation... 3

Manuel des logiciels de transferts de fichiers File Delivery Services

Introduction aux réseaux TCP/IP.

Année Universitaire session 1 d automne Parcours : CSB5 Licence 3 STS Informatique

module Introduction aux réseaux DHCP et codage Polytech / 5

Les différentes méthodes pour se connecter

Contents Windows

Le protocole ARP (Address Resolution Protocol) Résolution d adresses et autoconfiguration. Les protocoles ARP, RARP, TFTP, BOOTP, DHCP

Règles et paramètres d'exploitation de Caparmor 2 au 11/12/2009. Pôle de Calcul Intensif pour la mer, 11 Decembre 2009

Utiliser une WebCam. Micro-ordinateurs, informations, idées, trucs et astuces

Installation d un Serveur de Messagerie

L3 informatique Réseaux : Configuration d une interface réseau

SERVEUR DÉDIÉ DOCUMENTATION

Les techniques de la télémaintenance

Outils d'analyse de la sécurité des réseaux. HADJALI Anis VESA Vlad

Transcription:

UE31 - M3102 : Services Réseaux Corrigé du TP 3 Services FTP et DHCP C. Pain-Barre 1 FTP 1.6 Exercices Corrigé de l exercice 1 (Session FTP graphique à allegro) Cet exercice ne devrait pas poser de problèmes particuliers. La fenêtre de gftp devrait ressembler à celle de la figure 1. FIGURE 1 Transfert de fichier par FTP réalisé avec gftp 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 2/22 Corrigé de l exercice 2 (Session FTP en mode texte à allegro) toto@pc$ ftp allegro Connected to allegro.aix.univ-amu.fr. 220 allegro.aix.univ-amu.fr FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready. Name (allegro:toto): etxxxx 331 Password required for etxxxx. Password: mon password 230- Linux allegro 2.6.32-5-686 #1 SMP Sat May 5 01:33:08 UTC 2012 i686 230-230- The programs included with the Debian GNU/Linux system are free software; 230- the exact distribution terms for each program are described in the 230- individual files in /usr/share/doc/*/copyright. 230-230- Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 230- permitted by applicable law. 230 User etxxxx logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> 1. ftp> passive Passive mode on. 2. ftp> cd /home/cpb/public/unix 250 CWD command successful. ftp> dir 227 Entering Passive Mode (139,124,181,131,195,191) 150 Opening ASCII mode data connection for '/bin/ls'. total 4788 -rw-r--r-- 1 cpb prof 19254 Aug 30 2012 BonnePartieDeTP6UnixIUT.pdf.bz2 -rw-r--r-- 1 cpb prof 476014 Aug 30 2012 Cours8&9Unix.pdf.bz2 -rw-r--r-- 1 cpb prof 96059 Aug 30 2012 TP6UnixIUT.pdf.bz2 -rw-r--r-- 1 cpb prof 50500 Aug 30 2012 Test08-10-04.pdf.bz2 -rw-r--r-- 1 cpb prof 4840 Aug 30 2012 a_decouper.txt. ftp> bin 200 Type set to I. le fichier à transférer est de type binaire ftp> get bart.gif local: bart.gif remote: bart.gif 227 Entering Passive Mode (139,124,181,131,148,182) 150 Opening BINARY mode data connection for 'bart.gif' (3807 bytes).. 3807 bytes received in 0.04 secs (83.5 kb/s) 3.... pas de corrigé pour cette question... 4. ftp> cd /home/etxxxx 250 CWD command successful. ftp> ascii 200 Type set to A. cette fois, le fichier à déposer est un fichier texte C. Pain-Barre - 29/12/2014

3/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux ftp> put un-fichier.txt local: un-fichier.txt remote: un-fichier.txt 227 Entering Passive Mode (139,124,181,131,191,139) 150 Opening ASCII mode data connection for 'un-fichier.txt'.. 128 bytes sent in 0.00 secs (2500.0 kb/s) 5. ftp> bye 221 Goodbye. toto@pc$ Corrigé de l exercice 3 (Session FTP avec ftp.rfc-editor.org depuis Linux) toto@pc$ ftp ftp.rfc-editor.org Connected to ftp.rfc-editor.org. 220 "FTP Server Ready" Name (ftp.rfc-editor.org:toto): anonymous 331 Please specify the password. Password: toto@etu.univ-amu.fr 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> 1. ftp> passive Passive mode on. 2. ftp> cd in-notes 250 Directory successfully changed. 3. ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> ascii 200 Switching to ASCII mode. ftp> get rfc1939.txt local: rfc1939.txt remote: rfc1939.txt 227 Entering Passive Mode (4,31,198,49,117,146). 150 Opening ASCII mode data connection for rfc1939.txt (47018 bytes). ################################################. 48309 bytes received in 0.52 secs (90.1 kb/s) 4. ftp> bye 221 Goodbye. 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 4/22 1.8 Exercices Corrigé de l exercice 4 (Transfert manuel en mode passif) toto@pc$ telnet ftp.rfc-editor.org 21 Trying 4.31.198.49 Connected to ftp.rfc-editor.org. Escape character is '^]'. 220 "FTP Server Ready" USER anonymous 331 Please specify the password. PASS toto@etu.univ-amu.fr 230 Login successful. CWD in-notes 250 Directory successfully changed. TYPE A 200 Switching to ASCII mode. PASV 227 Entering Passive Mode (4,31,198,49,117,68). à ce stade, il faut se connecter à l adresse (4.31.198.49) et au port (117 256 + 68), indiqués entre parenthèses dans la ligne ci-dessus. Pour cela, on utilise nc (et un peu de shell) dans un autre terminal : $ nc 4.31.198.49 $((117*256+68)) > rfc821.txt où $((117*256+68)) demande à bash de calculer le port (30020), et où on redirige la sortie de nc dans le fichier de notre choix (rfc821.txt) RETR rfc821.txt 150 Opening ASCII mode data connection for rfc821.txt (120432 bytes).. à ce stade, le transfert est terminé, nc s arrête, et le fichier rfc821.txt a été rempli QUIT 221 Goodbye. Connection closed by foreign host. toto@pc$ 1.9 Installation du serveur ProFTP Corrigé de l exercice 5 (Installation de proftpd) 1.... pas de corrigé pour cette question... 2.... pas de corrigé pour cette question... 3.... pas de corrigé pour cette question... C. Pain-Barre - 29/12/2014

5/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux 4. m2:~# apt-get update Ign http://ftp.fr.debian.org lenny Release.gpg Ign http://ftp.fr.debian.org lenny/main Translation-en_US Get:5 http://archive.debian.org lenny/main Packages [5191kB] Get:6 http://archive.debian.org lenny/contrib Packages [76.2kB] W: Failed to fetch http://security.debian.org/dists/lenny/updates/contrib/source/so E: Some index files failed to download, they have been ignored, or old ones used in 5. m2:~# apt-cache search ftp-server ftpd-ssl - FTP server with SSL encryption support ftpd - File Transfer Protocol (FTP) server wu-ftpd - powerful and widely used FTP server proftpd-basic - versatile, virtual-hosting FTP daemon - binaries vsftpd - The Very Secure FTP Daemon 6. m2:~# apt-get install proftpd-basic Reading package lists Done Building dependency tree Reading state information Done Suggested packages: proftpd-doc proftpd-mod-mysql proftpd-mod-pgsql proftpd-mod-ldap The following NEW packages will be installed: proftpd-basic 0 upgraded, 1 newly installed, 0 to remove and 543 not upgraded. Need to get 691kB of archives. After this operation, 1603kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! proftpd-basic Install these packages without verification [y/n]? y Get:1 http://archive.debian.org lenny/main proftpd-basic 1.3.1-17lenny9 [691kB] Fetched 691kB in 0s (1441kB/s) Preconfiguring packages Selecting previously deselected package proftpd-basic. (Reading database 78259 files and directories currently installed.) Unpacking proftpd-basic (from /proftpd-basic_1.3.1-17lenny9_i386.deb) Setting up proftpd-basic (1.3.1-17lenny9) Adding system user `proftpd' (UID 108) Adding new user `proftpd' (UID 108) with group `nogroup' Not creating home directory `/var/run/proftpd'. Adding system user `ftp' (UID 109) Adding new user `ftp' (UID 109) with group `nogroup' Creating home directory `/home/ftp' `/usr/share/proftpd/templates/welcome.msg' -> `/home/ftp/welcome.msg.proftpd-new' Starting ftp server: proftpd. 7. m2:~# /etc/init.d/proftpd start Starting ftp server: proftpd. 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 6/22 8. m2:~# netstat -tln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:58917 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4459 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN tcp6 0 0 :::21 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN Les options utilisées sont -t pour TCP, -l pour les serveurs en écoute (listen), et -n pour garder les adresses et les ports sous forme numérique. Ca n a pas d importance mais on peut aussi remarquer que le serveur utilise une adresse d écoute IPv6 (mais qui comprend IPv4). 9. Une recherche de la chaîne ftp dans le fichier suffit : m2:~# grep -i ftp /etc/services ftp-data 20/tcp ftp 21/tcp tftp 69/udp sftp 115/tcp ftps-data 989/tcp # FTP over SSL (data) ftps 990/tcp venus-se 2431/udp # udp sftp side effect codasrv-se 2433/udp # udp sftp side effect frox 2121/tcp # frox: caching ftp proxy zope-ftp 8021/tcp # zope management by ftp les ports concernés sont mis en évidence en gras Corrigé de l exercice 6 (Autoriser l accès à root) 1. D abord, il faut configurer m1 : m1:~# ifconfig eth0 10.0.2.15/24 m1:~# route add default gw 10.0.2.2 m1:~# ftp 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): 331 Password required for root Password: 530 Login incorrect. Login failed. Remote system type is UNIX. Using binary mode to transfer files. ftp> quit 221 Goodbye. En effet, le login root a échoué C. Pain-Barre - 29/12/2014

7/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux 2. (a) le fichier modifié devrait commencer par les lignes suivantes, où les modifications sont en gras : # /etc/ftpusers: list of users disallowed FTP access. See ftpusers(5). # root daemon (b) La portion du fichier modifié devrait contenir les lignes : # DefaultRoot ~ # Autoriser le login root RootLogin on (c) m2:~# /etc/init.d/proftpd stop Stopping ftp server: proftpd. m2:~# /etc/init.d/proftpd start Starting ftp server: proftpd. on aurait pu aussi taper la seule commande : m2:~# /etc/init.d/proftpd restart Stopping ftp server: proftpd. Starting ftp server: proftpd. 3. m1:~# ftp 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): 331 Password required for root Password: 230 User root logged in Remote system type is UNIX. Using binary mode to transfer files. ftp> dir drwx------ 2 root root 4096 Sep 15 2007 Desktop drwxr-xr-x 2 root root 4096 Sep 5 2007 tmp ftp> quit 221 Goodbye. 4.... pas de corrigé pour cette question... 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 8/22 Corrigé de l exercice 7 (Autoriser l accès aux utilisateurs) 1. m2:~# adduser toto Adding user `toto' Adding new group `toto' (1000) Adding new user `toto' (1000) with group `toto' Creating home directory `/home/toto' Copying files from `/etc/skel' Enter new UNIX password: toto Retype new UNIX password: toto passwd: password updated successfully Changing the user information for toto Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [y/n] y m2:~# adduser titi Adding user `titi' m2:~# 2. m1:~# pwd /root m1:~# ls Desktop tmp pour le moment, il n y a que deux répertoires dans le répertoire personnel de root sur m1 m1:~# ftp 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): toto 331 Password required for toto Password: 230 User toto logged in Remote system type is UNIX. Using binary mode to transfer files. le login de toto a bien été accepté ftp> pwd 257 "/home/toto" is the current directory ftp> dir son répertoire personnel est vide sur m2 C. Pain-Barre - 29/12/2014

9/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux ftp> put /etc/passwd passwd local: /etc/passwd remote: passwd 150 Opening BINARY mode data connection for passwd 1091 bytes sent in 0.00 secs (5667.2 kb/s) ftp> dir -rw-r--r-- 1 toto toto 1091 Dec 29 12:25 passwd toto peut y déposer un fichier ftp> get passwd mypassswd local: mypassswd remote: passwd 150 Opening BINARY mode data connection for passwd (1091 bytes) 1091 bytes received in 0.00 secs (716.5 kb/s) ftp>! ls -l total 12 drwx------ 2 root root 4096 2007-09-15 13:22 Desktop -rw-r--r-- 1 root root 1091 2014-12-29 13:26 mypassswd drwxr-xr-x 2 root root 4096 2007-09-05 18:00 tmp ftp> et peut aussi en télécharger ; les transferts fonctionnent bien dans les deux sens. 3. ftp> cd.. 250 CWD command successful ftp> dir drwxr-xr-x 2 ftp nogroup 4096 Dec 29 11:09 ftp drwxr-xr-x 2 titi titi 4096 Dec 29 12:23 titi drwxr-xr-x 2 toto toto 4096 Dec 29 12:25 toto ftp> cd ftp 250 CWD command successful ftp> dir -rw-r--r-- 1 root root 170 Nov 16 2011 welcome.msg ftp> get welcome.msg local: welcome.msg remote: welcome.msg 150 Opening BINARY mode data connection for welcome.msg (170 bytes) 170 bytes received in 0.00 secs (532.1 kb/s) ftp>! ls Desktop mypassswd tmp welcome.msg effectivement, toto peut se balader dans l arborescence et télécharger des fichiers 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 10/22 4. La portion du fichier concernée devient donc : # Use this to jail all users in their homes DefaultRoot ~ 5. ftp> open 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): toto 331 Password required for toto Password: toto 230 User toto logged in Remote system type is UNIX. Using binary mode to transfer files. ftp> dir -rw-r--r-- 1 toto toto 1091 Dec 29 12:25 passwd ftp> cd.. 250 CWD command successful ftp> dir -rw-r--r-- 1 toto toto 1091 Dec 29 12:25 passwd tiens? en redescendant, on a le même contenu? ftp> pwd 257 "/" is the current directory en effet, car toto se situe à la "racine", c est à dire son répertoire personnel... C. Pain-Barre - 29/12/2014

11/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux Corrigé de l exercice 8 (Autoriser le login anonyme) 1. La portion du fichier modifiée devient : <Anonymous ~ftp> User ftp Group nogroup # We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp # Cosmetic changes, all files belongs to ftp user DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off # Limit the maximum number of anonymous logins MaxClients 10 # We want 'welcome.msg' displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg DisplayChdir.message # Limit WRITE everywhere in the anonymous chroot <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> # Uncomment this if you're brave. <Directory incoming> # Umask 022 is a good standard umask to prevent new files and dirs # (second parm) from being group and world writable. Umask 022 022 <Limit READ WRITE> DenyAll </Limit> <Limit STOR> AllowAll </Limit> </Directory> </Anonymous> 2. m1:~# cp /etc/passwd. 3. m1:~# ftp 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): anonymous 331 Anonymous login ok, send your complete email address as your password Password: 230-Welcome, archive user anonymous@::ffff:10.0.2.15! 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 12/22 230-230-The local time is: Tue Dec 23 17:54:06 2014 230-230-This is an experimental FTP server. If you have any unusual problems, 230-please report them via e-mail to <root@localhost>. 230-230 Anonymous access granted, restrictions apply Remote system type is UNIX. Using binary mode to transfer files. ftp> 4. ftp> dir -rw-r--r-- 1 ftp ftp 170 Nov 16 2011 welcome.msg ftp> ascii 200 Type set to A ftp> get welcome.msg local: welcome.msg remote: welcome.msg 150 Opening ASCII mode data connection for welcome.msg (170 bytes) 177 bytes received in 0.00 secs (442.1 kb/s) ftp>! cat welcome.msg Welcome, archive user %U@%R! The local time is: %T This is an experimental FTP server. If you have any unusual problems, please report them via e-mail to <root@%l>. 5. ftp> put passwd local: passwd remote: passwd 550 passwd: No such file or directory en effet, le transfert est refusé 6. m2:~# cp /etc/services /home/ftp m2:~# ls -l /home/ftp total 24 -rw-r--r-- 1 root root 18274 2014-12-29 14:56 services -rw-r--r-- 1 root root 170 2011-11-16 10:55 welcome.msg 7. Sur la session FTP de m1 : ftp> dir -rw-r--r-- 1 ftp ftp 18274 Dec 23 17:02 services -rw-r--r-- 1 ftp ftp 170 Nov 16 2011 welcome.msg 8. Sur m2 : m2:~# mkdir /home/ftp/incoming m2:~# ls -ld /home/ftp/incoming drwxr-xr-x 2 root root 4096 2014-12-29 15:06 /home/ftp/incoming C. Pain-Barre - 29/12/2014

13/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux et sur la session FTP de m1 : ftp> dir drwxr-xr-x 2 ftp ftp 4096 Dec 29 13:58 incoming -rw-r--r-- 1 ftp ftp 18274 Dec 29 13:56 services -rw-r--r-- 1 ftp ftp 170 Nov 16 2011 welcome.msg le répertoire incoming est bien présent ftp> put /etc/protocols incoming/protocols local: /etc/protocols remote: incoming/protocols 550 incoming/protocols: Permission denied mais on ne peut y déposer un fichier 9. On peut observer que ce sont les identités indiquées dans la partie <Anonymous ~ftp> du fichier de configuration... 10. ftp> put /etc/protocols incoming/protocols local: /etc/protocols remote: incoming/protocols 150 Opening BINARY mode data connection for incoming/protocols 2510 bytes sent in 0.00 secs (6846.8 kb/s) ftp> dir incoming -rw-r--r-- 1 ftp ftp 2510 Dec 29 14:11 protocols le fichier a bien été déposé sur le serveur 11. ftp> get incoming/protocols zefile local: zefile remote: incoming/protocols 550 incoming/protocols: No such file or directory précisons que c est le téléchargement qui pose problème et non pas le nom qu on veut donner à notre copie du fichier 12. Dans la partie <Directory incoming>, il faut ajouter la directive : AllowOverwrite et remplacer la directive : par les deux directives : <Limit READ WRITE> DenyAll </Limit> <Limit WRITE> DenyAll </Limit> <Limit READ> AllowAll </Limit> off 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 14/22 Et enfin redémarrer le serveur : m2:/home/ftp# /etc/init.d/proftpd restart Stopping ftp server: proftpd. Starting ftp server: proftpd. 13. On rouvre une session FTP : ftp> open 10.0.2.10 Connected to 10.0.2.10. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] Name (10.0.2.10:root): anonymous 331 Anonymous login ok, send your complete email address as your password Password: 230-Welcome, archive user anonymous@::ffff:10.0.2.15! 230-230-The local time is: Mon Dec 29 15:18:20 2014 230-230-This is an experimental FTP server. If you have any unusual problems, 230-please report them via e-mail to <root@localhost>. 230-230 Anonymous access granted, restrictions apply Remote system type is UNIX. Using binary mode to transfer files. ftp> dir incoming -rw-r--r-- 1 ftp ftp 2510 Dec 29 14:11 protocols ftp> get incoming/protocols ze-file local: ze-file remote: incoming/protocols 150 Opening BINARY mode data connection for incoming/protocols (2510 bytes) 2510 bytes received in 0.00 secs (1518.7 kb/s) le téléchargement du fichier fonctionne bien ftp> put /etc/passwd incoming/protocols local: /etc/passwd remote: incoming/protocols 550 incoming/protocols: Overwrite permission denied et on ne peut pas écraser le fichier ftp> delete incoming/protocols 550 incoming/protocols: No such file or directory ni le supprimer ftp> append /etc/passwd incoming/protocols local: /etc/passwd remote: incoming/protocols 550 incoming/protocols: No such file or directory on ne peut pas non plus lui ajouter du contenu C. Pain-Barre - 29/12/2014

15/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux ftp> put /etc/passwd incoming/truc local: /etc/passwd remote: incoming/truc 150 Opening BINARY mode data connection for incoming/truc 1091 bytes sent in 0.00 secs (7102.9 kb/s) ftp> dir incoming -rw-r--r-- 1 ftp ftp 2510 Dec 29 14:11 protocols -rw-r--r-- 1 ftp ftp 1091 Dec 29 14:36 truc on peut toujours déposer un fichier ftp> rename incoming/truc incoming/passwd 350 File or directory exists, ready for destination name 550 Rename incoming/passwd: No such file or directory mais qu on ne peut même pas renommer... Corrigé de l exercice 9 (Transfert manuel en mode actif) 1. Le serveur écoute sur le port 21 donc : m1:~# telnet 10.0.2.10 21 Trying 10.0.2.10 Connected to 10.0.2.10. Escape character is '^]'. 220 ProFTPD 1.3.1 Server (Debian) [::ffff:10.0.2.10] 2. USER toto 331 Password required for toto PASS toto 230 User toto logged in 3. 4. $ nc -l -p 12345 5. PORT 10,0,2,15,48,57 6. LIST le serveur de m2 envoie le contenu du répertoire sur la connexion de données, établie avec nc (mode actif) 7. QUIT 221 Goodbye. Connection closed by foreign host. m1:~# 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 16/22 2 DHCP 2.1 Configuration d un serveur DHCP Corrigé de l exercice 11 (configuration du serveur DHCP de m2) 1. Le fichier après la modification : m2:~# cat /etc/default/dhcp3-server # Defaults for dhcp initscript # sourced by /etc/init.d/dhcp # installed at /etc/default/dhcp3-server by the maintainer scripts # # This is a POSIX shell fragment # # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". INTERFACES="eth0" 2. Le fichier (extrait) après les modifications : m2:~# cat /etc/dhcp3/dhcpd.conf ddns-update-style none; # option definitions common to all supported networks option domain-name "iut.univ-aix.fr"; option domain-name-servers 139.124.1.2; default-lease-time 600; max-lease-time 7200; # If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. authoritative; # Use this to send dhcp log messages to a different log file (you also # have to hack syslog.conf to complete the redirection). # log-facility local7; # No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology. C. Pain-Barre - 29/12/2014

17/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux subnet 10.0.2.0 netmask 255.255.255.0 { range 10.0.2.120 10.0.2.150; option routers 10.0.2.2; option subnet-mask 255.255.255.0; option broadcast-address 10.0.2.255; } host vmxp { hardware ethernet 08:00:26:66:20:13; fixed-address 10.0.2.20; } Si la VM Windows XP a effectivement pour adresses MAC 08:00:26:66:20:13 3. m2:~# /etc/init.d/dhcp3-server start Starting DHCP server: dhcpd3. 2.2 Configuration des clients DHCP Corrigé de l exercice 12 (configuration temporaire du client DHCP de m1) 1. m1:~# dhclient eth0 Internet Systems Consortium DHCP Client V3.1.1 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ Listening on LPF/eth0/02:04:06:22:ab:24 Sending on LPF/eth0/02:04:06:22:ab:24 Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 DHCPOFFER from 10.0.2.10 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 10.0.2.10 bound to 10.0.2.120 -- renewal in 273 seconds. 2. m1:~# ifconfig eth0 eth0 Link encap:ethernet HWaddr 02:04:06:22:ab:24 inet addr:10.0.2.120 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::4:6ff:fe22:ab24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:263 errors:0 dropped:0 overruns:0 frame:0 TX packets:275 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9742 (9.5 KiB) TX bytes:12971 (12.6 KiB) Interrupt:5 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 18/22 m1:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 m1:~# cat /etc/resolv.conf domain iut.univ-aix.fr search iut.univ-aix.fr nameserver 139.124.1.2 m1:~# Tout ce qu on a fait jusqu à présent sur m1 devrait continuer de fonctionner. Corrigé de l exercice 13 (configuration du client DHCP de la VM Windows) 1. il faut configurer l interface via DHCP : C:>netsh int ip set address "Connexion au réseau local" dhcp Ok. 2. C:>ipconfig Configuration IP de Windows Carte Ethernet Connexion au réseau local: Suffixe DNS propre à la connexion : iut.univ-aix.fr Adresse IP............ : 10.0.2.20 Masque de sous-réseau...... : 255.255.255.0 Passerelle par défaut...... : 10.0.2.2 i On peut aussi utiliser ipconfig/all pour avoir plus de détails sur la configuration. C. Pain-Barre - 29/12/2014

19/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux C:>route print =========================================================================== Liste d'interfaces 0x1 MS TCP Loopback interface 0x2 08 00 27 71 76 54 Carte AMD PCNET Family Ethernet PCI - Mini =========================================================================== =========================================================================== Itinéraires actifs : Destination réseau Masque réseau Adr. passerelle Adr. interface Métrique 0.0.0.0 0.0.0.0 10.0.2.2 10.0.2.20 20 10.0.2.0 255.255.255.0 10.0.2.20 10.0.2.20 20 10.0.2.20 255.255.255.255 127.0.0.1 127.0.0.1 20 10.0.2.255 255.255.255.255 10.0.2.20 10.0.2.20 20 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 224.0.0.0 240.0.0.0 10.0.2.20 10.0.2.20 20 255.255.255.255 255.255.255.255 10.0.2.20 10.0.2.20 1 Passerelle par défaut : 10.0.2.2 =========================================================================== Itinéraires persistants : Aucun Corrigé de l exercice 14 (configuration permanente du client DHCP de m1) 1. Au même titre que la VM XP précédemment, il faut ajouter une entrée host pour m1 : host m1 { hardware ethernet 02:04:06:22:ab:24; fixed-address 10.0.2.15; } 2. Après redémarrage : m1:~# ifconfig eth0 Link encap:ethernet HWaddr 02:04:06:22:ab:24 inet6 addr: fe80::4:6ff:fe22:ab24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1 errors:0 dropped:0 overruns:0 frame:0 la configuration n a pas été obtenue 3.... pas de corrigé pour cette question... 4.... pas de corrigé pour cette question... 5. Après redémarrage : m1:~# ifconfig eth0 Link encap:ethernet HWaddr 02:04:06:22:ab:24 inet addr:10.0.2.120 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::4:6ff:fe22:ab24/64 Scope:Link 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 20/22 m1:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 3 Le courrier électronique 3.1 Clients de messagerie Il ne devrait pas y avoir besoin de corrigé... 3.2 Format d un message électronique 3.3 SMTP 3.3.1 Messages du protocole SMTP 3.3.2 Exercice Corrigé de l exercice 16 (Envoi du message anonyme) $ telnet allegro 25 Trying 139.124.181.131 Connected to allegro.aix.univ-amu.fr. Escape character is '^]'. 220 allegro.iut.univ-aix.fr ESMTP Postfix (Debian/GNU) HELO mamachine.com 250 allegro.iut.univ-aix.fr MAIL FROM:<tarzan@jungle.org> 250 2.1.0 Ok RCPT TO:<cpb> 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> From: Tarzan of the Jungle <tarzan@jungle.org> To: Cyril Pain-Barre <cpb@allegro> Subject: Un message super interessant blablabla le message anonyme et patati et patata. 250 2.0.0 Ok: queued as CDCCBF975 QUIT 221 2.0.0 Bye Connection closed by foreign host. $ C. Pain-Barre - 29/12/2014

21/22 Corrigé du TP 3 UE31 - M3102 : Services Réseaux Si on consulte ce message par mail, voici ça donne : $ mail mailx version nail 11.25 7/29/05. Type? for help. "/var/spool/mail/cpb": 1 message 1 new >N 1 Tarzan of the Jung Tue May 13 10:51 16/619 Un message super interessant? 1 Message 1: From tarzan@jungle.org Tue May 13 10:51:50 2008 Return-Path: <tarzan@jungle.org> X-Original-To: cpb Delivered-To: cpb@allegro.iut.univ-aix.fr From: Tarzan of the Jungle <tarzan@jungle.org> To: Cyril Pain-Barre <cpb@allegro.iut.univ-aix.fr> Subject: Un message super interessant Date: Tue, 13 May 2008 10:48:53 +0200 (CEST) Status: R blablabla le message anonyme et patati et patata? x Si on le récupère par Thunderbird et qu on double-clique dessus, voici ce que l on obtient : 29/12/2014 - C. Pain-Barre

UE31 - M3102 : Services Réseaux Corrigé du TP 3 22/22 3.4 Étude de la RFC de POP3 Corrigé de l exercice 17 (récupération de messages avec POP3) Voici la trace de la discussion avec le serveur POP3 d allegro, en supposant qu il y a 4 messages dans la boîte aux lettres et que le message anonyme est le dernier : $ telnet allegro 110 Trying 139.124.181.131 Connected to allegro.aix.univ-amu.fr. Escape character is '^]'. +OK USER cpb +OK PASS mon-mot-de-passe +OK LIST +OK 1 470 2 390 3 281 4 455. RETR 4 +OK Return-Path: <tarzan@jungle.org> X-Original-To: cpb Delivered-To: cpb@allegro.iut.univ-aix.fr Received: from mamachine.com (a73.iut.univ-aix.fr [139.124.187.73]) by allegro.iut.univ-aix.fr (Postfix) with SMTP id CDCCBF975 for <cpb>; Mon, 29 Dec 2014 16:45:54 +0100 (CET) From: Tarzan of the Jungle <tarzan@jungle.org> To: Cyril Pain-Barre <cpb@allegro> Subject: Un message super interessant blablabla le message anonyme et patati et patata. DELE 4 +OK QUIT +OK Connection closed by foreign host. C. Pain-Barre - 29/12/2014