1.
sudo apt update
[Link] apt upgrade
[Link] fr ou loadkeys us
[Link]
[Link] apt install openssh-server
[Link] systemctl status ssh
[Link] ufw allow ssh
[Link] nano /etc/hostname
..
[Link]
..
[Link] reboot now
IP ADRESSE CONFIGURATION
########################
[Link] a / ifconfig
[Link] /etc/netplan/[Link]
..
network:
version: 2
ethernets:
enp0s3:
dhcp4: no
dhcp6: no
addresses: [[Link]/24]
gateway4: [Link]
nameservers:
addresses: [[Link],[Link]]
..
###########script1##################################################################
############################
#!/bin/bash
sed -i -e 's/true/no/g' -e '3 a\ version: 2' -e '6d' -i -e '$a \ dhcp6: no\n addresses:
[[Link]/24]\n gateway4: [Link]\n nameservers:\n addresses: [[Link],[Link]]
/etc/netplan/[Link]
netplan apply
ip a
##################################################################################
###############################
[Link] netplan apply
[Link] a
[Link] nano /etc/hosts
..
[Link] [Link] serv
..
[Link] nano /etc/[Link]
..
nameserver [Link]
..
###########################################################################
#!/bin/bash
sed -i -e '1d' /etc/hostname -i -e '3a \[Link] [Link] serv' /etc/hosts -i -e
's/[Link]/[Link]/g' /etc/[Link]
echo '[Link]' >> /etc/hostname
###########################################################################
###############
utiliser SSH
##############
DNS CONFIGURATION
#################
[Link] apt install bind9 bind9utils bind9-doc
[Link] nano /etc/default/named
..
OPTIONS="-u bind -4"
..
[Link] systemctl restart bind9
[Link] nano /etc/bind/[Link]
..
acl "trusted" {
[Link];
};
options {
directory "/var/cache/bind";
recursion yes;
allow-recursion { trusted; };
listen-on { [Link]; };
allow-transfer { none; };
forwarders {
[Link];
[Link];
};
..
[Link] nano /etc/bind/[Link]
..
zone "[Link]" {
type primary;
file "/etc/bind/zones/[Link]";
allow-transfer { [Link]; };
};
zone "[Link]" {
type primary;
file "/etc/bind/zones/db.1.168.192";
allow-transfer { [Link]; };
};
..
[Link] mkdir /etc/bind/zones
[Link] cp /etc/bind/[Link] /etc/bind/zones/[Link]
[Link] nano /etc/bind/zones/[Link]
..
$TTL 604800
@ IN SOA [Link]. [Link]. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS [Link].
@ IN A [Link]
serv IN A [Link]
..
[Link] cp /etc/bind/db.127 /etc/bind/zones/db.1.168.192
[Link] nano /etc/bind/zones/db.1.168.192
..
$TTL 604800
@ IN SOA [Link]. [Link]. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS [Link].
@ IN PTR [Link].
serv IN A [Link]
1 IN PTR [Link]
..
[Link] named-checkconf
[Link] named-checkzone [Link] /etc/bind/zones/[Link]
[Link] named-checkzone [Link] /etc/bind/zones/db.1.168.192
[Link] restart bind9
[Link] status bind9
[Link] allow bind
TESTER VOS CONFIGURATION
#######################
sur le serveur
***************
ping [Link]
ping serv
ping [Link]
nslookup [Link]
sur le client
*************
windows et linux
ping [Link]
linux
ping serv:[Link]
dig [Link]
CONFIGURATION DHCP
##################
[Link] apt install isc-dhcp-server -y
##########################
/etc/default/isc-dhcp-server
INTERFACES="eth0"
##########################
[Link] cp /etc/dhcp/[Link] /etc/dhcp/[Link]
[Link] nano /etc/dhcp/[Link]
..
.
option domain-name "[Link]";
option domain-name-servers [Link];
authoritative;
subnet [Link] netmask [Link] {
range [Link] [Link];
option routers [Link];
.
[Link] systemctl start isc-dhcp-server
[Link] systemctl status isc-dhcp-server
########verifier les configuration############
$ dhcpd -t -cf /etc/dhcp/[Link]
$ grep dhcpd /var/log/messages
#############################################
###############################
ufw allow from any to any port 53
ufw allow proto udp from [Link]/0 to [Link]/0 port 67
ufw allow proto from ::/0 to ::/0 port 1194
deny unknown-clients
###################################
TESTER VOS CONFIGURATION
#######################
sur le client windows
ipconfig /release
ipconfig /renew
ou utiliser l'interface graphique
sur le client linux
sudo dhclient -v -r eth0
sudo dhclient -v eth0
ou utiliser l'interface graphique
[Link]-lease-list
[Link] nano /etc/dhcp/[Link]
..
host PC1 {
hardware ethernet [Link];
fixed-address [Link];
..
[Link] systemctl restart isc-dhcp-server
TESTER VOS CONFIGURATION
#######################
sur le client windows
ipconfig /release
ipconfig /renew
ou utiliser l'interface graphique
sur le client linux
sudo dhclient -v -r eth0
sudo dhclient -v eth0
ou utiliser l'interface graphique
CONFIGURATION SAMBA
####################
SAMBA SANS MOT DE PASSE
***********************
[Link] apt install samba
[Link] mkdir /document
[Link] chmod 777 /document
[Link] cp /etc/samba/[Link] /etc/samba/[Link]
[Link] nano /etc/samba/[Link]
..
[dospart]
comment = dossier partager
path = /document
guest ok = yes
writeable = yes
browseable = yes
..
##########verifier les configurations####
testparm
#########################################
[Link] systemctl start smbd
[Link] systemctl status smbd
TESTER VOS CONFIGURATION
#######################
sur le client windows
W+R
\\[Link]\dospart
\\[Link]\dospart
sur le client linux
ligne de commande
smbclient \\\\[Link]\\dospart
smbclient \\\\[Link]\dospart
SAMBA AVEC MOT DE PASSE
***********************
44. sudo mkdir /information
45. sudo chmod 777 /information
46. sudo groupadd reseaux
47. chgr reseaux /information
48. sudo useradd kashala
49. sudo useradd kalombo
50. sudo smbpasswd -a kashala
51. sudo smbpasswd -e kashala
52. sudo smbpasswd -a kalombo
53. sudo smbpasswd -e kalombo
54. usermod -G reseaux kashala
55. usermod -G reseaux kalombo
56. sudo nano /etc/samba/[Link]
.
..
[info]
path = /information
browseable = yes
writeable = yes
valid users = @reseaux
.
..
57. sudo systemctl restart smbd
TESTER VOS CONFIGURATION
#######################
sur le client windows
W+R
\\[Link]\info
\\[Link]\info
sur le client linux
ligne de commande
smbclient \\\\[Link]\\info -U kashala
smbclient \\\\[Link]\\info -U kashala
57.56. sudo nano /etc/samba/[Link]
.
..
[info]
path = /information
browseable = yes
writeable = yes
read list = kalombo
valid users = @reseaux
.
..
[Link] systemctl restart smbd
##########script####################################################################
#########################################################
#!/bin/bash
mkdir /admincours
chmod 777 /admincours
groupadd reseaux
chgrp reseaux /admincours
chcon -t samba_share_t /admincours
useradd -G reseaux laura
useradd -G reseaux jean
smbpasswd -a laura
smbpasswd -a jean
smbpasswd -e laura
smbpasswd -e jean\
sed -i '9 a \ map to guest = bad user' /etc/samba/[Link]
sed -i '$a \[tmp]\ncomment= dossier tmp\npath= \/tmp\nbrowseable=yes\nwriteable=yes\nguest
ok= yes' /etc/samba/[Link]
sed -i '$a \[admincours]\ncomment= dossier admin\npath= \/admincours\nbrowseable=
yes\nwriteable= yes\nvalid users= @reseaux\nread list= jean' /etc/samba/[Link]
firewall-cmd --add-service=samba --zone=public --permanent
firewall-cmd --reload
systemctl start smb
systemctl enable smb
systemctl status smb
##################################################################################
#############################################################
TESTER VOS CONFIGURATION
#######################
sur le client windows
W+R
\\[Link]\info
sur le client linux
ligne de commande
smbclient \\\\[Link]\\info -U kashala
smbclient \\\\[Link]\\info -U kashala