Partages
- FTP
- SSH
- NFS
- SMB
- iSCSI
- Partages de fichiers
- Partages d'imprimantes
- Partages d'écran
FTP
Installation du logiciel VSFTPD
yum -y install vsftpd
Editer le fichier /etc/vsftpd/vsftpd.conf
et changer les directives :
anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
Activer le service
systemctl enable vsftpd
systemctl start vsftpd
Ouverture du pare-feu
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
Configuration TLS : https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-a-centos-vps
SSH
- SCP
- SFTP
NFS
Suivre l'article https://www.certdepot.net/rhel7-provide-nfs-network-shares-specific-clients/ avec srv03 en serveur et wks41 en client.
Serveur NFS srv03
- Installation du service
# yum groupinstall -y file-server
...
================================================================================
Package Arch Version Repository Size
================================================================================
Installing for group install "File and Storage Server":
cifs-utils x86_64 6.2-7.el7 base 84 k
gssproxy x86_64 0.4.1-7.el7 base 84 k
nfs-utils x86_64 1:1.3.0-0.21.el7_2 updates 371 k
nfs4-acl-tools x86_64 0.3.3-14.el7 base 47 k
samba x86_64 4.2.3-11.el7_2 updates 602 k
targetcli noarch 2.1.fb41-3.el7 base 61 k
targetd noarch 0.7.1-1.el7 base 49 k
Installing for dependencies:
PyYAML x86_64 3.10-11.el7 base 153 k
cups-libs x86_64 1:1.6.3-22.el7 base 355 k
keyutils x86_64 1.5.8-3.el7 base 54 k
libbasicobjects x86_64 0.1.1-25.el7 base 24 k
libcollection x86_64 0.6.2-25.el7 base 40 k
libevent x86_64 2.0.21-4.el7 base 214 k
libini_config x86_64 1.2.0-25.el7 base 59 k
libldb x86_64 1.1.20-1.el7_2.2 updates 123 k
libnfsidmap x86_64 0.25-12.el7 base 46 k
libnl x86_64 1.1.4-3.el7 base 128 k
libpath_utils x86_64 0.2.1-25.el7 base 27 k
libref_array x86_64 0.1.5-25.el7 base 26 k
libtalloc x86_64 2.1.2-1.el7 base 31 k
libtdb x86_64 1.3.6-2.el7 base 45 k
libtevent x86_64 0.9.25-1.el7 base 32 k
libtirpc x86_64 0.2.4-0.6.el7 base 85 k
libverto-tevent x86_64 0.2.5-4.el7 base 9.0 k
libwbclient x86_64 4.2.3-11.el7_2 updates 95 k
libyaml x86_64 0.1.4-11.el7_0 base 55 k
lvm2-python-libs x86_64 7:2.02.130-5.el7_2.1 updates 166 k
pyparsing noarch 1.5.6-9.el7 base 94 k
pytalloc x86_64 2.1.2-1.el7 base 13 k
python-configshell noarch 1:1.1.fb18-1.el7 base 67 k
python-ethtool x86_64 0.8-5.el7 base 33 k
python-kmod x86_64 0.9-4.el7 base 57 k
python-rtslib noarch 2.1.fb57-3.el7 base 88 k
python-setproctitle x86_64 1.1.6-5.el7 base 15 k
python-six noarch 1.9.0-2.el7 base 29 k
python-urwid x86_64 1.1.1-3.el7 base 654 k
quota x86_64 1:4.01-11.el7 base 176 k
quota-nls noarch 1:4.01-11.el7 base 89 k
rpcbind x86_64 0.2.0-33.el7_2 updates 57 k
samba-client-libs x86_64 4.2.3-11.el7_2 updates 4.3 M
samba-common noarch 4.2.3-11.el7_2 updates 269 k
samba-common-libs x86_64 4.2.3-11.el7_2 updates 156 k
samba-common-tools x86_64 4.2.3-11.el7_2 updates 443 k
samba-libs x86_64 4.2.3-11.el7_2 updates 259 k
tcp_wrappers x86_64 7.6-77.el7 base 78 k
Updating for dependencies:
device-mapper x86_64 7:1.02.107-5.el7_2.1 updates 252 k
device-mapper-event x86_64 7:1.02.107-5.el7_2.1 updates 167 k
device-mapper-event-libs x86_64 7:1.02.107-5.el7_2.1 updates 169 k
device-mapper-libs x86_64 7:1.02.107-5.el7_2.1 updates 304 k
lvm2 x86_64 7:2.02.130-5.el7_2.1 updates 1.0 M
lvm2-libs x86_64 7:2.02.130-5.el7_2.1 updates 872 k
...
Complete!
- Activation du service
# systemctl enable rpcbind nfs-server
# systemctl start rpcbind nfs-server
- Création des partages
# mkdir -p /home/tools
# chmod 0777 /home/tools
# mkdir -p /home/guests
# chmod 0777 /home/guests
- Adaptation SELinux
# yum install -y setroubleshoot-server
# semanage fcontext -a -t public_content_rw_t "/home/tools(/.*)?"
# semanage fcontext -a -t public_content_rw_t "/home/guests(/.*)?"
# restorecon -R /home/tools
# restorecon -R /home/guests
- Adaptation du fichier de configuration /etc/exports
# cat /etc/exports
/home/tools 192.168.22.0/24(rw,no_root_squash)
/home/guests 192.168.22.0/24(rw,no_root_squash)
- Activation des points de montage
# exportfs -avr
exporting 192.168.22.0/24:/home/guests
exporting 192.168.22.0/24:/home/tools
# systemctl restart nfs-server
- Montages disponibles
# showmount -e localhost
Export list for localhost:
/home/guests 192.168.22.0/24
/home/tools 192.168.22.0/24
- Tests
# ls /home/tools/
# touch /home/tools/test.txt
# ls /home/tools/
test.txt
Client
# yum install -y nfs-utils
# showmount -e srv01
Export list for srv01:
/home/guests 192.168.22.0/24
/home/tools 192.168.22.0/24
# mount -t nfs srv01:/home/tools /mnt
# df -h | grep tools
srv01:/home/tools 6.7G 985M 5.7G 15% /mnt
# ls /mnt
# touch /mnt/test2.txt
# ls /mnt
test2.txt test.txt
Scénario d'exercice
- Accès à la création d’un dossier partagé en read-write
- Création d’un disque LVM, montage sur le FS local
- Création du partage
- Accès au partage en Linux
- Accès au partage en Windows
Exercice : partage collaboratif
https://www.certdepot.net/rhel7-provide-nfs-network-shares-suitable-group-collaboration/
https://www.certdepot.net/rhel7-use-kerberos-control-access-nfs-network-shares/
Samba Server/client
Pour srv03, suivre https://www.certdepot.net/rhel7-provide-smb-network-shares/
Samba AD DC
Pour l'installation sur un serveur supplémentaire, voir les commandes plus bas et suivre http://blog.goffinet.eu/2013/07/linuxlabs8-serveur-active-directory-en.html lui-même fondé sur un article de samba.org.
yum install realmd samba samba-common oddjob oddjob-mkhomedir sssd ntpdate ntp
- Préparation du serveur
- Configuration des services AD
- Intégration d'une machine Windows 7
- Installation et utilisation des consoles ads.msc et gpmc.msc
- Configurations avancées
- Migration du DNS Backend
Cups
- Client
- Serveur
iSCSI
https://www.certdepot.net/rhel7-configure-iscsi-target-initiator-persistently/