웹사이트 검색

Debian 11에서 Teampass Password Manager를 설정하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • 데비안 11(불스아이)
  • 데비안 10(버스터)

이 페이지에서

  1. 전제 조건
  2. Apache, MariaDB 및 PHP 설치
  3. Teampass용 데이터베이스 만들기
  4. Teampass 설치
  5. Teampass용 Apache 가상 호스트 만들기\n
  6. Teampass 웹 인터페이스 액세스
  7. Lets Encrypt SSL로 Teampass 보안 유지
  8. 결론

대부분의 사용자는 인터넷에 많은 소셜 미디어, 이메일 및 기타 계정을 가지고 있습니다. 누구나 자신의 모든 계정과 비밀번호를 관리하는 것은 매우 어렵습니다. 여기에서 암호 관리자가 등장합니다. Team Pass는 중앙 위치에서 모든 비밀번호를 저장하고 관리하는 데 도움이 되는 오픈 소스 비밀번호 관리자입니다. 저장된 모든 비밀번호를 팀원들과 공유할 수 있는 협업 비밀번호 관리자입니다. 또한 각 사용자에 대한 액세스 권한을 설정하여 주어진 데이터 집합에만 액세스하도록 제어할 수 있습니다.

이 튜토리얼에서는 Apache와 함께 Teampass 암호 관리자를 설치하는 방법과 Debian 11에서 Lets Encrypt SSL을 보여줍니다.

전제 조건

  • Debian 11을 실행하는 서버.\n
  • 서버 IP를 가리키는 유효한 도메인 이름입니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

Apache, MariaDB 및 PHP 설치

먼저 Apache 웹 서버, 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용 데이터베이스 생성

Teampass는 MariaDB를 데이터베이스 백엔드로 사용하므로 Teampass용 데이터베이스와 사용자를 생성해야 합니다.

먼저 MariaDB 설치를 보호하고 다음 명령을 사용하여 MariaDB 루트 암호를 설정합니다.

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 identified by "password";

다음으로 다음 명령을 사용하여 권한을 플러시하고 MariaDB를 종료합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

Teampass 설치

다음으로 Git 저장소에서 최신 버전의 Teampass를 다운로드해야 합니다.

먼저 다음 명령을 사용하여 git 패키지를 설치합니다.

apt-get install git -y

다음으로 최신 버전의 Teampass를 Apache 웹 루트 디렉터리에 다운로드합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

Teampass용 Apache 가상 호스트 만들기

다음으로 인터넷에서 Teampass를 호스팅하기 위해 Apache 가상 호스트 구성 파일을 생성해야 합니다.

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

다음 줄을 추가합니다.

<VirtualHost *:80>
     ServerAdmin 
     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..

Teampass 웹 인터페이스에 액세스

이제 웹 브라우저를 열고 URL http://teampass.example.com을 사용하여 Teampass 웹 인터페이스에 액세스하십시오. 다음 페이지가 표시됩니다.

LAUNCH 및 NEXT 버튼을 클릭합니다. 서버 확인 화면이 표시되어야 합니다.

Teampass 경로, 웹사이트 URL을 제공하고 LAUNCH 및 NEXT 버튼을 클릭합니다. 데이터베이스 연결 화면이 표시되어야 합니다.

데이터베이스 세부 정보를 제공하고 LAUNCH 및 NEXT 버튼을 클릭합니다. 준비 화면이 표시되어야 합니다.

관리자 비밀번호를 입력하고 LAUNCH 및 NEXT 버튼을 클릭합니다. 테이블 생성 화면이 표시되어야 합니다.

LAUNCH 및 NEXT 버튼을 클릭합니다. 완료 화면이 표시되어야 합니다.

LAUNCH 및 NEXT 버튼을 클릭합니다. 설치가 성공적으로 완료되면 다음 화면이 표시됩니다.

이제 홈 페이지로 이동 버튼을 클릭하십시오. 아래와 같이 TeamPass 로그인 화면으로 리디렉션됩니다.

사용자 이름을 admin으로 입력하고 설치 과정에서 작성한 비밀번호를 입력하고 로그인 버튼을 클릭합니다. 다음 화면에 TeamPass 대시보드가 표시되어야 합니다.

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.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): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 키를 눌러 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.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

이 시점에서 귀하의 웹사이트는 Lets Encrypt SSL로 보호됩니다. 이제 HTTPS 프로토콜로 안전하게 액세스할 수 있습니다.

결론

축하합니다! Apache 및 Lets Encrypt SSL on Debian 11과 함께 Teampass 암호 관리자를 성공적으로 설치했습니다. 이제 웹 기반 인터페이스에서 모든 자격 증명을 관리하고 팀과 공유할 수 있습니다.