如何在 Ubuntu 20.04 上安装 TeamPass 密码管理器
在此页
- 先决条件
- 安装 LAMP 服务器
- 创建 TeamPass 数据库
- 下载 TeamPass
- 配置 Apache Web 服务器
- 使用 Lets Encrypt SSL 保护 TeamPass
- 访问 TeamPass 网络用户界面
- 结论
TeamPass 是一个协作密码管理器,用于管理密码并在团队成员之间共享密码。它使用 MySQL/MariaDB 数据库来安全地存储密码。它提供了一个强大的工具来根据用户角色自定义密码访问。它是免费的开源软件,允许您根据为每个用户定义的访问权限以有组织的方式管理您的密码和相关数据。它具有丰富的功能集,包括数据加密、个人文件夹、树结构、用户权限、角色定义等等。
在本教程中,我们将向您展示如何使用 Lets Encrypt SSL 在 Ubuntu 20.04 上安装 TeamPass 密码管理器软件。
先决条件
- 一台运行 Ubuntu 20.04 的服务器。
- 使用您的服务器 IP 指向一个有效的域名。
- 在服务器上配置了根密码。
安装 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 shell:
mysql -u root
登录后,使用以下命令为 TeamPass 创建数据库和用户:
MariaDB [(none)]> create database teampass;
MariaDB [(none)]> grant all privileges on teampass.* to identified by "password";
接下来,使用以下命令刷新权限并退出 MariaDB:
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
创建数据库后,您可以继续下一步。
下载团队通行证
首先,您需要从 Git 存储库下载最新版本的 TeamPass。您可以使用以下命令将其下载到 Apache 网站根目录:
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
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 服务器后,您可以继续下一步。
使用 Lets Encrypt SSL 保护 TeamPass
.首先,您需要在服务器中安装 Certbot Lets Encrypt 客户端。它用于为您的域安装和管理 Lets Encrypt SSL 证书。运行以下命令安装 Certbot
apt-get install python3-certbot-apache -y
安装 Certbot 后,运行以下命令为您的网站下载并安装 Lets 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):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 键安装 Lets 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
此时,您的网站已使用 Lets Encrypt SSL 进行保护。您现在可以使用 HTTPS 协议安全地访问它。
访问 TeamPass 网络用户界面
现在,通过访问 URL https://teampass.linuxbuz.com 访问您的 TeamPass Web 界面。您应该会看到 TeamPass 欢迎屏幕:

单击“下一步”按钮。您应该看到服务器检查屏幕:

单击 LAUNCH 和 NEXT 按钮。您应该会看到数据库连接屏幕:

提供您的数据库详细信息,然后单击启动和下一步按钮。您应该看到准备屏幕:

单击 LAUNCH 和 NEXT 按钮。您应该看到表创建屏幕:

单击 LAUNCH 和 NEXT 按钮。您应该看到最终确定屏幕:

单击 LAUNCH 和 NEXT 按钮。安装成功完成后,您应该会看到以下屏幕:

现在,单击移至主页按钮。您将被重定向到 TeamPass 登录屏幕,如下所示:

提供您的用户名 admin 和您在安装过程中输入的密码,然后单击“登录”按钮。您应该在以下屏幕中看到 TeamPass 仪表板:

结论
在本指南中,您学习了如何在 Ubuntu 20.04 上安装 TeamPass 密码管理器并使用 Lets Encrypt SSL 保护它。您现在可以探索 TeamPass 并将其部署到生产环境中。有关详细信息,请访问 TeamPass 官方文档。