웹사이트 검색

Ubuntu 20.04에서 Passbolt Team Password Manager 설치 및 구성


이 페이지에서

  1. 전제 조건
  2. LAMP 서버 설치
  3. MariaDB 데이터베이스 구성
  4. Passbolt 다운로드 및 구성
    1. 패스볼트 다운로드
    2. OpenPGP 키 생성
    3. Passbolt 구성

    Passbolt는 라우터, 웹사이트, Wi-Fi 등의 비밀번호와 같은 로그인 자격 증명을 안전하게 공유하고 저장하는 데 도움이 되는 확장 가능한 무료 오픈 소스 자체 호스팅 비밀번호 관리자입니다. 다른 비밀번호 관리자와 다릅니다. 개인보다는 팀 사용에 중점을 둡니다. 커뮤니티 및 유료 버전 모두에서 사용할 수 있습니다. 많은 기능을 제공하며 그 중 일부는 다음과 같습니다.

    • Firefox 및 Google 크롬 확장 프로그램을 제공합니다.\n
    • OpenPGP를 사용하여 비밀번호를 암호화합니다.\n
    • 간단하고 사용자 친화적인 웹 인터페이스.\n
    • 암호를 가져오고 내보낼 수 있습니다.\n
    • 로그인 자격 증명을 수동으로 추가할 수 있습니다.\n

    이 튜토리얼에서는 Ubuntu 20.04에서 Apache 및 Lets Encrypt와 함께 Passbolt Password Manager를 설치하는 방법을 설명합니다.

    전제 조건

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

    램프 서버 설치

    먼저 시스템에 Apache 및 MariaDB 서버를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

    apt-get install apache2 mariadb-server -y

    위의 패키지를 설치한 후 시스템에 PHP 및 기타 필수 패키지도 설치해야 합니다.

    기본적으로 Ubuntu 20.04는 기본 리포지토리에 PHP7.4와 함께 제공됩니다. 그러나 Passbolt는 PHP7.4를 지원하지 않습니다. 따라서 시스템에 PHP 저장소를 추가해야 합니다.

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

    apt-get install software-properties-common gnupg -y

    다음으로 다음 명령을 사용하여 PHP 리포지토리를 추가합니다.

    add-apt-repository ppa:ondrej/php --yes

    다음으로 다음 명령을 사용하여 Composer 및 기타 필수 확장이 포함된 PHP 버전 7.3을 설치합니다.

    apt-get install php7.3 php7.3-mysql libapache2-mod-php7.3 php7.3-intl php7.3-mbstring php7.3-gd php7.3-imagick php7.3-xml php7.3-common php7.3-curl php7.3-json php7.3-ldap php7.3-gnupg zlib1g unzip git composer curl -y

    모든 패키지가 설치되면 다음 단계로 진행할 수 있습니다.

    MariaDB 데이터베이스 구성

    먼저 MariaDB 설치를 보호하고 MariaDB 루트 암호를 설정해야 합니다. 다음 명령으로 수행할 수 있습니다.

    mysql_secure_installation

    이 스크립트는 아래와 같이 MariaDB 루트 암호를 설정하고, 익명 사용자를 제거하고, 원격으로 루트 로그인을 허용하지 않고, 테스트 데이터베이스 및 액세스를 제거합니다.

    Enter current password for root (enter for none): 
    OK, successfully used password, moving on...
    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가 보호되면 다음 명령을 사용하여 MariaDB 셸에 로그인합니다.

    mysql -u root -p

    프롬프트가 표시되면 루트 암호를 제공하고 다음 명령을 사용하여 Passbolt용 데이터베이스와 사용자를 생성합니다.

    MariaDB [(none)]> CREATE DATABASE passboltdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    MariaDB [(none)]> GRANT ALL on passboltdb.* to identified by 'password';

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

    MariaDB [(none)]> FLUSH PRIVILEGES;
    MariaDB [(none)]> EXIT;

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

    Passbolt 다운로드 및 구성

    이 섹션에서는 passbolt를 다운로드하고 구성하는 방법을 배웁니다.

    패스볼트 다운로드

    먼저 다음 명령을 사용하여 최신 버전의 Passbolt를 Apache 웹 루트 디렉터리에 다운로드합니다.

    mkdir /var/www/passbolt
    git clone https://github.com/passbolt/passbolt_api.git /var/www/passbolt

    다운로드가 완료되면 다음 명령을 사용하여 패스볼트의 소유권을 www-data로 변경합니다.

    chown -R www-data:www-data /var/www/

    다음으로 디렉터리를 passbolt로 변경하고 다음 명령을 사용하여 필요한 종속성을 설치합니다.

    cd /var/www/passbolt
    sudo -u www-data composer install --no-dev

    다음 출력이 표시되어야 합니다.

    > Cake\Composer\Installer\PluginInstaller::postAutoloadDump
    9 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    thadafinser/package-info:  Generating class...
    thadafinser/package-info: ...generating class
    > App\Console\Installer::postInstall
    Created `config/app.php` file
    Created `/var/www/passbolt/logs` directory
    Created `/var/www/passbolt/tmp/cache/models` directory
    Created `/var/www/passbolt/tmp/cache/persistent` directory
    Created `/var/www/passbolt/tmp/cache/views` directory
    Created `/var/www/passbolt/tmp/sessions` directory
    Created `/var/www/passbolt/tmp/tests` directory
    Set Folder Permissions ? (Default to Y) [Y,n]? Y
    

    Y를 입력하고 Enter 키를 눌러 폴더 권한을 설정합니다.

    OpenPGP 키 생성

    다음으로 나가는 JSON 요청을 인증하고 서명하기 위해 OpenPGP 키를 생성해야 합니다. 다음 명령으로 생성할 수 있습니다.

    cd /var/www/passbolt
    gpg --full-generate-key

    이 과정에서 암호를 묻는 메시지가 표시됩니다. 탭 키를 누르고 확인을 선택한 다음 설정하지 않겠다고 확인하십시오. php-gnupg 모듈은 현재 암호 사용을 지원하지 않기 때문입니다.

    gpg (GnuPG) 2.2.19; Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    gpg: directory '/root/.gnupg' created
    gpg: keybox '/root/.gnupg/pubring.kbx' created
    Please select what kind of key you want:
       (1) RSA and RSA (default)
       (2) DSA and Elgamal
       (3) DSA (sign only)
       (4) RSA (sign only)
      (14) Existing key from card
    Your selection? 1
    RSA keys may be between 1024 and 4096 bits long.
    What keysize do you want? (3072) 4096
    Requested keysize is 4096 bits
    Please specify how long the key should be valid.
             0 = key does not expire
            = key expires in n days
          w = key expires in n weeks
          m = key expires in n months
          y = key expires in n years
    Key is valid for? (0) 0
    Key does not expire at all
    Is this correct? (y/N) y
    
    GnuPG needs to construct a user ID to identify your key.
    
    Real name: Hitesh
    Email address: 
    Comment: Hi
    You selected this USER-ID:
        "Hitesh (Hi) <>"
    
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
    We need to generate a lot of random bytes. It is a good idea to perform
    some other action (type on the keyboard, move the mouse, utilize the
    disks) during the prime generation; this gives the random number
    generator a better chance to gain enough entropy.
    We need to generate a lot of random bytes. It is a good idea to perform
    some other action (type on the keyboard, move the mouse, utilize the
    disks) during the prime generation; this gives the random number
    generator a better chance to gain enough entropy.
    gpg: /root/.gnupg/trustdb.gpg: trustdb created
    gpg: key 2DA8E7FB8E23B2FD marked as ultimately trusted
    gpg: directory '/root/.gnupg/openpgp-revocs.d' created
    gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/9622291A72D99A4EC78ABCB92DA8E7FB8E23B2FD.rev'
    public and secret key created and signed.
    
    pub   rsa4096 2020-07-25 [SC]
          D2394A45B7CBBAB7F00CC79B23D4750486780854
    uid                      Hitesh (Hi) <>
    sub   rsa4096 2020-07-25 [E]
    

    나중에 설정에 필요하므로 위의 공개 키 지문을 기억하십시오.

    다음으로 다음 명령을 사용하여 공개 및 개인 키를 /var/www/passbolt 디렉토리로 내보냅니다.

    gpg --armor --export-secret-keys  > /var/www/passbolt/config/gpg/serverkey.asc

    다음으로 Apache 사용자를 위해 gpg 키의 키링을 초기화해야 합니다. 다음 명령으로 수행할 수 있습니다.

    sudo su -s /bin/bash -c "gpg --list-keys" www-data

    다음 출력이 표시되어야 합니다.

    gpg: directory '/var/www/.gnupg' created
    gpg: keybox '/var/www/.gnupg/pubring.kbx' created
    gpg: /var/www/.gnupg/trustdb.gpg: trustdb created
    

    패스볼트 구성

    에서 데이터베이스 설정 키 지문 및 baseurl을 정의합니다.

    먼저 다음 명령을 사용하여 샘플 Passbolt 구성 파일을 복사합니다.

    cp /var/www/passbolt/config/passbolt{.default,}.php

    다음으로 다음 명령을 사용하여 Passbolt 구성 파일을 편집합니다.

    nano /var/www/passbolt/config/passbolt.php

    아래와 같이 fullbaseurl, 데이터베이스 및 공개 키 지문을 정의합니다.

            'fullBaseUrl' => 'https://passbolt.linuxbuz.com',
        // Database configuration.
    
        'Datasources' => [
            'default' => [
                'host' => 'localhost',
                //'port' => 'non_standard_port_number',
                'username' => 'passbolt',
                'password' => 'password',
                'database' => 'passboltdb',
                'serverKey' => [
                // Server private key fingerprint.
                'fingerprint' => 'D2394A45B7CBBAB7F00CC79B23D4750486780854',
                'public' => CONFIG . 'gpg' . DS . 'serverkey.asc',
                'private' => CONFIG . 'gpg' . DS . 'serverkey_private.asc',
    

    완료되면 파일을 저장하고 닫습니다.

    공개 키 지문이 기억나지 않으면 다음 명령을 사용하여 가져올 수 있습니다.

    gpg --list-keys --fingerprint | grep -i -B 2 

    다음 출력이 표시되어야 합니다.

    gpg: checking the trustdb
    gpg: marginals needed: 3  completes needed: 1  trust model: pgp
    gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
    pub   rsa4096 2020-07-25 [SC]
          D239 4A45 B7CB BAB7 F00C  C79B 23D4 7504 8678 0854
    uid           [ultimate] Hitesh (Hi) <>
    

    Passbolt용 Apache 구성

    다음으로 Passbolt용 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

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

    다음 줄을 추가합니다.

    <VirtualHost *:80>
    
            ServerName passbolt.linuxbuz.com
            DocumentRoot /var/www/passbolt
    
            ErrorLog ${APACHE_LOG_DIR}/passbolt_error.log
            CustomLog ${APACHE_LOG_DIR}/passbolt_access.log combined
    
    
          <Directory /var/www/passbolt/>
                    Options FollowSymLinks MultiViews
                    AllowOverride All
                    Require all granted
            </Directory>
    
    </VirtualHost>
    

    파일을 저장하고 닫은 다음 가상 호스트 파일을 활성화하고 다음 명령을 사용하여 Apache 서비스를 다시 시작합니다.

    a2ensite passbolt
    systemctl restart apache2

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

    Lets Encrypt로 안전한 Passbolt

    Lets Encrypt SSL로 웹 사이트를 보호하려면 시스템에 Certbot 클라이언트 유틸리티를 설치하여 SSL 인증서를 관리해야 합니다.

    다음 명령으로 설치할 수 있습니다.

    apt-get install python3-certbot-apache -y

    설치가 완료되면 다음 명령을 실행하여 Lets Encrypt SSL로 웹 사이트를 보호하십시오.

    certbot --apache -d passbolt.linuxbuz.com

    아래와 같이 이메일을 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator standalone, Installer None
    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
    Plugins selected: Authenticator apache, Installer apache
    Obtaining a new certificate
    Performing the following challenges:
    http-01 challenge for passbolt.linuxbuz.com
    Enabled Apache rewrite module
    Waiting for verification...
    Cleaning up challenges
    Created an SSL vhost at /etc/apache2/sites-available/passbolt-le-ssl.conf
    Enabled Apache socache_shmcb module
    Enabled Apache ssl module
    Deploying Certificate to VirtualHost /etc/apache2/sites-available/passbolt-le-ssl.conf
    Enabling available site: /etc/apache2/sites-available/passbolt-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를 입력하고 Enter 키를 눌러 웹사이트에 Lets Encrypt SSL을 설치합니다.

    Enabled Apache rewrite module
    Redirecting vhost in /etc/apache2/sites-enabled/passbolt.conf to ssl vhost in /etc/apache2/sites-available/passbolt-le-ssl.conf
    
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Congratulations! You have successfully enabled https://passbolt.linuxbuz.com
    
    You should test your configuration at:
    https://www.ssllabs.com/ssltest/analyze.html?d=passbolt.linuxbuz.com
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    
    IMPORTANT NOTES:
     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/passbolt.linuxbuz.com/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/passbolt.linuxbuz.com/privkey.pem
       Your cert will expire on 2020-10-23. 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
    

    이 시점에서 귀하의 웹사이트는 Lets Encrypt SSL로 보호됩니다.

    패스볼트 설치

    다음으로 Passbolt 설치 스크립트를 실행하여 Passbolt를 설치할 수 있습니다.

    먼저 디렉토리를 /var/www/passbolt로 변경합니다.

    cd /var/www/passbolt

    다음으로 다음 명령을 사용하여 Passbolt 설치 스크립트를 실행합니다.

    sudo su -s /bin/bash -c "./bin/cake passbolt install --no-admin" www-data

    설치가 성공적으로 완료되면 다음과 같은 결과가 표시됩니다.

    All Done. Took 1.6533s
    
    Import the server private key in the keyring
    ---------------------------------------------------------------
    Importing /var/www/passbolt/config/gpg/serverkey_private.asc
    Keyring init OK
    
    Passbolt installation success! Enjoy! ?
    

    다음으로 브라우저에서 Passbolt 설정을 완료해야 합니다. 웹 브라우저를 열고 URL https://passbolt.linuxbuz.com을 방문하십시오. 다음 화면이 표시됩니다.

    여기에서 브라우저용 플러그인을 다운로드하여 설치해야 합니다. 플러그인 다운로드를 클릭하여 Passbolt 플러그인을 다운로드하고 설치합니다. 설치가 완료되면 다음 단계로 진행할 수 있습니다.

    Passbolt 웹 인터페이스에 액세스

    시작하기 전에 관리 사용자를 생성하고 Passbolt의 비밀번호를 설정해야 합니다. 다음 명령으로 수행할 수 있습니다.

    cd /var/www/passbolt
    sudo su -s /bin/bash -c "./bin/cake passbolt register_user -u -f howtoforge -l Demo -r admin" www-data

    다음 출력이 표시되어야 합니다.

         ____                  __          ____  
        / __ \____  _____ ____/ /_  ____  / / /_ 
       / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/ 
      / ____/ /_/ (__  |__  ) /_/ / /_/ / / /    
     /_/    \__,_/____/____/_.___/\____/_/\__/   
    
     Open source password manager for teams
    ---------------------------------------------------------------
    User saved successfully.
    To start registration follow the link provided in your mailbox or here: 
    https://passbolt.linuxbuz.com/setup/install/5bcfb186-3d9f-448f-8388-f705abd855c8/a2ba80dc-5ef2-433a-9138-11282747b377
    

    이제 위 출력에서 링크를 복사하고 이를 사용하여 브라우저에서 Passbolt 설정을 완료합니다. 다음 화면이 표시됩니다.

    URL 및 GPG 키 지문이 올바른지 확인하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

    소유자 이름, 이메일을 제공하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

    비밀번호를 설정하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

    비밀 키를 다운로드하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

    보안 토큰을 설정하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

    사용자 이름, 비밀번호를 입력하고 로그인 버튼을 클릭합니다. 다음 화면에 Passbolt 대시보드가 표시되어야 합니다.

    결론

    축하합니다! Ubuntu 20.04 서버에 Lets Encrypt SSL을 사용하여 Passbolt 암호 관리자를 성공적으로 설치했습니다. 이제 팀 및 개별 사용자와 비밀번호를 저장하고 공유할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.