Включаем и перезагружаем службу синхронизации времени:
root@ISP:~# systemctl enable chrony
root@ISP:~# systemctl restart chrony
Проверяем:
root@ISP:~# date
Mon 04 Apr 2022 11:40:43 AM MSK
15 .Настройка NTP на машине SRV:
В поиске находим Edit group policy
идём по пути
Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Windows Defender Firewall with Advar > Windows Defender Firewall with Ac
-> Inbound Rules (правая кнопка мыши)
-> Port
-> UDP
-> Specific local ports: 123
-> Allow the connection
-> Name: NTP
Правой кнопкой мыши по старту(где обычно кнопка выключения)
-> Computer Management
-> Services and Applications
-> Services
-> Windows Time
-> Stop
-> Start
Настраиваем NTP:
В поиске находим Edit group policy
идём по пути
Computer Configuration -> Administrative Templates -> System -> Windows Time Service -> Time Providers
Переводим групповые политики Enable Windows NTP Client и Enable Windows NTP Server в режим Enabled.
Настраиваем Windows NTP Client:
два раза нажимаем на Previous Setting
NtpServer 4.4.4.1
Type NTP
-> Next Setting
Обновляем групповую политику в Powershell или cmd:
С:\Users\Administrator>gpupdate /force
Настраиваем временную зону в настройках (Date & time):
Time zone = (UTC+03:00) Moscow, St. Petersburg
Чуть ниже нажимаем "add clocks for different zones"
->Internet Time Settings
-> Change settings
Server: 4.4.4.1
-> Update now
16 .Настраиваем NTP на остальных машинах
CLI:
Настраиваем временную зону в настройках (Date & time):
Time zone = (UTC+03:00) Moscow, St. Petersburg
Чуть ниже нажимаем "add clocks for different zones"
->Internet Time Settings
-> Change settings
Server: 3.3.3.1
-> Update now
Машины WEB:
root@debian:~# nano /etc/chrony/chrony.conf
pool ntp.int.demo.wsr iburst
allow 192.168.100.0/24
timedatectl set-timezone Europe/Moscow
root@debian:~# systemctl enable chrony
root@debian:~# systemctl restart chrony
root@debian:~# timedatectl show
NTPSynchronized=yes
Cisco:
RTR-L(config)#clock timezone UTC +3
RTR-L(config)#ip domain nаме int.demo.wsr
RTR-L(config)#ip nаме-server 192.168.100.200
RTR-L(config)#ntp server ntp.int.demo.wsr
RTR-R(config)#clock timezone UTC +3
RTR-R(config)#ip domain nаме int.demo.wsr
RTR-R(config)#ip nаме-server 192.168.100.200
RTR-R(config)#ntp server ntp.int.demo.wsr
На данных машинах время синхронизируется минут через 10:
RTR-L#show ntp status
Clock is synchronized
17 .Настройка RAID-1 на SRV
Переходим в настройки дисков:
Правой кнопкой мыши по старту(где обычно кнопка выключения)
-> Disk Management
Переводим два диска в режим Online(Правой кнопкой мыши):
-> Online
Инициализируем диски(Правой кнопкой мыши):
->Initialize Disk
-> ok
Конвертируем диски в динамические(Правой кнопкой мыши):
-> Convert to Dynamic Disk...
выбираем оба диска
-> OK
Создаем RAID-1 (Тип: Зеркало - это по заданию)(Правой кнопкой мыши):
-> New Mirrored Volume...
Выбираем оба диска, чтоб они были в правой части:
-> Next
Назначаем букву согласно заданию (в нашем случае R:\):
-> Assign the following drive letter: R\/
-> Next
Даем название, можно как у меня:
-> Format this volume with the following settings:
Rie system: NTFS
Allocation unit size: Default
Volume label: Windows Storage
-> Next
Ждем окончания операции:
18.Настраиваем Samba-сервер на машине SRV:
Настраиваем общую папку.
В левой части Server Manager выбираем File and Storage -> Shares -> To create a file share, start the New Share Wizard.
->Select Profile
-> SMB Share - Quick
-> Next
-> Share Location
-> Type a custom path: R:\storage
-> Next
-> Share name: SMB
-> Permissions
-> Customize permissions...
-> Disable inheritance
-> Remove all...
-> Add
-> Select a principal
Enter the object...: Everyone
-> Ok
Type = Allow
-> Full control
-> Ok
-> Share
-> Everyone
-> Edit
-> Full control
-> Apply
-> Ok
-> Next
-> Create
19.Настраиваем общую папку на машинах Web-L и Web-R
lure Active Directory Certificate Services on thT]
Feature installation
Configuration required. Installation succeeded on SRV.
Add Roles and Features
Task Details
[и Add Roles and Features Wizard
Ra AD CS Configuration - □ /*
Гйй AD CS Configuration
Role Services
Credentials
Select Role Services to configure
Role Services
Setup Type
Г Д Tvna
0 Certification Authority
0 Certification Authority Web Enrollment
DESTINATION SERVER
SRV
DESTINATION SERVER
Credentials srv
H Credentials
Specify credentials to configure role services
Role Services
To install the following role services you must belong to the local Administrators group:
Standalone certification authority
Certification Authority Web Enrollment
Online Responder
To install the following role services you must belong to the Enterprise Admins group:
Enterprise certification authority
Certificate Enrollment Policy Web Service
Certificate Enrollment Web Service
Network Device Enrollment Service
Credentials: SRV\Administrator | Change."
Гйы AD CS Configuration - □ /*
DESTINATION SERVER
Setup Type srv
Credentials
Role Services
Setup Type
CA Type
Private Key Cryptography CA Name
Validity Period Certificate Database
Confirmation
Specify the setup type of the CA
Enterprise certification authorities (CAs) can use Active Directory Domain Services (AD DS) to simplify the management of certificates. Standalone CAs do not use AD DS to issue or manage certificates.
О Enterprise CA
Enterprise CAs must be domain members and are typically online to issue certificates or certificate policies.
() Standalone CA
Standalone CAs can be members or a workgroup or domain. Standalone CAs do not require AD DS and can be used without a network connection (offline).
fa AD CS Configuration - □ X
DESTINATION SERVER
CA Type srv
Credentials
Role Services
Setup Type
CA Type
Private Key Cryptography CA Name
Specify the type of the CA
When you install Active Directory Certificate Services (AD CS), you are creating or extending a public key infrastructure (PKI) hierarchy. A root CA is at the top of the PKI hierarchy and issues its own self-signed certificate. A subordinate CA receives a certificate from the CA above it in the PKI hierarchy.
ў Root CA
Root CAs are the first and may be the only CAs configured in a PKI hierarchy.
fsa AD CS Configuration - □ X
DESTINATION SERVER
CA Name srv
Credentials
Role Services
Setup Type
CA Type
Private Key
Cryptography
CA Name
Validity Period
Certificate Database
Confirmation
Specify the name of the CA
Type a common name to identify this certification authority (CA). This name is added to all certificates issued by the CA. Distinguished name suffix values are automatically generated but can be modified.
Common name for this CA:
|demo.wsr ~|
Distinguished name suffix:
Preview of distinguished name:
CN=DEMO.WSR
Заходим в PowerShellISE и прописываем там команды для создания и
В браузере на машине SRV переходим по адресу https://localhost/certsrv для создания и получения сертификата:
Request a Certificate
Select the certificate type:
Web Browser Certificate
E-Mail Protection Certificate
Or. submit an[advanced certificale reguest|
Advanced Certificate Request
The policy of the CA determines the types of certificates you can request. Click one of the following options to:
[create and submit a requestta this CA.|
Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file.
Создаем запрос на получение сертификата:
Type of CertificaifiJtefidfilL
Server Authentication Certificate v
Key Options:
□ Enable strong private key protection
Additional Options:
Request Format: О CMC PKCS 10
Hash Algorithm: | sha1 v|
Only used fo sign request
| Submit >~|
Microsoft Active Directory Certificate Services - Demo.wsr
Certificate Pending
Your certificate request has been received. However, you must wait for an administrator to issue the certificate you requested.
Your Request Id is 2.
Please return to this web site in a day or two to retrieve your certificate.
Note: You must return with this web browser within 10 days to retrieve your certificate
Одобряем сертификат в нашем центре сертификации:
fe] certsrv-[Certification Authority (Local)\Demo.wsr\Pending Requests] - □ X
File Action View Help
Й SI Q
Certification Authority (Local) v gj Demo.wsr
_ Revoked Certificates
j Issued Certificates
,~4 Pending Requests
_ Failed Requests
Request ID Binary Request Request Status Code Request Disposition Message Request g*]2 -----BEGIN NE... The operation compl... Taken Under Submission 4/22/20
Request ID Binary Request Request Status Code Request Disposition Message Request
All Tasks
Refresh
Help
4/22/20|
Устанавливаем сертификат:
Welcome
Use this Web site to request a certificate for your Web browser, e-mail client, or other program By using a certificate, you c with over the Web, sign and encrypt messages, and, depending upon the type of certificate you request, perform other sect
You can also use this Web site to download a certificate authority (CA) certificate, certificate chain, or certificate revocation request.
For more information about Active Directory Certificate Services, see Active Directory Certificate Services Documentation.
Select a task:
Request a certificate__________________________
|View the status of a pending certificate requesl|
Download a CA certificate, certificate chain, or CRL
Microsoft Active Directory Certificate Services - Demo.wsr
View the Status of a Pending Certificate Request
Select the certificate request you want to view:_________________________
Microsoft Active Directory Certificate Services - Demo wsr
Certificate Issued
The certificate you requested was issued to you.
[E] Install this certificate
□ Save response
Certification Authority
Desktop app
Settings
Manage computer certificates
S& Manage user certificates |
.3* Manage file encryption certificates
P cert
Экспортируем новый сертификат вместе с закрытым ключом:
a certmgr - [Certificates - Current UserXPersonalXCertificates]
File Action View Help
*4I si о U l в a
5 Certificates - Current User I |SSqed Tp Issued Bv
Ex
4/
v Personal I www.demo.wsr Demo.wsr
Гт1 Certificates
> j Trusted Root Certification Au
Private keys are password protected. If you want to export the private key with the certificate, you must type a password on a later page.
Do you want to export the private key with the certificate?
f@Yes~export the private key^
О No, do not export the private key
Export File Format
Certificates can be exported in a variety of file formats,
Select the format you want to use:
О DER encoded binary X. 509 (.CER)
О Base-64 encoded X. 509 (.CER)
О Cryptographic Message Syntax Standard - PKCS #7 Certificates (.P7B) E Include all certificates in the certification path if possible
Iў Personal Information Exchange - PKCS #1^PFX^^ ^^PHndud^Hertficate^r^i^ertficatior^atiTif possible]
О Delete the private key if the export is successful
□ Export all extended properties
| PI Enable certificate privacy |
Microsoft Serialized Certificate Store (.SST)
Security
To maintain security, you must protect the private key to a security principal or by using a password.
0 Group or user names (recommended)
& Certificate Export Wizard
File to Export
Spedfy the name of the file you want to export
File iw -।___________________________
R:\storage\www.pfx Г B r o w se
22 .Устанавливаем приложение из контейнера Docker на машины WEB
Добавляем в дисковод диск с образом Docker:
Создаем каталог для монтирования диска с докером:
mkdir /opt/docker
Монтируем диск с докером в созданный каталог:
mount /dev/sr0 /opt/docker/
Смотрим, что находится сейчас в каталоге:
ls /opt/docker/
appdocker0.zip
containerd.io_1.4.13-l_amd64.deb
dbus-user-session_l.12.30-3_amd64.deb
docker-ce_5%353a30.10.13r",3-0~debian-bullseye_amd64. deb
docker-ce-cli_5K353a30.10.13r",3-0~debian-bullseye_amd64. deb
docker-ce-root less-extras_5K353a30.10.13~3-0r",debian-bullseye_amd64. deb docker-scan-piugin_0.13.0~debian-bullseye_amd64.deb iptables_l.8.7-l_amd64.deb
Readme.txt
Создаем каталог, чтобы скопировать файлы установки докера. Это нужно, чтобы мы смогли его установить, т.к. для установки также нужен диск Debian BD1, а в дисководе только диск с докером:
mkdir /files/
Создаем каталог, чтобы скопировать файл самого приложения для докера и файла Readme.txt:
mkdir /webapp/
Копируем установочные файлы докера в созданный нами каталог /files/:
24 .Добавляем основной сертификат на машину CLI и проверяем работу
На машине SRV:
Экспортируем корневой сертификат:
Manage Private Keys... Advanced Operations
Request Certificate with New Key,..
Renew Certificate with New Key...
Certificates - Local Computer a v ГТ Personal
ГЗ Certificates
> 0 Trusted Root Certification
> П Enterprise Trust
> Г~1 Intermediate Certification
> П Trusted Publishers
> П Untrusted Certificates
> Q Third-Party Root Certifica-
> П Trusted People
> lZ. Client Authentication Issu
> □ Preview Build Roots
> Q Test Roots
> Q Certificate Enrollment Rec
> П Smart Card Trusted Roots
> ГТ Trusted Devices
> П Web Hosting
На машине CLI:
Передаем с помощью протокола scp корневой сертификат на машину CLI:
Устанавливаем сертификат в доверенное хранилище сертификатов:
Проверяем работоспособность на машине CLI:
j?) 0 AppDockEiO X +
GA Not secure | https://www.demo.wsr
Hello, fellow user, this is AppDemoO!
E D https://www.derTno.wsr/he3lth X
<- О A Not secure | https://www.demo.wsr/health
Success!
E D AppDockerO - Messages X -|-
<- Q A Not secure | https://www.demo.wsr/get
History
ID
Message
1
1st message!
7
2nd message!
3
3rd message!
Более подробная инструкция по работе с приложением находится в файле Readme.txt, находящемся на диске с докером.
Настройка сервера srv WIN в качестве
В Server Manager нажимаем manage далее add roles and features
В server rules заходим в File and Storage services > file and iscsi
Ставим галочки file server и iscsi target server
Скачиваем
Далее переходим в server manager > ISCSI > create ISCSI virtual disk start the New ISCSI
Выбираем диск> имя диска> >имя таргета> Access servers какие сервера могут подключится добавляем ip или dns
Настройка ISCSI в качестве инициатора
Еще раз коротко напомним, сервер iSCSI называется портал, он содержит цели (таргет, Target), каждая цель предоставляет доступ к одному или нескольким блочным устройствам. Клиент iSCSI называется инициатор (Initiator), одна цель может быть подключена только к одному инициатору, исключения - кластерные системы.
В качестве инициатора в Linux системах используется Open-iSCSI, установим его, перед установкой не забудем обновить список пакетов. Здесь и далее все команды выполняются от имени суперпользователя или через sudo.
apt update
apt install open-iscsi
Затем перейдем в /etc/iscsi и откроем файл iscsid.conf. Найдем и раскомментируем опцию:
node.startup = automatic
Ниже обязательно закомментируем:
node.startup = manual
Затем зададим параметры аутентификации инициатора, раскомментировав опции:
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password
Если предполагается работа только с одной целью, то можно сразу указать здесь используемые логин и пароль, можно же оставить как есть, указав нужные данные уже при настройке подключения к цели.
Сохраним файл и перезапускаем службу:
service open-iscsi restart
Теперь попробуем подключиться к порталу и получить список доступных целей:
iscsiadm -m discovery -p 192.168.111.153 -t st
Это короткая запись команды, полная будет выглядеть так:
Из чего становится понятно, что мы должны подключиться к порталу 192.168.111.153 в режиме обнаружения и получить него все доступные цели.
После успешного выполнения данной команды в /etc/iscsi появятся две директории nodes - которая содержит вложенные каталоги для каждого IQN - и send_targets - с вложенными каталогами для каждой цели. Перейдем в nodes и провалимся в каталог с IQN нашей цели, в нем откроем еще один каталог с адресом и портом, в котором обнаружим файл default. Откроем его на редактирование.
Прежде всего убедимся, что
node.startup = automatic
Если же вам нужно, чтобы указанная цель не подключалась автоматически при загрузке, то измените automatic на manual.
Затем найдите:
node.session.auth.username = username
node.session.auth.password = password
И укажите там логин и пароль для подключения к вашей цели.
Теперь можно подключить цель, для этого можно использовать команду:
iscsiadm -m node --login
Которая подключит все цели, конфигурационные файлы которых находятся в каталоге nodes, если требуется подключить только отдельную цель, то укажите ее явно:
Которая покажет все подключенные блочные устройства, среди которых должен оказаться и предоставляемый целью диск, в нашем случае на скриншоте ниже виден 2 ГБ диск sdb. Также можно посмотреть все текущие подключения iSCSI:
iscsiadm -m session
open-iscsi-debian-ubuntu-001.png Для удаления ненужных целей воспользуйтесь командой: