Cockpit
Cockpit は Red Hat が支援しているブラウザベースの Linux 用管理ツールです。
目次
インストール
cockpit パッケージをインストールします。オプションの依存関係をチェックして、ネットワーク接続、パッケージおよびハードディスクを管理するために必要なパッケージを確認してください。
追加機能については、以下のいずれかのパッケージをインストールしてください。
- cockpit-machines libvirt を使用して仮想マシンを管理する
- cockpit-pcp PCP メトリクスの読み込みと PCP アーカイブのロード用
- cockpit-podman Podman コンテナの管理 (cockpit-docker の代替品)
- cockpit-storaged for configuring and monitoring storage, disks and mounts on the system.
- cockpit-packagekit for managing system packages.
- networkmanager for managing Networking.
- firewalld for managing the Firewall using the Cockpit in Networking.
- udisks2 for managing Storage.
使用方法
cockpit.socket ユニットを起動・有効化して、Cockpit を起動します[1]。
ウェブブラウザで、https://localhost:9090/ にアクセスして、Cockpit を使用します。Linux のアカウントとパスワードでログインします。(ログインできない場合、再起動するとログインできるかもしれません)
設定
TLS 証明書
デフォルトでは、Cockpit は自己署名の TLS 証明書を使用します。適切な証明書を使用するには、サフィックス .cert の証明書と サフィックス .key の対応する鍵を、/etc/cockpit/ws-certs.d/ ディレクトリに置いてください。 Cockpit はそのフォルダ内のアルファベット順の最後の *.cert ファイル を使用し、0-self-signed.cert にフォールバックします。cert と key は cockpit-ws ユーザーが読めるものでなければなりません。適用するには、 cockpit.service を再起動します。詳細は 公式ドキュメントのページ を参照してください。
Limit network access to the interface to local address only
By default, Cockpit listen on all network interfaces (0.0.0.0) on port 9090, for security reasons, one may want to limit the exposition of the interface to a specific one only or change the default port.
For example, for the interface to listen only on the local address, create the following file:
/etc/systemd/system/cockpit.socket.d/listen.conf
[Socket] ListenStream= ListenStream=127.0.0.1:9090 FreeBind=yes
See the page in the official docs for more information.
Hide login MOTD
By default, Cockpit shows a MOTD on either TTY login or SSH. pam_motd(8) recommends creating a symbolic link to hide these messages, so future Cockpit updates do not override this.
This can be done via:
# ln -sfn /dev/null /etc/motd.d/cockpit
# ln -sfn /dev/null /etc/issue.d/cockpit.issue