そういうのがいいブログ

SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ

CentOS8とSamba4.12でActive Directory構築(2)準備

※[PR]当ブログの記事の中にはプロモーションが含まれています。

準備編

CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順(2)準備編

CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順を探している方へ。

CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順を知りたい

CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順を知りたい、と考えていませんか?

CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順を紹介します

本記事では、下記の内容を解説します。

  1. CentOS8.2とSamba4.12.6を使ってActive Directory環境を構築する手順

この記事を書いている私は、某SIerに勤務しながら、
WEB系エンジニア・インフラエンジニアに憧れて、プログラミングおよびインフラ技術の勉強をしています。
私が実機で試したコマンドや画像を載せて書いています。
記事の信頼性担保に繋がると思います。

Active Directory構築のまとめ記事

本ブログでは、CentOS8.2とSamba4.12.6でのActive Directory構築を、
(1)~(14)のステップに分けて紹介しています。
本記事はそのうちの(2)です。

以下が、(1)~(14)のまとめ記事です

souiunogaii.hatenablog.com

ホスト名の確認

hostname
[root@SV-EARTH ~]# hostname
SV-EARTH

hostsファイルの編集

vi /etc/hosts
[root@SV-EARTH ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.101    pc-ganymede
192.168.1.102    sv-earth.ad.planet.jp sv-earth
192.168.1.103    sv-jupiter
192.168.1.104    sv-uranus
192.168.1.105    sv-neptune
192.168.1.106    sv-pluto
192.168.1.107    sv-saturn

192.168.1.102 sv-earth.ad.planet.jp sv-earth の1行が追記した部分です。

時刻同期の確認

cat /etc/chrony.conf
[root@SV-EARTH ~]# cat /etc/chrony.conf
# These servers were defined in the installation:
server ntp1.jst.mfeed.ad.jp iburst
server ntp2.jst.mfeed.ad.jp iburst
server ntp3.jst.mfeed.ad.jp iburst
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16

# Serve time even if not synchronized to a time source.
#local stratum 10

# Specify file containing keys for NTP authentication.
keyfile /etc/chrony.keys

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
#log measurements statistics tracking
chronyc sources
[root@SV-EARTH ~]# chronyc sources
210 Number of sources = 3
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* ntp1.jst.mfeed.ad.jp          2  10   377   55m   -119us[  +44us] +/-   63ms
^+ ntp2.jst.mfeed.ad.jp          2   9   377   63m  +1614us[+1780us] +/-   47ms
^+ ntp3.jst.mfeed.ad.jp          2  10   377   648  +1411us[+1411us] +/-   77ms

*が付いているのが、正常に時刻同期が出来ているNTPサーバーです。

epelのインストール

dnf install epel-release
[root@SV-EARTH ~]# dnf install epel-release
メタデータの期限切れの最終確認: 0:42:36 時間前の 20200815221506秒 に実施しました。
依存関係が解決しました。
========================================================================================================================
 パッケージ                      アーキテクチャー          バージョン                   リポジトリー              サイズ
========================================================================================================================
インストール中:
 epel-release                    noarch                    8-8.el8                      extras                     23 k

トランザクションの概要
========================================================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 23 k
インストール済みのサイズ: 32 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
epel-release-8-8.el8.noarch.rpm                                                         611 kB/s |  23 kB     00:00
------------------------------------------------------------------------------------------------------------------------
合計                                                                                     66 kB/s |  23 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備              :                                                                                               1/1
  インストール中    : epel-release-8-8.el8.noarch                                                                   1/1
  scriptlet の実行中: epel-release-8-8.el8.noarch                                                                   1/1
  検証              : epel-release-8-8.el8.noarch                                                                   1/1
Installed products updated.

インストール済み:
  epel-release-8-8.el8.noarch

完了しました!
dnf list installed | grep epel
[root@SV-EARTH ~]# dnf list installed | grep epel
epel-release.noarch                           8-8.el8                                        @extras
dnf repolist
[root@SV-EARTH ~]# dnf repolist
repo id                                repo の名前
AppStream                              CentOS-8 - AppStream
BaseOS                                 CentOS-8 - Base
epel                                   Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                           Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                                 CentOS-8 - Extras

PowerToolsの有効化

dnf config-manager --set-enabled PowerTools
[root@SV-EARTH ~]# dnf config-manager --set-enabled PowerTools
[root@SV-EARTH ~]#
 dnf repolist
[root@SV-EARTH ~]# dnf repolist
repo id                                repo の名前
AppStream                              CentOS-8 - AppStream
BaseOS                                 CentOS-8 - Base
PowerTools                             CentOS-8 - PowerTools
epel                                   Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                           Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                                 CentOS-8 - Extras