ja:documentation:pandorafms:technical_annexes:46_mysql_sha

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_annexes:46_mysql_sha [2025/01/22 07:51] – 作成 junichija:documentation:pandorafms:technical_annexes:46_mysql_sha [2025/03/10 07:40] (現在) – [概要] junichi
行 1: 行 1:
-====== Configuring SHA authentication method in MySQL ======+====== MySQL での SHA 認証設定 ======
  
 {{indexmenu_n>46}} {{indexmenu_n>46}}
 +
 +[[:ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
  
 <wrap #ks1 /> <wrap #ks1 />
-===== Introduction =====+===== 概要 =====
  
-As of MySQL version 8 the hashing of database user passwords [[https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password|has been changed by default]] to ''caching_sha2_password''. This method encompasses both obsolete protocols (SHA 256), as well as current and future protocols, combined with the caching capability of the entire encryption mechanism and valid comparison of user credentials.+As of MySQL version 8,  database user password hashing [[https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password|has been changed by default]] to ''caching_sha2_password''. This method encompasses both obsolete protocols (SHA 256), as well as current and future protocols, combined with the caching capability of the entire encryption mechanism and valid comparison of user credentials. 
 + 
 +MySQL バージョン 8 以降、データベースユーザパスワードのハッシュはデフォルトで [[https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password|]] ''caching_sha2_password'' に変更されました。この方法は、廃止されたプロトコル (SHA 256) と現在のプロトコルおよび将来のプロトコルの両方を網羅し、暗号化メカニズム全体のキャッシュ機能とユーザ資格情報の有効な比較を組み合わせます。
  
 On a new MySQL 8 installation this is the default method, however, MySQL servers that have upgraded from previous versions retain the previous method called ''mysql_native_password''. This consideration prevents old users from losing remote connection because, on the client side, the connection and authentication process must be updated and configured. On a new MySQL 8 installation this is the default method, however, MySQL servers that have upgraded from previous versions retain the previous method called ''mysql_native_password''. This consideration prevents old users from losing remote connection because, on the client side, the connection and authentication process must be updated and configured.
 +
 +新しい MySQL 8 インストールではこれがデフォルトの方法ですが、以前のバージョンからアップグレードした MySQL サーバでは、以前の方法である ''mysql_native_password'' が保持されます。これにより、クライアント側で接続と認証プロセスを更新して設定する必要がありますが、古いユーザがリモート接続を失うことがなくなります。
  
 In Pandora\_FMS the connection between the Web Console and the PFMS server (//monolithic environment//) is done through a Unix type connection file (<wrap :en>**Unix socket-file**</wrap>) and <wrap :en>**shared-memory protocol**</wrap>, which are considered protected and secure in a local environment, **so in this particular case the protocol used for the encryption, encoding and transmission of passwords and data is indistinct**. In Pandora\_FMS the connection between the Web Console and the PFMS server (//monolithic environment//) is done through a Unix type connection file (<wrap :en>**Unix socket-file**</wrap>) and <wrap :en>**shared-memory protocol**</wrap>, which are considered protected and secure in a local environment, **so in this particular case the protocol used for the encryption, encoding and transmission of passwords and data is indistinct**.
 +
 +Pandora FMS では、Web コンソールと PFMS サーバ (//モノリシック環境//) 間の接続は、Unix タイプの接続ファイル (<wrap :en>**Unix ソケットファイル**</wrap>) と <wrap :en>**共有メモリプロトコル**</wrap> を介して行われます。これらは、ローカル環境は保護され安全であると見なされているため、**この特定のケースでは、パスワードとデータの暗号化、エンコード、および送信に使用されるプロトコルは不明確です**。
  
 In view of this situation, and in order to keep security best practices up to date, it is recommended to change the encryption protocol from ''mysql_native_password'' to ''caching_sha2_password'', for the default user ''pandora'', with this tutorial. In view of this situation, and in order to keep security best practices up to date, it is recommended to change the encryption protocol from ''mysql_native_password'' to ''caching_sha2_password'', for the default user ''pandora'', with this tutorial.
 +
 +このような状況を考慮し、セキュリティのベストプラクティスを最新の状態に保つために、このチュートリアルでは、デフォルトユーザ ''pandora'' の暗号化プロトコルを ''mysql_native_password'' から ''caching_sha2_password'' に変更することをお勧めします。
  
 <wrap #ks2 /> <wrap #ks2 />
-===== Prerequisites =====+ 
 +===== 前提条件 =====
  
 You must confirm if you have installed a version equal or later than MySQL 8.0.4 with the following command (in its long version): You must confirm if you have installed a version equal or later than MySQL 8.0.4 with the following command (in its long version):
 +
 +次のコマンド (長いバージョン) を使用して、MySQL 8.0.4 以降のバージョンがインストールされているかどうかを確認する必要があります。
  
 <code bash> <code bash>
行 25: 行 38:
  
 Or in its short version: Or in its short version:
 +
 +あるいは短縮版では次のようになります。
  
 <code bash> <code bash>
行 32: 行 47:
  
 You will get something similar to this: You will get something similar to this:
 +
 +次のような内容が表示されます:
  
 <file> <file>
行 50: 行 67:
  
 Obtaining a result similar to the following: Obtaining a result similar to the following:
 +
 +{{ :wiki:pfms_46_mysql_sha_image_005.png  }}
 +\\
 +</WRAP>
 +
 +<WRAP center round info 90%>
 +
 +ここでは、''pandora'' という名前のユーザ名と ''Pandor4!'' というパスワードを使用します。
 +
 +それぞれの特定のケースでは、次の方法でこれらの値を参照できます。
 +
 +<code bash>
 +cat /var/www/html/pandora_console/include/config.php | grep dbuser
 +cat /var/www/html/pandora_console/include/config.php | grep dbpass
 +</code>
 +
 +次のような結果が得られます。
  
 {{ :wiki:pfms_46_mysql_sha_image_005.png  }} {{ :wiki:pfms_46_mysql_sha_image_005.png  }}
行 56: 行 90:
  
 <wrap #ks3 /> <wrap #ks3 />
-===== Procedure for all operating systems =====+ 
 +===== すべてのオペレーティングシステム向けの手順 =====
  
   * **Stop PFMS server**.   * **Stop PFMS server**.
 +
 +  * **PFMS サーバの停止**
  
 It must be executed in a terminal window: It must be executed in a terminal window:
 +
 +ターミナルウィンドウで実行する必要があります:
  
 <code bash> <code bash>
行 68: 行 107:
  
   * **Active user check**.   * **Active user check**.
 +
 +  * **アクティブなユーザ確認**
  
 It is necessary to check if the active user for database connection (by default ''pandora'') uses ''mysql_native_password''. To do this, log in to MySQL as ''root'' and execute the following query: It is necessary to check if the active user for database connection (by default ''pandora'') uses ''mysql_native_password''. To do this, log in to MySQL as ''root'' and execute the following query:
 +
 +データベース接続のアクティブユーザ (デフォルトでは ''pandora'') が ''mysql_native_password'' を使用しているかどうかを確認する必要があります。これを行うには、''root'' として MySQL にログインし、次のクエリを実行します。
  
 <code sql> <code sql>
行 77: 行 120:
  
 You will get an answer similar to: You will get an answer similar to:
 +
 +次のような応答が得られます。
  
 {{ :wiki:pfms_46_mysql_sha_image_010.png  }} {{ :wiki:pfms_46_mysql_sha_image_010.png  }}
  
   * **Change password type**.   * **Change password type**.
 +
 +  * **パスワードタイプの変更**
  
 The authentication method is changed and a password is defined with the following statement: The authentication method is changed and a password is defined with the following statement:
 +
 +次のステートメントを使用して認証方法を変更し、パスワードを定義します。
  
 <code sql> <code sql>
行 90: 行 139:
  
   * **Checking the change**.   * **Checking the change**.
 +
 +  * **変更の確認**
  
 When running again: When running again:
 +
 +再度実行した場合:
  
 <code sql> <code sql>
行 99: 行 152:
  
 The following should be obtained: The following should be obtained:
 +
 +次のような出力が得られます。
  
 {{ :wiki:pfms_46_mysql_sha_image_020.png  }} {{ :wiki:pfms_46_mysql_sha_image_020.png  }}
  
 Once the change has been verified at the server level, close the MySQL interface with the ''exit;'' command and [[#ks4|proceed to the next step at the client level]]. Once the change has been verified at the server level, close the MySQL interface with the ''exit;'' command and [[#ks4|proceed to the next step at the client level]].
 +
 +サーバレベルで変更を確認したら、''exit;'' コマンドを使用して MySQL インターフェイスを閉じ、[[#ks4|クライアントレベルで次の手順に進みます]]。
  
 <wrap #ks4 /> <wrap #ks4 />
-===== Customer configuration =====+ 
 +===== クライアント設定 =====
  
 As explained in [[#ks1|introduction]], on the client side the connection must be updated and configured according to the type of operating system used: [[#ks4_1|EL 8 /EL 9]] or [[#ks4_2|Ubuntu]]. As explained in [[#ks1|introduction]], on the client side the connection must be updated and configured according to the type of operating system used: [[#ks4_1|EL 8 /EL 9]] or [[#ks4_2|Ubuntu]].
 +
 +[[#ks1|概要]]で説明したように、クライアント側では、使用するオペレーティングシステムの種類([[#ks4_1|EL 8 /EL 9]]または[[#ks4_2|Ubuntu]])に応じて接続を更新および設定する必要があります。
  
 <wrap #ks4_1 /> <wrap #ks4_1 />
 +
 ==== EL8 / EL9 ==== ==== EL8 / EL9 ====
  
 You must have the ''mariadb-connector-c'' package installed, which is installed by default in most EL8 and EL9 environments. You must have the ''mariadb-connector-c'' package installed, which is installed by default in most EL8 and EL9 environments.
 +
 +ほとんどの EL8 および EL9 環境ではデフォルトでインストールされている ''mariadb-connector-c'' パッケージがインストールされている必要があります。
  
 The file is checked for existence with: The file is checked for existence with:
 +
 +ファイルの存在は次のように確認できます:
  
 <code bash> <code bash>
行 122: 行 187:
  
 A positive response similar to the following will be obtained: A positive response similar to the following will be obtained:
 +
 +次のような応答が得られます。
  
 {{ :wiki:pfms_46_mysql_sha_image_030.png  }} {{ :wiki:pfms_46_mysql_sha_image_030.png  }}
  
 The next step is to create a symbolic link to that file with the command: The next step is to create a symbolic link to that file with the command:
 +
 +次のステップは、次のコマンドを使用してそのファイルへのシンボリックリンクを作成することです。
  
 <code bash> <code bash>
行 133: 行 202:
  
 The link made with is checked: The link made with is checked:
 +
 +作成されたリンクは次のように確認します:
  
 <code bash> <code bash>
行 140: 行 211:
  
 The following positive response was obtained: The following positive response was obtained:
 +
 +次のような応答が得られます。
  
 {{ :wiki:pfms_46_mysql_sha_image_040.png  }} {{ :wiki:pfms_46_mysql_sha_image_040.png  }}
行 145: 行 218:
 With all steps successfully completed, [[#ks5|only the PFMS server restart]] remains. With all steps successfully completed, [[#ks5|only the PFMS server restart]] remains.
  
 +すべての手順が正常に完了したら、あとは [[#ks5|PFMS サーバの再起動]] のみです。
  
 <wrap #ks4_2 /> <wrap #ks4_2 />
 +
 ==== Ubuntu ==== ==== Ubuntu ====
  
 The ''libmariadb3'' package must be installed. Depending on the version installed it may not come with the operating system and must be installed with the command: The ''libmariadb3'' package must be installed. Depending on the version installed it may not come with the operating system and must be installed with the command:
 +
 +''libmariadb3'' パッケージをインストールする必要があります。インストールされたバージョンによっては、オペレーティングシステムに付属していない場合があります。その場合は、次のコマンドを使用してインストールする必要があります。
  
 <code bash> <code bash>
行 157: 行 234:
  
 It is verified that the required file has been generated with the installation of the package, ''caching_sha2_password.so'': It is verified that the required file has been generated with the installation of the package, ''caching_sha2_password.so'':
 +
 +パッケージ ''caching_sha2_password.so'' のインストールにより、必要なファイルが生成されたことが確認できます。
  
 <code bash> <code bash>
行 163: 行 242:
  
 The destination folder ''/usr/lib64/mysql/plugin/'' must be created with the command: The destination folder ''/usr/lib64/mysql/plugin/'' must be created with the command:
 +
 +次のコマンドを使用して、フォルダ ''/usr/lib64/mysql/plugin/'' を作成する必要があります。
  
 <code bash> <code bash>
行 170: 行 251:
  
 Now the symbolic link must be created: Now the symbolic link must be created:
 +
 +ここで、シンボリックリンクを作成する必要があります。
  
 <code bash> <code bash>
行 176: 行 259:
  
 With these steps the server will be able to use SHA2 authentication to connect to the database. Go to [[#ks5|next step (restart Pandora FMS server)]] to finish the configuration. With these steps the server will be able to use SHA2 authentication to connect to the database. Go to [[#ks5|next step (restart Pandora FMS server)]] to finish the configuration.
 +
 +この手順により、サーバは SHA2 認証を使用してデータベースに接続できるようになります。[[#ks5|次のステップ (Pandora FMS サーバの再起動)]] に進み、設定を完了します。
  
 <wrap #ks5 /> <wrap #ks5 />
-===== Restart PFMS server =====+ 
 +===== PFMS サーバの再起動 =====
  
 To be executed: To be executed:
 +
 +以下を実行します:
  
 <code bash> <code bash>
行 188: 行 276:
  
 After a few moments, the status must be confirmed via the Web Console. (menú <wrap :en>**Management → Servers → Manage servers**</wrap>): After a few moments, the status must be confirmed via the Web Console. (menú <wrap :en>**Management → Servers → Manage servers**</wrap>):
 +
 +しばらくしたら、Web コンソールからステータスを確認します。(メニュー <wrap :ja>**管理(Management) → サーバ(Servers) → サーバの管理(Manage servers)**</wrap>):
  
 {{ :wiki:pfms_46_mysql_sha_image_050.png  }} {{ :wiki:pfms_46_mysql_sha_image_050.png  }}
  
-[[:en:documentation:start|Back to Pandora FMS Documentation Index]]+[[:ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
  • ja/documentation/pandorafms/technical_annexes/46_mysql_sha.1737532280.txt.gz
  • 最終更新: 2025/01/22 07:51
  • by junichi