TeamPass Password ManagerをUbuntu 20.04にインストールする方法

Ubuntu/Debian

目次

TeamPassは、パスワードを管理し、チームメンバー間でパスワードを共有するために使用される共同パスワードマネージャーです。 MySQL / MariaDBデータベースを使用して、パスワードを安全に保存します。ユーザーの役割に応じてパスワードアクセスをカスタマイズする強力なツールを提供します。これは無料のオープンソースソフトウェアであり、ユーザーごとに定義されたアクセス権に関して、整理された方法でパスワードと関連データを管理できます。データの暗号化、個人用フォルダ、ツリー構造、ユーザー権限、ロール定義など、豊富な機能が備わっています。

このチュートリアルでは、Let’s Encrypt SSLを使用してUbuntu 20.04にTeamPass Password Managerソフトウェアをインストールする方法を示します。

前提条件

  • Ubuntu 20.04を実行しているサーバー。
  • 有効なドメイン名がサーバーIPで指定されています。
  • rootパスワードがサーバーで構成されています。

LAMPサーバーをインストールする

開始する前に、LAMPサーバーがサーバーにインストールされていることを確認してください。インストールされていない場合は、次のコマンドを実行して他のパッケージと一緒にインストールできます。

apt-get install apache2 mariadb-server php7.4 php7.4-cli libapache2-mod-php7.4 php7.4-mysql php7.4-curl php7.4-mbstring php7.4-bcmath php7.4-common php7.4-gd php7.4-xml git wget -y

LAMPサーバーがインストールされたら、php.iniファイルを編集して、いくつかの設定を変更します。

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

次の行を変更します。

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = Asia/Kolkata

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

TeamPassデータベースを作成する

次に、TeamPassのデータベースとユーザーを作成する必要があります。最初に、次のコマンドでMariaDBシェルにログインします。

mysql -u root

ログインしたら、次のコマンドでTeamPassのデータベースとユーザーを作成します。

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

次に、特権をフラッシュし、次のコマンドでMariaDBを終了します。

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

データベースが作成されたら、次のステップに進むことができます。

TeamPassをダウンロード

まず、GitリポジトリからTeamPassの最新バージョンをダウンロードする必要があります。次のコマンドを使用して、Apache Webルートディレクトリにダウンロードできます。

cd /var/www/html
git clone https://github.com/nilsteampassnet/TeamPass.git

ダウンロードが完了したら、所有権をwww-dataユーザーに変更し、次のコマンドを使用して適切な権限を設定します。

chown -R www-data.www-data /var/www/html/TeamPass/
chmod -R 775 /var/www/html/TeamPass/

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

Apache Webサーバーの構成

最初に、次のコマンドでTeamPassのApache仮想ホスト構成ファイルを作成します。

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

次の行を追加します。

<VirtualHost *:80>   
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/TeamPass   
     ServerName teampass.linuxbuz.com

     <Directory /var/www/html/TeamPass>      
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>   

     ErrorLog ${APACHE_LOG_DIR}/teampass_error.log
     CustomLog ${APACHE_LOG_DIR}/teampass_access.log combined

</VirtualHost>

終了したらファイルを保存します。次に、Apache仮想ホストファイルを有効にし、Apacheサービスを再起動して変更を適用します。

a2ensite teampass
systemctl restart apache2

Apache Webサーバーが構成されたら、次のステップに進むことができます。

Let’s Encrypt SSLを使用したTeamPassの保護

まず、サーバーにCertbot Let’s Encryptクライアントをインストールする必要があります。ドメインのLet’s Encrypt SSL証明書をインストールおよび管理するために使用されます。 Certbotをインストールするには、次のコマンドを実行します

apt-get install python3-certbot-apache -y

Certbotをインストールしたら、次のコマンドを実行して、ウェブサイト用のLet’s Encrypt SSLをダウンロードしてインストールします。

certbot --apache -d teampass.linuxbuz.com

以下に示すように、有効なメールアドレスを入力し、利用規約に同意する必要があります。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for teampass.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/teampass-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/teampass-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/teampass-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と入力してすべてのリクエストを安全なHTTPSアクセスにリダイレクトし、 Enterキーを押してLet’s Encrypt SSLをインストールします。インストールが正常に完了すると、次の出力が表示されます。

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://teampass.linuxbuz.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/teampass.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/teampass.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-10-17. 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"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

この時点で、WebサイトはLet’s Encrypt SSLで保護されています。 HTTPSプロトコルで安全にアクセスできるようになりました。

TeamPass Web UIにアクセスする

次に、URL https://teampass.linuxbuz.comにアクセスして、TeamPass Webインターフェイスにアクセスします。 TeamPassのウェルカム画面が表示されます。

[ 次へ ]ボタンをクリックします。サーバーチェック画面が表示されます。

LAUNCH and NEXTボタンをクリックします。データベース接続画面が表示されます。

お使いのデータベースの詳細を提供し、LAUNCHNEXTボタンをクリックしてください。準備画面が表示されます。

LAUNCH and NEXTボタンをクリックします。テーブル作成画面が表示されます。

LAUNCH and NEXTボタンをクリックします。ファイナライズ画面が表示されます。

LAUNCH and NEXTボタンをクリックします。インストールが正常に完了すると、次の画面が表示されます。

次に、[ ホームページに移動 ]ボタンをクリックします。以下に示すように、TeamPassログイン画面にリダイレクトされます。

adminと、インストールプロセス中に書かれているパスワードとユーザー名を提供し、 ログインボタンをクリックします。次の画面にTeamPassダッシュボードが表示されます。

結論

このガイドでは、TeamPassパスワードマネージャーをUbuntu 20.04にインストールし、Let’s Encrypt SSLで保護する方法を学びました。これで、TeamPassを探索して、実稼働環境に展開できます。詳細については、TeamPassの公式ドキュメントにアクセスしてください。

Source

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です