Installa e configura Passbolt Team Password Manager su Ubuntu 20.04
Su questa pagina
- Prerequisiti
- Installa il server LAMP
- Configura database MariaDB
- Scarica e configura Passbolt
- Scarica Passbolt
- Genera chiave OpenPGP
- Configura Passbolt
Passbolt è un gestore di password gratuito, open source, self-hosted ed estensibile che ti aiuta a condividere e archiviare in modo sicuro le credenziali di accesso, come la password del router, del sito Web, del Wi-Fi e altro. È diverso dagli altri gestori di password. si concentra sull'utilizzo del team piuttosto che sugli individui. È disponibile sia in versione community che a pagamento. Offre molte funzionalità, alcune delle quali sono elencate di seguito:
- Fornisce estensioni per Firefox e Google Chrome.
- Usa OpenPGP per crittografare la password.
- Interfaccia web semplice e intuitiva.
- Permette di importare ed esportare password.
- Consente di aggiungere manualmente le credenziali di accesso.
In questo tutorial spiegheremo come installare Passbolt Password Manager con Apache e Lets Encrypt su Ubuntu 20.04.
Prerequisiti
- Un server che esegue Ubuntu 20.04.
- Un nome di dominio valido indicato con l'IP del tuo server.
- Il server è configurato con una password di root.
Installa LAMP Server
Innanzitutto, dovrai installare il server Apache e MariaDB nel tuo sistema. Puoi installarli con il seguente comando:
apt-get install apache2 mariadb-server -y
Dopo aver installato i pacchetti di cui sopra, dovrai anche installare PHP e altri pacchetti richiesti nel tuo sistema.
Per impostazione predefinita, Ubuntu 20.04 viene fornito con PHP7.4 nel suo repository predefinito. Tuttavia, Passbolt non supporta PHP7.4. Quindi dovrai aggiungere il repository PHP nel tuo sistema.
Innanzitutto, installa i pacchetti richiesti con il seguente comando:
apt-get install software-properties-common gnupg -y
Successivamente, aggiungi il repository PHP con il seguente comando:
add-apt-repository ppa:ondrej/php --yes
Successivamente, installa la versione 7.3 di PHP con Composer e altre estensioni richieste con il seguente comando:
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
Una volta installati tutti i pacchetti, puoi procedere al passaggio successivo.
Configura database MariaDB
Innanzitutto, dovrai proteggere l'installazione di MariaDB e impostare la password di root di MariaDB. Puoi farlo con il seguente comando:
mysql_secure_installation
Questo script imposterà la password di root di MariaDB, rimuoverà gli utenti anonimi, non consentirà l'accesso root da remoto e rimuoverà il database di test e l'accesso ad esso come mostrato di seguito:
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
Una volta che MariaDB è protetto, accedi alla shell MariaDB con il seguente comando:
mysql -u root -p
Fornisci la tua password di root quando richiesto, quindi crea un database e un utente per Passbolt con il seguente comando:
MariaDB [(none)]> CREATE DATABASE passboltdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
MariaDB [(none)]> GRANT ALL on passboltdb.* to identified by 'password';Successivamente, scarica i privilegi ed esci da MariaDB con il seguente comando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;Una volta terminato, puoi procedere al passaggio successivo.
Scarica e configura Passbolt
In questa sezione impareremo come scaricare e configurare passbolt:
Scarica Passbolt
Innanzitutto, scarica l'ultima versione di Passbolt nella directory root web di Apache con il seguente comando:
mkdir /var/www/passbolt
git clone https://github.com/passbolt/passbolt_api.git /var/www/passboltUna volta scaricato, cambia la proprietà del passbolt in www-data con il seguente comando:
chown -R www-data:www-data /var/www/
Successivamente, modifica la directory in passbolt e installa le dipendenze richieste con il seguente comando:
cd /var/www/passbolt
sudo -u www-data composer install --no-devDovresti ottenere il seguente output:
> 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
Digita Y e premi Invio per impostare i permessi della cartella.
Genera chiave OpenPGP
Successivamente, dovrai generare la chiave OpenPGP per autenticare e firmare le richieste JSON in uscita. Puoi generarlo con il seguente comando:
cd /var/www/passbolt
gpg --full-generate-keyDurante il processo, ti verrà chiesta la passphrase, premi semplicemente il tasto Tab, seleziona OK e conferma che non vuoi impostarla., perché il modulo php-gnupg non supporta l'uso della passphrase al momento.
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] Si prega di ricordare l'impronta digitale della chiave pubblica di cui sopra in quanto sarà necessaria più avanti nella configurazione.
Successivamente, esporta la chiave pubblica e privata nella directory /var/www/passbolt con i seguenti comandi:
gpg --armor --export-secret-keys > /var/www/passbolt/config/gpg/serverkey.asc
Successivamente, dovrai inizializzare il portachiavi della chiave gpg per l'utente Apache. Puoi farlo con il seguente comando:
sudo su -s /bin/bash -c "gpg --list-keys" www-data
Dovresti ottenere il seguente output:
gpg: directory '/var/www/.gnupg' created gpg: keybox '/var/www/.gnupg/pubring.kbx' created gpg: /var/www/.gnupg/trustdb.gpg: trustdb created
Configura Passbolt
Innanzitutto, copia il file di configurazione Passbolt di esempio con il seguente comando:
cp /var/www/passbolt/config/passbolt{.default,}.php
Quindi, modifica il file di configurazione Passbolt con il seguente comando::
nano /var/www/passbolt/config/passbolt.php
Definisci il tuo fullbaseurl, il database e l'impronta digitale della chiave pubblica come mostrato di seguito:
'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',
Salva e chiudi il file quando hai finito.
Se non ricordi l'impronta digitale della tua chiave pubblica, puoi recuperarla con il seguente comando:
gpg --list-keys --fingerprint | grep -i -B 2
Dovresti ottenere il seguente output:
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) <>
Configura Apache per Passbolt
Successivamente, dovrai creare un file di configurazione dell'host virtuale Apache per Passbolt. Puoi crearlo con il seguente comando:
nano /etc/apache2/sites-available/passbolt.conf
Aggiungi le seguenti righe:
<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>
Salvare e chiudere il file quindi attivare il file dell'host virtuale e riavviare il servizio Apache con il seguente comando:
a2ensite passbolt
systemctl restart apache2Quando hai finito, puoi procedere al passaggio successivo.
Proteggi Passbolt con Lets Encrypt
Per proteggere il tuo sito Web con Lets Encrypt SSL, dovrai installare l'utilità client Certbot nel tuo sistema per gestire il certificato SSL.
Puoi installarlo con il seguente comando:
apt-get install python3-certbot-apache -y
Una volta installato, esegui il seguente comando per proteggere il tuo sito web con Lets Encrypt SSL:
certbot --apache -d passbolt.linuxbuz.com
Ti verrà chiesto di fornire la tua email e di accettare i termini di servizio come mostrato di seguito:
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
Successivamente, seleziona se reindirizzare o meno il traffico HTTP su HTTPS come mostrato di seguito:
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
Digita 2 e premi Invio per installare Lets Encrypt SSL per il tuo sito web:
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
A questo punto, il tuo sito web è protetto con Lets Encrypt SSL.
Installa Passbolt
Successivamente, puoi installare Passbolt eseguendo lo script di installazione di Passbolt.
Innanzitutto, cambia la directory in /var/www/passbolt:
cd /var/www/passbolt
Successivamente, esegui lo script di installazione di Passbolt con il seguente comando:
sudo su -s /bin/bash -c "./bin/cake passbolt install --no-admin" www-data
Una volta che l'installazione è stata completata con successo, dovresti ottenere il seguente output:
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! ?
Successivamente, dovrai finalizzare la configurazione di Passbolt dal browser. Apri il tuo browser web e visita l'URL https://passbolt.linuxbuz.com. Dovresti vedere la seguente schermata:
Qui dovrai scaricare e installare un plug-in per il tuo browser. Fare clic su Scarica il plug-in per scaricare e installare il plug-in Passbolt. Una volta installato, puoi procedere al passaggio successivo.
Accedi all'interfaccia web di Passbolt
Prima di iniziare, dovrai creare un utente amministratore e impostare una password per Passbolt. Puoi farlo con il seguente comando:
cd /var/www/passbolt
sudo su -s /bin/bash -c "./bin/cake passbolt register_user -u -f howtoforge -l Demo -r admin" www-dataDovresti ottenere il seguente output:
____ __ ____ / __ \____ _____ ____/ /_ ____ / / /_ / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/ / ____/ /_/ (__ |__ ) /_/ / /_/ / / / /_/ \__,_/____/____/_.___/\____/_/\__/ 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
Ora, copia il link dall'output sopra e usalo per finalizzare l'installazione di Passbolt sul browser. Dovresti vedere la seguente schermata:
Verificare che l'impronta digitale dell'URL e della chiave GPG sia corretta e fare clic sul pulsante Avanti. Dovresti vedere la seguente schermata:
Fornire il nome del proprietario, l'e-mail e fare clic sul pulsante Avanti. Dovresti vedere la seguente schermata:
Imposta la tua password e fai clic sul pulsante Avanti. Dovresti vedere la seguente schermata:
Scarica la tua chiave segreta e fai clic sul pulsante Avanti. Dovresti vedere la seguente schermata:
Imposta un token di sicurezza e fai clic sul pulsante Avanti. Dovresti vedere la seguente schermata:
Fornisci il tuo nome utente, password e fai clic sul pulsante di accesso. Dovresti vedere la dashboard di Passbolt nella seguente schermata:
Conclusione
Congratulazioni! hai installato correttamente il gestore di password Passbolt con Lets Encrypt SSL sul server Ubuntu 20.04. Ora puoi archiviare e condividere le tue password con i tuoi team e singoli utenti. Non esitate a chiedermi se avete domande.