パスワード管理 · 5 min read · Jan 08, 2026

Ubuntu 22.04に無料のLet's Encrypt SSLを使用してsysPassパスワードマネージャーをインストールする

sysPassは、パスワードを安全な場所に保存するために使用される無料のオープンソースのPHPベースのパスワード管理ツールです。これはウェブベースで、安全で信頼性が高く、マルチユーザー環境向けに設計されています。LDAP認証、メール、監査、バックアップ、インポート/エクスポートなどのさまざまなオプションを構成するのに役立つユーザーフレンドリーなウェブインターフェースが付属しています。sysPassは、ウェブアプリ、モバイルアプリ、ブラウザ拡張機能を介してインストールできます。

この記事では、Ubuntu 22.04にsysPassパスワードマネージャーをインストールする方法を示します。

前提条件

  • Ubuntu 22.04を実行しているサーバー。
  • サーバーIPにポイントされた有効なドメイン名。
  • サーバーに設定されたルートパスワード。

Apache、MariaDB、およびPHPのインストール

始める前に、Apacheウェブサーバー、MariaDBデータベースサーバー、PHP、およびその他のPHP拡張機能をサーバーにインストールする必要があります。まず、次のコマンドを使用してApacheとMariaDBサーバーをインストールします:

apt-get install apache2 mariadb-server -y

デフォルトでは、Ubuntu 22.04にはPHP 8.1バージョンが付属していますが、sysPassはPHP 8.1バージョンをサポートしていません。したがって、サーバーにPHP 7.4バージョンと他の拡張機能をインストールする必要があります。

まず、次のコマンドを使用して必要な依存関係をすべてインストールします:

apt install software-properties-common ca-certificates lsb-release apt-transport-https

次に、次のコマンドを使用してPHPリポジトリを追加します:

add-apt-repository ppa:ondrej/php

PHPリポジトリが追加されたら、次のコマンドを実行してPHP 7.4とすべての必要な拡張機能をインストールします:

apt install libapache2-mod-php7.4 php7.4 php7.4-mysqli php7.4-pdo php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-gd php7.4-json php7.4-readline php7.4-curl php7.4-intl php7.4-ldap php7.4-xml php7.4-mbstring git -y

すべてのパッケージがインストールされたら、php.iniファイルを編集していくつかの変更を加えます:

nano /etc/php/7.4/apache2/php.ini

次の設定を変更します:

post_max_size = 100M
upload_max_filesize = 100M
max_execution_time = 7200
memory_limit = 512M
date.timezone = UTC

完了したら、ファイルを保存して閉じます。次に、Apacheサービスを再起動して構成変更を適用します:

systemctl restart apache2

sysPass用のMariaDBの構成

デフォルトでは、MariaDBのインストールはセキュリティが確保されていません。したがって、最初にそれをセキュリティで保護する必要があります。次のコマンドを使用してセキュリティを確保できます:

mysql_secure_installation

MariaDBのルートパスワードを設定し、インストールを保護するために、以下のようにすべての質問に答えます:

Enter current password for root (enter for none): 
Switch to unix_socket authentication [Y/n] Y
Change the root password? [Y/n] Y
New password: 
Re-enter new password: 
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

完了したら、次のコマンドを使用してMariaDBインターフェースにログインします:

mysql -u root -p

MariaDBのルートパスワードを提供するように求められます。ログインしたら、次のコマンドを使用してデータベースとユーザーを作成します:

MariaDB [(none)]> create database syspassdb;  
MariaDB [(none)]> grant all privileges on syspassdb.* to syspassuser@localhost identified by "password";

次に、特権をフラッシュし、次のコマンドを使用してMariaDBシェルから退出します:

MariaDB [(none)]> flush privileges;  
MariaDB [(none)]> exit;

この時点で、MariaDBデータベースとユーザーはsysPass用に準備が整いました。次のステップに進むことができます。

sysPassのインストール

まず、次のコマンドを使用してGitリポジトリからsysPassの最新バージョンをダウンロードします:

git clone https://github.com/nuxsmin/sysPass.git

sysPassをダウンロードしたら、ダウンロードしたディレクトリをApacheのウェブルートディレクトリに移動します:

mv sysPass /var/www/html/syspass

次に、次のコマンドを使用してsyspassディレクトリに適切な所有権を設定します:

chown -R www-data:www-data /var/www/html/syspass

次に、他のディレクトリに適切な権限を設定します:

chmod 750 /var/www/html/syspass/app/{config,backup}

次に、システムにComposerをインストールする必要があります。

まず、次のコマンドを使用してComposerインストールスクリプトを作成します:

nano /var/www/html/syspass/install-composer.sh

次の行を追加します:

#!/bin/sh
 EXPECTED_SIGNATURE="
$(wget -q -O - https://composer.github.io/installer.sig)"
 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
 if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
 then
     >&2 echo 'ERROR: Invalid installer signature'
     rm composer-setup.php
     exit 1
 fi
 php composer-setup.php --quiet
 RESULT=$?
 rm composer-setup.php
 exit $RESULT

ファイルを保存して閉じたら、次のコマンドを使用してComposerインストールスクリプトを実行します:

cd /var/www/html/syspass/  
sh install-composer.sh

Composerがインストールされたら、次のコマンドを実行してすべての必要なPHP依存関係をインストールします:

php composer.phar install --no-dev

すべての依存関係がインストールされたら、次のステップに進むことができます。

sysPass用のApacheの構成

次に、sysPassをウェブ上でホストするためのApache仮想ホスト構成ファイルを作成する必要があります。次のコマンドを使用して作成できます:

nano /etc/apache2/sites-available/syspass.conf

次の行を追加します:


ServerAdmin [email protected]
DocumentRoot "/var/www/html/syspass"
ServerName syspass.example.com

Options MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all

TransferLog /var/log/apache2/syspass_access.log
ErrorLog /var/log/apache2/syspass_error.log

完了したら、ファイルを保存して閉じ、次のコマンドを使用してApache仮想ホストを有効にします:

a2ensite syspass

次に、次のコマンドを使用してApacheサービスを再起動して変更を適用します:

systemctl restart apache2

次のコマンドを使用してApacheサービスのステータスを確認することもできます:

systemctl status apache2

次の出力が得られるはずです:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese>
     Active: active (running) since Sun 2022-07-24 04:27:17 UTC; 6s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 62773 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/S>
   Main PID: 62777 (apache2)
      Tasks: 6 (limit: 2242)
     Memory: 14.3M
        CPU: 109ms
     CGroup: /system.slice/apache2.service
             ??62777 /usr/sbin/apache2 -k start
             ??62778 /usr/sbin/apache2 -k start
             ??62779 /usr/sbin/apache2 -k start
             ??62780 /usr/sbin/apache2 -k start
             ??62781 /usr/sbin/apache2 -k start
             ??62782 /usr/sbin/apache2 -k start

Jul 24 04:27:17 ubuntu systemd[1]: Starting The Apache HTTP Server...

完了したら、次のステップに進むことができます。

sysPass管理インターフェースにアクセス

今、ウェブブラウザを開き、URL http://syspass.example.comを使用してsysPass管理インターフェースにアクセスします。次のページにリダイレクトされます:

sysPassマスターパスワード

sysPassにログイン

管理者ユーザー名、パスワード、マスターパスワード、データベースの資格情報を提供し、言語、ホスティングモードを選択し、INSTALLボタンをクリックします。インストールが完了すると、sysPassログインページにリダイレクトされます。

システムパスワードマネージャー

管理者ユーザー名、パスワードを提供し、>ボタンをクリックします。次のページにsysPassダッシュボードが表示されるはずです:

sysPassダッシュボード

sysPassにLet’s Encrypt SSLをインストール

ウェブサイトをLet’s Encrypt SSLで保護することは常に良いアイデアです。まず、SSLをインストールおよび管理するためにCertbotクライアントをインストールする必要があります。デフォルトでは、CertbotパッケージはUbuntu 22.04のデフォルトリポジトリに含まれているため、次のコマンドを使用してインストールできます:

apt-get install python3-certbot-apache -y

Certbotがインストールされたら、次のコマンドを実行してウェブサイトをLet’s Encrypt SSLで保護します:

certbot --apache -d syspass.example.com

次のように、メールアドレスを提供し、サービス利用規約に同意するように求められます:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for syspass.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/syspass-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/syspass-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/syspass-le-ssl.conf

次に、次のようにHTTPトラフィックをHTTPSにリダイレクトするかどうかを選択します:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

2を入力してEnterを押して、ウェブサイトのLet’s Encrypt SSLをインストールします:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/syspass.conf to ssl vhost in /etc/apache2/sites-available/syspass-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://syspass.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=syspass.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/syspass.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/syspass.example.com/privkey.pem
   Your cert will expire on 2022-10-20. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all*
   of your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

結論

おめでとうございます!Ubuntu 22.04にApacheとLet’s Encrypt SSLを使用してsysPassパスワードマネージャーを正常にインストールしました。これで、sysPassパスワードマネージャーを探索し、プロダクション環境に展開を開始できます。

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。