TeamPassは、パスワードを管理し、特定の役割を持つチームメンバー間でパスワードを共有するために使用される共同パスワードマネージャーです。 MySQL / MariaDBを使用してパスワードを保存し、パスワードアクセスをカスタマイズするための強力なツールを提供します。Teampassは高度にカスタマイズ可能であり、ニーズに合わせてカスタマイズするための多くのオプションを提供します。 DefusePHPEncryptionライブラリを使用してデータとユーザーを保護します。
このチュートリアルでは、Debian 10にTeamPassをインストールし、Let'sEncryptSSLで保護する方法を紹介します。
- Debian10を実行しているサーバー。
- サーバーIPで指定された有効なドメイン名。このチュートリアルでは、teampass.example.comドメインを使用します。
- ルートパスワードはサーバーで構成されています。
開始する前に、システムを最新バージョンに更新することをお勧めします。次のコマンドでシステムを更新できます:
apt-get update -y
apt-get upgrade -y
システムを更新した後、システムを再起動して変更を実装します。
LAMPサーバーをインストールする
まず、Apache Webサーバー、MariaDBデータベースサーバー、PHP、およびその他の必要なPHP拡張機能をシステムにインストールする必要があります。次のコマンドですべてをインストールできます:
apt-get install apache2 mariadb-server php php-cli libapache2-mod-php php-mysql php-curl php-mbstring php-bcmath php-common php-gd php-xml git wget -y
すべてのパッケージがインストールされたら、php.iniファイルを開き、いくつかの必要な設定を変更します。
nano /etc/php/7.3/apache2/php.ini
memory_limit = 256M upload_max_filesize = 100M max_execution_time = 360 date.timezone = Asia/Kolkata
終了したら、ファイルを保存して閉じます。
デフォルトでは、MariaDBルートパスワードはDebian 10で設定されていないため、セキュリティ上の理由から設定する必要があります。
まず、次のコマンドを使用してMariaDBシェルにログインします。
mysql
ログイン後、次のコマンドを使用してMariaDBrootユーザーのパスワードを設定します。
MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD("yournewpassword");
次に、次のコマンドを使用してTeamPassのデータベースとユーザーを作成します。
MariaDB [(none)]> create database teampassdb;
MariaDB [(none)]> grant all privileges on teampassdb.* to [email protected] identified by "password";
次に、特権をフラッシュし、次のコマンドでMariaDBシェルを終了します。
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
次に、Gitリポジトリから最新バージョンのTeamPassをダウンロードする必要があります。次のコマンドを使用して、ApacheWebルートディレクトリにダウンロードできます。
cd /var/www/html
git clone https://github.com/nilsteampassnet/TeamPass.git
次に、次のコマンドを使用してTeamPassに適切な権限を付与します。
chown -R www-data.www-data /var/www/html/TeamPass/
chmod -R 775 /var/www/html/TeamPass/
TeamPass用にApacheを構成する
次に、TeamPass用のApache仮想ホスト構成ファイルを作成する必要があります。次のコマンドで作成できます:
nano /etc/apache2/sites-available/teampass.conf
次の行を追加します:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/TeamPass ServerName teampass.example.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>
終了したら、ファイルを保存して閉じます。次に、TeamPass仮想ホストを有効にし、Apache Webサービスを再起動して、変更を適用します。
a2ensite teampass
systemctl restart apache2
Let'sEncryptを使用したSecureTeamPass
次に、Let's EncryptFreeSSLを使用してTeamPassを保護することをお勧めします。まず、サーバーにCertbotクライアントをインストールして、ドメインのLet'sEncryptSSLをダウンロードしてインストールする必要があります。
デフォルトでは、CertbotクライアントパッケージはDebian10デフォルトリポジトリでは利用できません。次のコマンドでリポジトリを追加できます:
echo "deb http://ftp.debian.org/debian buster-backports main" >> /etc/apt/sources.list
次に、リポジトリを更新し、次のコマンドを使用してCertbotクライアントをインストールします。
apt-get update -y
apt-get install python-certbot-apache -t buster-backports
インストールしたら、次のコマンドを実行して、ドメインのSSL証明書を取得してインストールします。
certbot --apache -d teampass.example.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.example.com 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 Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
次に、以下に示すように、HTTPトラフィックをHTTPSにリダイレクトするかどうかを選択する必要があります。
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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を押します 続ける。インストールが完了すると、次の出力が表示されます。
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.example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=teampass.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/teampass.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/teampass.example.com/privkey.pem Your cert will expire on 2020-04-30. 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
この時点で、ドメインはLet'sEncryptSSLで保護されています。
TeamPassWebインターフェイスにアクセス
Webブラウザーを開き、URLhttps://teampass.example.comを入力します。以下に示すように、TeamPassのウェルカムページにリダイレクトされます。
次へをクリックします ボタン。次のページが表示されます:
TeamPassのURLとパスを入力し、起動をクリックします ボタン。すべての要件が満たされると、次のページが表示されます。
次へをクリックします ボタン。次のページが表示されます:
データベースの詳細を入力し、起動をクリックします および次へ ボタン。次のページが表示されます:
管理者パスワードを入力し、起動をクリックします および次へ ボタン。次のページが表示されます:
起動をクリックします ボタンをクリックしてデータベースにデータを入力します。次のページが表示されます:
次へをクリックします ボタン。次のページが表示されます:
起動をクリックします ボタンをクリックしてインストールを完了します。次のページが表示されます:
次へをクリックします ボタン。インストールが完了したら。次のページが表示されます:
ホームページに移動をクリックします 。 TeamPassログインページにリダイレクトされます:
管理者のユーザー名とパスワードを入力し、ログをクリックします で ボタン。次のページにTeamPassダッシュボードが表示されます。
おめでとう!これで、Debian10にTeamPassパスワードマネージャーが正常にインストールおよび構成されました。