GNU/Linux >> Linux の 問題 >  >> Debian

Debian11でTeampassPasswordManagerをセットアップする方法

ほとんどのユーザーは、インターネット上に多くのソーシャルメディア、電子メール、およびその他のアカウントを持っています。すべてのアカウントとパスワードを管理することは誰にとっても非常に困難です。ここで、パスワードマネージャーが登場します。チームパスは、中央の場所からすべてのパスワードを保存および管理するのに役立つオープンソースのパスワードマネージャーです。これは、保存されているすべてのパスワードをチームメンバーと共有できるようにする共同パスワードマネージャーです。各ユーザーにアクセス権を設定して、特定のデータセットのみにアクセスするようにユーザーを制御することもできます。

このチュートリアルでは、Apacheを使用してTeampassパスワードマネージャーをインストールし、Debian11にSSLを暗号化する方法を紹介します。

前提条件
  • Debian11を実行しているサーバー。
  • サーバーIPで指定された有効なドメイン名。
  • ルートパスワードはサーバーで構成されています。

Apache、MariaDB、PHPをインストール

まず、Apache Webサーバー、MariaDBデータベースサーバー、PHP、およびその他の必要な拡張機能をサーバーにインストールする必要があります。次のコマンドを実行して、それらすべてをインストールできます。

apt-get install apache2 apache2-utils mariadb-server mariadb-client php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline php7.4-bcmath php7.4-curl php7.4-fpm php7.4-gd php7.4-xml php7.4-mbstring -y

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

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

次の設定を変更します:

max_execution_time = 60
date.timezone = Asia/Kolkata

ファイルを保存して閉じてから、Apacheサービスを再起動して変更を適用します。

systemctl restart apache2

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

チームパス用のデータベースを作成する

TeampassはMariaDBをデータベースバックエンドとして使用するため、Teampassのデータベースとユーザーを作成する必要があります。

まず、MariaDBのインストールを保護し、次のコマンドを使用してMariaDBのrootパスワードを設定します。

mysql_secure_installation

以下に示すように、すべての質問に答えてください。

Enter current password for root (enter for none): 
Switch to unix_socket authentication [Y/n] n
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 [(none)]> create database teampass;
MariaDB [(none)]> grant all privileges on teampass.* to [email protected] identified by "password";

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

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

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

チームパスをインストール

次に、Gitリポジトリから最新バージョンのTeampassをダウンロードする必要があります。

まず、次のコマンドを使用してgitパッケージをインストールします。

apt-get install git -y

次に、最新バージョンのTeampassをApacheWebルートディレクトリにダウンロードします。

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

次に、次のコマンドを使用して所有権と権限を変更します。

chown -R www-data:www-data TeamPass
chmod -R 775 /var/www/html/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>

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

a2ensite teampass
systemctl restart apache2

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

systemctl status apache2

次の出力が得られます:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-11-01 03:39:47 UTC; 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 20013 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 20017 (apache2)
      Tasks: 6 (limit: 2341)
     Memory: 14.1M
        CPU: 95ms
     CGroup: /system.slice/apache2.service
             ??20017 /usr/sbin/apache2 -k start
             ??20018 /usr/sbin/apache2 -k start
             ??20019 /usr/sbin/apache2 -k start
             ??20020 /usr/sbin/apache2 -k start
             ??20021 /usr/sbin/apache2 -k start
             ??20022 /usr/sbin/apache2 -k start

Nov 01 03:39:47 debian11 systemd[1]: Starting The Apache HTTP Server..
アクセスTeampassWebインターフェース

次に、Webブラウザーを開き、URL http://teampass.example.comを使用してTeampassWebインターフェースにアクセスします。 。次のページが表示されます:

起動をクリックします および次へ ボタン。サーバーチェック画面が表示されます:

チームパスパスとウェブサイトのURLを入力し、起動をクリックします および次へ ボタン。データベース接続画面が表示されます:

データベースの詳細を入力し、起動をクリックします および次へ ボタン。準備画面が表示されます:

管理者パスワードを入力し、起動をクリックします および次へ ボタン。テーブル作成画面が表示されます:

起動をクリックします および次へ ボタン。ファイナライズ画面が表示されます:

起動をクリックします および次へ ボタン。インストールが正常に完了すると、次の画面が表示されます。

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

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

SSLを暗号化して安全なチームパス

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

apt-get install python3-certbot-apache -y

Certbotがインストールされたら、次のコマンドを実行して、Webサイト用のLet'sEncryptSSLをダウンロードしてインストールします。

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
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'sEncryptSSLをインストールします。インストールが正常に完了すると、次の出力が表示されます。

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.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 2022-01-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

この時点で、WebサイトはLet'sEncryptSSLで保護されています。これで、HTTPSプロトコルを使用して安全にアクセスできます。

結論

おめでとう!これで、Apacheを使用したTeampassパスワードマネージャーが正常にインストールされ、Debian 11にSSLを暗号化しましょう。これで、すべての資格情報を管理し、Webベースのインターフェイスからチームと共有できます。


Debian
  1. Debian11でRsyslogサーバーをセットアップする方法

  2. PHP 7.4 / 7.3 / 7.2/7.1をDebian10/Debian9にインストールする方法

  3. Debian11にMariaDB10.xをインストールする方法

  1. Debianでvsftpdをセットアップする方法

  2. MySQLをDebian9にインストールする方法

  3. Ubuntu20.04でTeampassPasswordsManagerをセットアップします-今すぐ実行しますか?

  1. Debian9にPydioWebファイルマネージャーをインストールする方法

  2. Debian10にTeamPassPasswordManagerをインストールする方法

  3. Ubuntu20.04にTeamPassPasswordManagerをインストールする方法