差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:07_technical_annexes:01_ssh_and_ftp_setup [2022/02/20 06:12] – [クライアントでの鍵作成] junichi | ja:documentation:07_technical_annexes:01_ssh_and_ftp_setup [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== SSH および FTP でのデータ転送設定 ====== | ||
- | {{indexmenu_n> | ||
- | [[ja: | ||
- | |||
- | ===== 概要 ===== | ||
- | |||
- | The standard transfer method in Pandora FMS to send files, [[: | ||
- | |||
- | Pandora FMS で標準の転送方法(tentacle)を使用できない場合があります。これは、[[https:// | ||
- | |||
- | {{ : | ||
- | |||
- | Pandora FMS can use the FTP or SSH protocol to copy the XML data packages generated by the [[: | ||
- | |||
- | Pandora FMS は、SSH プロトコルを使用して、[[: | ||
- | |||
- | ===== Pandora FMS へのデータ取り込みのための SSH 設定 ===== | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | <WRAP center round info 60%> | ||
- | |||
- | Consider Pandora FMS server as **Server** and each one of the devices running the Software Agent as **Client**. You may always check which user you are working with by means of the **whoami** command. | ||
- | |||
- | Pandora FMS サーバを **サーバ** と見なし、ソフトウェアエージェントを実行している各デバイスを **クライアント** と見なします。 **whoami** コマンドを使用して、作業しているユーザをいつでも確認できます。 | ||
- | |||
- | ==== サーバでのユーザ作成 ==== | ||
- | |||
- | **Step 1**: Create a '' | ||
- | |||
- | **ステップ 1**: Pandora FMS サーバがインストールされているホストに '' | ||
- | |||
- | < | ||
- | passwd pandora | ||
- | |||
- | </ | ||
- | |||
- | ==== サーバのユーザ設定 ==== | ||
- | |||
- | **Step 2**. Once within the server, create the ''/ | ||
- | |||
- | **ステップ 2**. サーバ内で、パーミッション '' | ||
- | |||
- | ==== クライアントでの鍵作成 ==== | ||
- | |||
- | **Step 3**: Create, on each machine running a Software Agent that will use SSH, a pair of keys (private and public). To do this, execute the following command **with the same user with which Pandora FMS Software Agent is executed**: | ||
- | |||
- | **ステップ 3**: SSH を使用する必要があるエージェントの各システムで、鍵のペア(秘密鍵と公開鍵)を作成します。 これを行うには、Pandora FMS エージェントの実行に使用されるユーザで次のコマンドを実行します。 | ||
- | |||
- | < | ||
- | ssh-keygen | ||
- | |||
- | </ | ||
- | |||
- | A series of questions will appear to which you will have to answer by simply pressing the Enter key. With this you have created a public key and a private key for that user in the machine. Now you should copy it to the destination machine, which is the Pandora FMS server where you want to send the monitoring data. | ||
- | |||
- | いくつかの質問が表示されます。Enter キーを押すだけで回答できます。 このユーザの公開/ | ||
- | |||
- | ==== 公開鍵のサーバへのコピー ==== | ||
- | |||
- | ステップ 4. 公開鍵を Pandora FMS サーバにコピーします。 作成された公開鍵をコピーするには、2つの方法があります。 | ||
- | |||
- | **手動で**、公開鍵ファイルのコンテンツを、エージェントが存在するシステムから、Pandora FMS サーバの / | ||
- | |||
- | エージェントがあるシステムで生成される公開鍵ファイルは、/ | ||
- | |||
- | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzqyZwhAge5LvRgC8uSm3tWaFV9O6fHQek7PjxmbBUxTWfvNbbswbFsF0esD3COavziQAUl3rP8DC28vtdWHFRHq+RS8fmJbU/ | ||
- | |||
- | **自動で行うには**次のコマンドを実行します。 | ||
- | |||
- | ssh-copy-id pandora@server_ip | ||
- | |||
- | " | ||
- | |||
- | < | ||
- | Now try logging into the machine, with "ssh ' | ||
- | .ssh/ | ||
- | to make sure we haven' | ||
- | </ | ||
- | |||
- | エージェントのマシンから root ユーザで、Pandora FMS サーバの " | ||
- | |||
- | この方法が、エージェントからデータを Pandora FMS サーバの / | ||
- | |||
- | / | ||
- | |||
- | 最後に、エージェント設定を変更して、コピー方法を tentacle ではなく ssh に設定します。 これは /// | ||
- | |||
- | ==== SSH サーバのセキュリティ強化 ==== | ||
- | Pandora FMS は、特に sftp/ | ||
- | Open SSH2 は **非常に** 安全ですが、コンピュータのセキュリティに関しては、絶対に安全なものはないため、" | ||
- | |||
- | FTP を介したアクセスに制限を設定するのと同じように、SSH を介した特定のユーザのアクセスを禁止することも可能です。 | ||
- | |||
- | それを行うするには、" | ||
- | |||
- | usermod -s / | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | Debian システムでは、シェルは / | ||
- | </ | ||
- | |||
- | ユーザ設定を変更すると、SSH でのログインができなくなります。 | ||
- | |||
- | ===== FTP にてサーバがデータを受け取る設定 ===== | ||
- | |||
- | FTP 経由でデータを送信するクライアント設定は、送信するユーザとパスワードの指定で可能です。tentacle の代わりに FTP を介してコピーを実装するのは非常に簡単です。 | ||
- | |||
- | FTP を使用してデータを送信するように Pandora FMS エージェントを設定するほか、Pandora FMS サーバに FTP サーバを設定し、ユーザ " | ||
- | |||
- | ニーズに合わせて FTP サーバを設定します。このガイドでは vsftpd を使用します。 | ||
- | |||
- | ==== Vsftpd でのセキュリティ強化 ==== | ||
- | Tentacle の代わりに FTP を使用することの短所は、FTP を介したデータ送信は安全ではないため、Pandora FMS サーバで FTP サーバを実行することが脆弱になります。 以下のセクションでは、サーバーの安全性を最小限にする方法について説明します。 | ||
- | |||
- | 安全上の理由で " | ||
- | |||
- | < | ||
- | auth required | ||
- | # Standard pam includes | ||
- | @include common-account | ||
- | @include common-session | ||
- | @include common-auth | ||
- | auth required | ||
- | auth required | ||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | Debian システムでは、シェルのパスは / | ||
- | </ | ||
- | |||
- | vsftpd の設定ファイル(/ | ||
- | |||
- | pam_service_name=ftp | ||
- | |||
- | この設定により、// | ||
- | |||
- | / | ||
- | |||
- | < | ||
- | chroot_local_user=YES | ||
- | chroot_list_enable=YES | ||
- | chroot_list_file=/ | ||
- | </ | ||
- | |||
- | 一部のユーザを除外し、Chroot に制限することを避ける必要がある場合は、vsftpd.nochroot_list ファイルにそのユーザを含めます(1行に1ユーザー)。 | ||
- | |||
- | セキュリティを強化するための他のオプションは次のとおりです。 | ||
- | |||
- | < | ||
- | dirlist_enable=NO | ||
- | download_enable=NO | ||
- | deny_file=authorized_keys | ||
- | deny_file=.ssh | ||
- | chroot_local_user=YES | ||
- | </ | ||
- | |||
- | |||
- | <WRAP center round tip 60%> | ||
- | 設定を変更した際は、それを反映するために vsftpd サービスを再起動する必要があります。 | ||
- | </ | ||
- | |||
- | これらの設定により、ユーザはそのルートディレクトリ («pandora» ユーザの場合は /// | ||
- | |||
- | FTP でユーザ «pandora» を使用してログインし、ディレクトリの移動とファイル一覧の取得を試してみてください。できない場合は、正しくセットアップができています。 | ||
- | |||
- | [[ja: |