SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Préparé par:
Mme sehla Loussaief Zayen
S E R V I C E S A D M I N I S T R A T I O N 1
PLAN
* SERVEUR APACHE
* SERVEUR SMTP
* CACHING ONLY NAMESERVER
* SERVEUR NFS
* SERVEUR CIFS
* SERVEUR FTP
S E R V I C E S A D M I N I S T R A T I O N 2
Module 1
Service Web encapsulé dans SSL
S E R V I C E S A D M I N I S T R A T I O N 3
Service Web encapsulé dans SSL
 Sécurisation d'un serveur Apache avec le
chiffrement
 Personnalisation d'un certificat auto-signé
 Génération d'une requête de signature de
certificat
S E R V I C E S A D M I N I S T R A T I O N 4

 Apache avec SSL
 /etc/httpd/conf/httpd.conf
 #vi /etc/httpd/conf.d/ssl.conf
 SSLCertificateFile /path/to/www.example.com.cert
 SSLCertificateKeyFile /path/to/www.example.com.key
S E R V I C E S A D M I N I S T R A T I O N 5

 Génération de certificat x.509
 Autosigné
 #genkey --days 365 server.example.com
(FQDN)
 ---> place le certificat sous /etc/pki/tls/certs/*.crt
 ---> place la clé sous /etc/pki/tls/private/*.key
 Affichage du contenu du certificat
 #openssl x509 -in server.crt -text
S E R V I C E S A D M I N I S T R A T I O N 6

 Génération d'une requête de signature de
 certificat (CSR)
 #genkey --genreq 365 server.example.com
 → /etc/pki/tls/certs/server.example.com.0.csr
 #openssl x509 -text < /etc/pki/tls/certs/server*.csr
 Envoyer la requête à une CA puis recevoir le certificat
et l'intégrer dans la config de Apache
S E R V I C E S A D M I N I S T R A T I O N 7

 Ajout d'une CA à Firefox
 Firefox → edition → préférences →
avancé → chiffrement → autorité →
importer le certificat
S E R V I C E S A D M I N I S T R A T I O N 8
Module 2
Configuration supplémentaire du serveur
Web
S E R V I C E S A D M I N I S T R A T I O N 9
Configuration supplémentaire de
Apache
 Hébergement virtuel basé sur le nom
 Contenu CGI dynamique
 Authentification des utilisateurs Web
 Sécurité Web SELinux
S E R V I C E S A D M I N I S T R A T I O N 10
 Name based virtual Hosting
Listen 80
NameVirtualHost 192.168.0.1:80
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/example.com
ServerName www.example1.com
ServerAlias www
ServerAdmin root@www.example1.com
</VirtualHost>
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/example.org
ServerName www.example2.org
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
</VirtualHost>
S E R V I C E S A D M I N I S T R A T I O N 11
 Authentification des utilisateurs
Apache
#vi /etc/httpd/conf/httpd.conf
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/example.org
ServerName www.example2.org
<Directory /var/www/html/example.org>
AuthName "Fichiers réservés"
AuthType basic
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</Directory>
</VirtualHost>
#htpasswd -mc /etc/httpd/.htpasswd user
S E R V I C E S A D M I N I S T R A T I O N 12
 Authentification des utilisateurs
Apache via LDAP
#vi /etc/httpd/conf/httpd.conf
LDAPTrustedGlobalCert CA_BASE64 /certs/certfile.der
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/example.org
ServerName www.example2.org
<Directory /var/www/html/example.org>
AuthName "Fichiers réservés"
AuthType basic
AuthBasicProvider ldap
AuthLDAPURL “ldap://fqdn/prefix” TLS
Require valid-user
</Directory>
</VirtualHost>
S E R V I C E S A D M I N I S T R A T I O N 13
 Apache et contextes SElinux
 #semanage dontaudit off
 #semange port -l | grep httpd
 #semange port -a -t httpd_port_t -p tcp 777
 #semanage fcontext -a -t httpd_sys_content_t
'/virtual(/.*)?'
 #retorcon -RFv /virtual
 # semanage fcontext -a -t httpd_sys_script_exec_t
'/cgi-bin(/.*)?'
 #retorcon -RFv /cgi-bin
S E R V I C E S A D M I N I S T R A T I O N 14
 Apache et variables Booléennes
SElinux
 #getsebool -a
 #semanage boolean -l
 #setsebool -P httpd_enable_cgi off
S E R V I C E S A D M I N I S T R A T I O N 15
Module 3
Configuration SMTP de base
S E R V I C E S A D M I N I S T R A T I O N 16
Configuration SMTP de base
 Configuration de base de la messagerie
 Configuration du serveur Intranet
S E R V I C E S A D M I N I S T R A T I O N 17
Configuration de base de la messagerie
MUA
MTA: potfix, sendmail, Exim
MDA: MTA possède son propre MDA, fetchmail
Mailstore: /var/spool/mail/login
TOUT USER MAIL EST UN USER SYSTEME
#useradd login
S E R V I C E S A D M I N I S T R A T I O N 18
Agent MTA postfix
Fichier de configuration principal:
/etc/postfix/main.cf
Editable par
#vi
ou
#postconf -e “....=....”
Par défaut accepte les emails en provenance
de loopback
#vi /etc/postfix/main.cf
inet_interfaces=all
/var/log/maillog
#mailq (Liste des Emails sortant)
S E R V I C E S A D M I N I S T R A T I O N 19
Agent MTA postfix
Vi /etc/postfix.main.cf
inet_interfaces=... (écoute sur ces interfaces)
myorigin=.. (mail locaux proviennent de ce domaine)
mydestination=.. (Emails sur ces domaines délivrés
au MDA)
mynetworks=... (autorisés à relayer via cet MTA)
relayhost=.. (ce hôte relaye tt le courier sortant)
S E R V I C E S A D M I N I S T R A T I O N 20
Configuration Intranet
Serveur Mail Entrant
[root@server2 ~] #vi /etc/postfix/main.cf
inet_interfaces=all
myorigin=domain2.example.com
mydestination=domain2.example.com
local_transport=local:$myhostname
relayhost=[smtp.domain2.example.com]
Serveur Mail NULL
[root@desktop2 ~] #vi /etc/postfix/main.cf
inet_interfaces=all
myorigin=domain2.example.com
relayhost=[smtp.domain2.example.com]
local_transport=”error:local delivery disabled”
S E R V I C E S A D M I N I S T R A T I O N 21
/etc/aliases
#useradd usermail
#usermod -s /sbin/nologin usermail
#passwd usermail
#vi /etc/aliases
usermail: administrateur
#newaliases
#mail administrateur@serverx
---> /var/spool/mail/usermail
S E R V I C E S A D M I N I S T R A T I O N 22
Module 4
Serveur DNS cache uniquement
Cachingonly Mail Server
S E R V I C E S A D M I N I S T R A T I O N 23
Serveur DNS
S E R V I C E S A D M I N I S T R A T I O N 24
 Recherche DNS
 /etc/resolv.conf

 nameserver 193.95.66.10
 nameserver 195.55.30.45
S E R V I C E S A D M I N I S T R A T I O N 25
 Record Resource DNS
A: résolution directe IPV4
AAAA: résolution directe IPV6
CNAME: canonical name (alias)
PTR: résolution inverse (IPV4/IPV6)
MX: serveur de messagerie sur un domaine
NS: serveur de nom sur un domaine
SOA: Start Of Authority
S E R V I C E S A D M I N I S T R A T I O N 26
 Résolution de nom
$dig www.yahoo.fr
; <<>> DiG 9.7.3-P3 <<>> www.yahoo.fr
…......
;; QUESTION SECTION:
;www.yahoo.fr. IN A
;; ANSWER SECTION:
www.yahoo.fr. IN CNAME rc.yahoo.com.
rc.yahoo.com. IN CNAME src.g03.yahoodns.net.
src.g03.yahoodns.net. IN A 77.238.184.150
;; Query time: 43 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Jun 2 19:37:33 2015
;; MSG SIZE rcvd: 106
S E R V I C E S A D M I N I S T R A T I O N 27
 Configuration du caching only
nameserver
#Vi /etc/named.conf
options {
listen-on port 53 {127.0.0.1; 192.168.0.1;};
listen-on-v6 port 53 { ::1; };
directory "/var/named";
allow-query { localhost; };
forwarders {192.168.0.254;};
};
#service named restart
S E R V I C E S A D M I N I S T R A T I O N 28
Module 5
Partage de fichiers avec NFS
S E R V I C E S A D M I N I S T R A T I O N 29
Serveur NFS
 Configuration du serveur NFS
 Considérations sur le client NFS
S E R V I C E S A D M I N I S T R A T I O N 30
 Concepts NFS
Network File System: permet le partage et l'accès à des
fichiers sur le réseau
Fichier de configuration : /etc/exports
/repertoire clientautorisés(droit d'accès à l'import)
Exemple:
/var/ftp/pub 192.168.0.24(ro) 127.0.0.1(rw)
/export/home *.example.com(rw,no_root_squash)
RootSquashing : Transformer un root distant en
nfsnobody sur le serveur
S E R V I C E S A D M I N I S T R A T I O N 31
 Concepts NFS
Rafraichir l'état des exports
#exportfs -r
ou
Service nfs restart
Affichage la liste des exports
#exportfs -v
Dépendance avec rpcbind
S E R V I C E S A D M I N I S T R A T I O N 32
 Côté Client
Affichage des répertoires exportés
#showmount -e servernfs.example.com
Montage d'un répertoire exporté
#mount servernfs.example.com:/rep /ptmontage
#Vi /etc/fstab
servernfs:/rep /ptmontage nfs defaults 0 0
#mount -a
S E R V I C E S A D M I N I S T R A T I O N 33
Module 6
Partage de fichiers avec CIFS
S E R V I C E S A D M I N I S T R A T I O N 34
Partage de fichiers avec CIFS
common Internet File System
 Clients CIFS
 Principes de base de la configuration
CIFS
 Partages CIFS collaboratifs
S E R V I C E S A D M I N I S T R A T I O N 35
 Accès aux partages CIFS
 Accès graphique
 #smbclient -L server.example.com -N
 #smbclient //server/share -U user
smb>
 #mount -t cifs //server/share -o
username=user
 #Vi /etc/fstab
//server/share /ptmontage cifs defaults 0 0
S E R V I C E S A D M I N I S T R A T I O N 36
Configuration serveur CIFS
/etc/samba/smb.conf
[global]
workgroup= EXAMPLE
hosts allow= 192.168.0.
[homes]
[printers]
S E R V I C E S A D M I N I S T R A T I O N 37
Configuration serveur CIFS
/etc/samba/smb.conf
[shareEXample]
path= /data
comment= exporte data
browseable= no | yes
public= no | yes
valid users= joe, @developper
Writable=no | yes
Write list= @developper
S E R V I C E S A D M I N I S T R A T I O N 38
Utilisateurs CIFS
# useradd joe
#usermod -s /sbin/nologin joe
#smbpasswd -a joe
S E R V I C E S A D M I N I S T R A T I O N 39
CIFS et SElinux
#semanege fcontext -a -t samba_share_t '/shared(/.*)?'
#restorecon -vFR /shared
samba_enable_home_dirs:exporte les répertoires
personnels vers d'autres SEs
use_samba_home_dirs:permet de monter des répertoires
distant et de les utilser comme répertoires personnels
#setsebool -P samba_enable_home_dirs off
S E R V I C E S A D M I N I S T R A T I O N 40
Chapitre 7
Partage de fichiers FTP
S E R V I C E S A D M I N I S T R A T I O N 41
Zone de dépôt FTP
#vi /etc/vsftpd/vsftpd.conf
anon_upload_enable = yes
chown_upload = yes
chown_username= daemon
anon_umask = 077
S E R V I C E S A D M I N I S T R A T I O N 42
FTP et SElinux
Contexte des fichiers/ Répertoires
---> public_content_t
---> public_content_rw_t
Variables booléennes
#setsebool -P allow_ftp_anon_write on
S E R V I C E S A D M I N I S T R A T I O N 43

Weitere ähnliche Inhalte

Was ist angesagt?

Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
venkatakrishnan k
 
Configure Proxy and Firewall (Iptables)
Configure Proxy and Firewall (Iptables)Configure Proxy and Firewall (Iptables)
Configure Proxy and Firewall (Iptables)
Tola LENG
 

Was ist angesagt? (20)

DNS SERVER
DNS SERVERDNS SERVER
DNS SERVER
 
Php logging
Php loggingPhp logging
Php logging
 
Presentación1
Presentación1Presentación1
Presentación1
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
 
Fail2ban
Fail2banFail2ban
Fail2ban
 
Linux network configuration
Linux network configurationLinux network configuration
Linux network configuration
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
 
Linux And perl
Linux And perlLinux And perl
Linux And perl
 
Unix executable buffer overflow
Unix executable buffer overflowUnix executable buffer overflow
Unix executable buffer overflow
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
Linuxserver harden
Linuxserver hardenLinuxserver harden
Linuxserver harden
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
NFS is an excellent way of sharing files between linux and other unix systems
NFS is an excellent way of sharing files between linux and other unix systemsNFS is an excellent way of sharing files between linux and other unix systems
NFS is an excellent way of sharing files between linux and other unix systems
 
Slim Server Practical
Slim Server PracticalSlim Server Practical
Slim Server Practical
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Free ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connectionFree ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connection
 
Configure Proxy and Firewall (Iptables)
Configure Proxy and Firewall (Iptables)Configure Proxy and Firewall (Iptables)
Configure Proxy and Firewall (Iptables)
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 

Ähnlich wie Linux administration ii-parti

Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2
Hell19
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Intrusion Detection System using Snort
Intrusion Detection System using Snort Intrusion Detection System using Snort
Intrusion Detection System using Snort
webhostingguy
 
Intrusion Detection System using Snort
Intrusion Detection System using Snort Intrusion Detection System using Snort
Intrusion Detection System using Snort
webhostingguy
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
andymccurdy
 

Ähnlich wie Linux administration ii-parti (20)

Ex200
Ex200Ex200
Ex200
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2
 
DNSSEC - WHAT IS IT ? INSTALL AND CONFIGURE IN CHROOT JAIL
DNSSEC - WHAT IS IT ? INSTALL AND CONFIGURE IN CHROOT JAILDNSSEC - WHAT IS IT ? INSTALL AND CONFIGURE IN CHROOT JAIL
DNSSEC - WHAT IS IT ? INSTALL AND CONFIGURE IN CHROOT JAIL
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04
 
SIP URI @ fscons 2009
SIP URI @ fscons 2009SIP URI @ fscons 2009
SIP URI @ fscons 2009
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos o
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
Intrusion Detection System using Snort
Intrusion Detection System using Snort Intrusion Detection System using Snort
Intrusion Detection System using Snort
 
Intrusion Detection System using Snort
Intrusion Detection System using Snort Intrusion Detection System using Snort
Intrusion Detection System using Snort
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin JonesITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Linux administration ii-parti

  • 1. Préparé par: Mme sehla Loussaief Zayen S E R V I C E S A D M I N I S T R A T I O N 1
  • 2. PLAN * SERVEUR APACHE * SERVEUR SMTP * CACHING ONLY NAMESERVER * SERVEUR NFS * SERVEUR CIFS * SERVEUR FTP S E R V I C E S A D M I N I S T R A T I O N 2
  • 3. Module 1 Service Web encapsulé dans SSL S E R V I C E S A D M I N I S T R A T I O N 3
  • 4. Service Web encapsulé dans SSL  Sécurisation d'un serveur Apache avec le chiffrement  Personnalisation d'un certificat auto-signé  Génération d'une requête de signature de certificat S E R V I C E S A D M I N I S T R A T I O N 4
  • 5.   Apache avec SSL  /etc/httpd/conf/httpd.conf  #vi /etc/httpd/conf.d/ssl.conf  SSLCertificateFile /path/to/www.example.com.cert  SSLCertificateKeyFile /path/to/www.example.com.key S E R V I C E S A D M I N I S T R A T I O N 5
  • 6.   Génération de certificat x.509  Autosigné  #genkey --days 365 server.example.com (FQDN)  ---> place le certificat sous /etc/pki/tls/certs/*.crt  ---> place la clé sous /etc/pki/tls/private/*.key  Affichage du contenu du certificat  #openssl x509 -in server.crt -text S E R V I C E S A D M I N I S T R A T I O N 6
  • 7.   Génération d'une requête de signature de  certificat (CSR)  #genkey --genreq 365 server.example.com  → /etc/pki/tls/certs/server.example.com.0.csr  #openssl x509 -text < /etc/pki/tls/certs/server*.csr  Envoyer la requête à une CA puis recevoir le certificat et l'intégrer dans la config de Apache S E R V I C E S A D M I N I S T R A T I O N 7
  • 8.   Ajout d'une CA à Firefox  Firefox → edition → préférences → avancé → chiffrement → autorité → importer le certificat S E R V I C E S A D M I N I S T R A T I O N 8
  • 9. Module 2 Configuration supplémentaire du serveur Web S E R V I C E S A D M I N I S T R A T I O N 9
  • 10. Configuration supplémentaire de Apache  Hébergement virtuel basé sur le nom  Contenu CGI dynamique  Authentification des utilisateurs Web  Sécurité Web SELinux S E R V I C E S A D M I N I S T R A T I O N 10
  • 11.  Name based virtual Hosting Listen 80 NameVirtualHost 192.168.0.1:80 <VirtualHost 192.168.0.1:80> DocumentRoot /var/www/html/example.com ServerName www.example1.com ServerAlias www ServerAdmin root@www.example1.com </VirtualHost> <VirtualHost 192.168.0.1:80> DocumentRoot /var/www/html/example.org ServerName www.example2.org ScriptAlias /cgi-bin/ /var/www/cgi-bin/ </VirtualHost> S E R V I C E S A D M I N I S T R A T I O N 11
  • 12.  Authentification des utilisateurs Apache #vi /etc/httpd/conf/httpd.conf <VirtualHost 192.168.0.1:80> DocumentRoot /var/www/html/example.org ServerName www.example2.org <Directory /var/www/html/example.org> AuthName "Fichiers réservés" AuthType basic AuthUserFile /etc/httpd/.htpasswd Require valid-user </Directory> </VirtualHost> #htpasswd -mc /etc/httpd/.htpasswd user S E R V I C E S A D M I N I S T R A T I O N 12
  • 13.  Authentification des utilisateurs Apache via LDAP #vi /etc/httpd/conf/httpd.conf LDAPTrustedGlobalCert CA_BASE64 /certs/certfile.der <VirtualHost 192.168.0.1:80> DocumentRoot /var/www/html/example.org ServerName www.example2.org <Directory /var/www/html/example.org> AuthName "Fichiers réservés" AuthType basic AuthBasicProvider ldap AuthLDAPURL “ldap://fqdn/prefix” TLS Require valid-user </Directory> </VirtualHost> S E R V I C E S A D M I N I S T R A T I O N 13
  • 14.  Apache et contextes SElinux  #semanage dontaudit off  #semange port -l | grep httpd  #semange port -a -t httpd_port_t -p tcp 777  #semanage fcontext -a -t httpd_sys_content_t '/virtual(/.*)?'  #retorcon -RFv /virtual  # semanage fcontext -a -t httpd_sys_script_exec_t '/cgi-bin(/.*)?'  #retorcon -RFv /cgi-bin S E R V I C E S A D M I N I S T R A T I O N 14
  • 15.  Apache et variables Booléennes SElinux  #getsebool -a  #semanage boolean -l  #setsebool -P httpd_enable_cgi off S E R V I C E S A D M I N I S T R A T I O N 15
  • 16. Module 3 Configuration SMTP de base S E R V I C E S A D M I N I S T R A T I O N 16
  • 17. Configuration SMTP de base  Configuration de base de la messagerie  Configuration du serveur Intranet S E R V I C E S A D M I N I S T R A T I O N 17
  • 18. Configuration de base de la messagerie MUA MTA: potfix, sendmail, Exim MDA: MTA possède son propre MDA, fetchmail Mailstore: /var/spool/mail/login TOUT USER MAIL EST UN USER SYSTEME #useradd login S E R V I C E S A D M I N I S T R A T I O N 18
  • 19. Agent MTA postfix Fichier de configuration principal: /etc/postfix/main.cf Editable par #vi ou #postconf -e “....=....” Par défaut accepte les emails en provenance de loopback #vi /etc/postfix/main.cf inet_interfaces=all /var/log/maillog #mailq (Liste des Emails sortant) S E R V I C E S A D M I N I S T R A T I O N 19
  • 20. Agent MTA postfix Vi /etc/postfix.main.cf inet_interfaces=... (écoute sur ces interfaces) myorigin=.. (mail locaux proviennent de ce domaine) mydestination=.. (Emails sur ces domaines délivrés au MDA) mynetworks=... (autorisés à relayer via cet MTA) relayhost=.. (ce hôte relaye tt le courier sortant) S E R V I C E S A D M I N I S T R A T I O N 20
  • 21. Configuration Intranet Serveur Mail Entrant [root@server2 ~] #vi /etc/postfix/main.cf inet_interfaces=all myorigin=domain2.example.com mydestination=domain2.example.com local_transport=local:$myhostname relayhost=[smtp.domain2.example.com] Serveur Mail NULL [root@desktop2 ~] #vi /etc/postfix/main.cf inet_interfaces=all myorigin=domain2.example.com relayhost=[smtp.domain2.example.com] local_transport=”error:local delivery disabled” S E R V I C E S A D M I N I S T R A T I O N 21
  • 22. /etc/aliases #useradd usermail #usermod -s /sbin/nologin usermail #passwd usermail #vi /etc/aliases usermail: administrateur #newaliases #mail administrateur@serverx ---> /var/spool/mail/usermail S E R V I C E S A D M I N I S T R A T I O N 22
  • 23. Module 4 Serveur DNS cache uniquement Cachingonly Mail Server S E R V I C E S A D M I N I S T R A T I O N 23
  • 24. Serveur DNS S E R V I C E S A D M I N I S T R A T I O N 24
  • 25.  Recherche DNS  /etc/resolv.conf   nameserver 193.95.66.10  nameserver 195.55.30.45 S E R V I C E S A D M I N I S T R A T I O N 25
  • 26.  Record Resource DNS A: résolution directe IPV4 AAAA: résolution directe IPV6 CNAME: canonical name (alias) PTR: résolution inverse (IPV4/IPV6) MX: serveur de messagerie sur un domaine NS: serveur de nom sur un domaine SOA: Start Of Authority S E R V I C E S A D M I N I S T R A T I O N 26
  • 27.  Résolution de nom $dig www.yahoo.fr ; <<>> DiG 9.7.3-P3 <<>> www.yahoo.fr …...... ;; QUESTION SECTION: ;www.yahoo.fr. IN A ;; ANSWER SECTION: www.yahoo.fr. IN CNAME rc.yahoo.com. rc.yahoo.com. IN CNAME src.g03.yahoodns.net. src.g03.yahoodns.net. IN A 77.238.184.150 ;; Query time: 43 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Tue Jun 2 19:37:33 2015 ;; MSG SIZE rcvd: 106 S E R V I C E S A D M I N I S T R A T I O N 27
  • 28.  Configuration du caching only nameserver #Vi /etc/named.conf options { listen-on port 53 {127.0.0.1; 192.168.0.1;}; listen-on-v6 port 53 { ::1; }; directory "/var/named"; allow-query { localhost; }; forwarders {192.168.0.254;}; }; #service named restart S E R V I C E S A D M I N I S T R A T I O N 28
  • 29. Module 5 Partage de fichiers avec NFS S E R V I C E S A D M I N I S T R A T I O N 29
  • 30. Serveur NFS  Configuration du serveur NFS  Considérations sur le client NFS S E R V I C E S A D M I N I S T R A T I O N 30
  • 31.  Concepts NFS Network File System: permet le partage et l'accès à des fichiers sur le réseau Fichier de configuration : /etc/exports /repertoire clientautorisés(droit d'accès à l'import) Exemple: /var/ftp/pub 192.168.0.24(ro) 127.0.0.1(rw) /export/home *.example.com(rw,no_root_squash) RootSquashing : Transformer un root distant en nfsnobody sur le serveur S E R V I C E S A D M I N I S T R A T I O N 31
  • 32.  Concepts NFS Rafraichir l'état des exports #exportfs -r ou Service nfs restart Affichage la liste des exports #exportfs -v Dépendance avec rpcbind S E R V I C E S A D M I N I S T R A T I O N 32
  • 33.  Côté Client Affichage des répertoires exportés #showmount -e servernfs.example.com Montage d'un répertoire exporté #mount servernfs.example.com:/rep /ptmontage #Vi /etc/fstab servernfs:/rep /ptmontage nfs defaults 0 0 #mount -a S E R V I C E S A D M I N I S T R A T I O N 33
  • 34. Module 6 Partage de fichiers avec CIFS S E R V I C E S A D M I N I S T R A T I O N 34
  • 35. Partage de fichiers avec CIFS common Internet File System  Clients CIFS  Principes de base de la configuration CIFS  Partages CIFS collaboratifs S E R V I C E S A D M I N I S T R A T I O N 35
  • 36.  Accès aux partages CIFS  Accès graphique  #smbclient -L server.example.com -N  #smbclient //server/share -U user smb>  #mount -t cifs //server/share -o username=user  #Vi /etc/fstab //server/share /ptmontage cifs defaults 0 0 S E R V I C E S A D M I N I S T R A T I O N 36
  • 37. Configuration serveur CIFS /etc/samba/smb.conf [global] workgroup= EXAMPLE hosts allow= 192.168.0. [homes] [printers] S E R V I C E S A D M I N I S T R A T I O N 37
  • 38. Configuration serveur CIFS /etc/samba/smb.conf [shareEXample] path= /data comment= exporte data browseable= no | yes public= no | yes valid users= joe, @developper Writable=no | yes Write list= @developper S E R V I C E S A D M I N I S T R A T I O N 38
  • 39. Utilisateurs CIFS # useradd joe #usermod -s /sbin/nologin joe #smbpasswd -a joe S E R V I C E S A D M I N I S T R A T I O N 39
  • 40. CIFS et SElinux #semanege fcontext -a -t samba_share_t '/shared(/.*)?' #restorecon -vFR /shared samba_enable_home_dirs:exporte les répertoires personnels vers d'autres SEs use_samba_home_dirs:permet de monter des répertoires distant et de les utilser comme répertoires personnels #setsebool -P samba_enable_home_dirs off S E R V I C E S A D M I N I S T R A T I O N 40
  • 41. Chapitre 7 Partage de fichiers FTP S E R V I C E S A D M I N I S T R A T I O N 41
  • 42. Zone de dépôt FTP #vi /etc/vsftpd/vsftpd.conf anon_upload_enable = yes chown_upload = yes chown_username= daemon anon_umask = 077 S E R V I C E S A D M I N I S T R A T I O N 42
  • 43. FTP et SElinux Contexte des fichiers/ Répertoires ---> public_content_t ---> public_content_rw_t Variables booléennes #setsebool -P allow_ftp_anon_write on S E R V I C E S A D M I N I S T R A T I O N 43