如何在 Ubuntu 20.04 LTS 上安装 Teampass 密码管理器

TeamPass 是一个开源密码管理器,可帮助您从中央位置存储和管理所有密码。它是一个协作密码管理器,允许您与团队成员共享所有存储的密码。TeamPass 使用 MySQL/MariaDB 来存储密码并提供一个强大的工具来自定义密码访问 Teampass 是高度可定制的,并提供了许多选项来根据您的需要对其进行自定义。它使用 Defuse PHP 加密库来保护您的数据和您的用户Teampass-Password-Manager-logo

在 Ubuntu 20.04 LTS Focal Fossa 上安装 Teampass 密码管理器

步骤 1. 首先,通过apt在终端中运行以下命令确保所有系统包都是最新的。

sudo apt update
sudo apt upgrade

步骤 2. 安装 LAMP 堆栈。

需要 Ubuntu 20.04 LAMP 服务器。如果您没有安装 LAMP,您可以在此处按照我们的指南进行操作。

步骤 3. 在 Ubuntu 20.04 上安装 Teampass 密码管理器。

现在我们运行以下命令从 Git 存储库下载最新版本的 Teampass:

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

步骤 4. 配置 MariaDB。

默认情况下,MariaDB 未加固。您可以使用mysql_secure_installation脚本保护 MariaDB 。您应该仔细阅读以下每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录以及删除测试数据库和访问安全 MariaDB 的权限:

mysql_secure_installation

像这样配置它:

- Set root password? [Y/n] y
- 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 控制台并为 Teampass 创建一个数据库。运行以下命令:

mysql -u root -p

这将提示您输入密码,因此请输入您的 MariaDB 根密码并按 Enter。登录到数据库服务器后,您需要为 Teampass 安装创建一个数据库:

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

步骤 5. 配置 Apache 虚拟主机。

现在我们创建一个 Apache 虚拟主机配置文件来托管 Teampass:

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

添加以下几行:

<VirtualHost *:80>
     ServerAdmin admin@your-domain.com
     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 服务以应用更改:

sudo a2ensite teampass
sudo a2enmod rewrite
sudo systemctl restart apache2

步骤 6. 使用 Let’s Encrypt 保护 TeamPass。

首先,您需要在您的服务器上安装 Certbot 客户端,以便为您的域下载并安装 Let’s Encrypt SSL:

sudo apt install python3-certbot-apache

然后,运行以下命令为您的网站下载并安装 Let’s Encrypt SSL:

certbot --apache -d teampass.your-domain.com

然后系统会提示您输入证书的电子邮件地址。输入后,您必须同意条款和条件并决定是否要与电子前沿基金会共享您的电子邮件地址。

输出:

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/teampass.your-domain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/teampass.your-domain.com/privkey.pem
   Your cert will expire on 2021-01-25. 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

接下来,我们设置一个 cron 作业来自动更新 SSL 证书:

certbot renew --dry-run

您可以通过编辑以下文件来设置一个 cron 作业,以在每天凌晨 12:00 自动更新 SSL 证书:

crontab -e

添加以下行:

00 12 * * *   root /usr/bin/certbot renew >/dev/null 2>&1

步骤 7. 访问 Teampass Web 界面。

成功安装后,打开 Web 浏览器并使用 URL 访问 Teampass Web 界面。您应该会看到以下页面:https://teampass.your-domain.com

Teampass-Web-Interface

感谢您使用本教程在 Ubuntu 20.04 LTS Focal Fossa 系统上安装 Teampass Password Manager。如需更多帮助或有用信息,我们建议您查看Teampass 官方网站

未经允许不得转载:统信UOS之家 » 如何在 Ubuntu 20.04 LTS 上安装 Teampass 密码管理器

相关文章