0328.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Installing Passbolt on Linux (Debian 10)</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="How To,Tutorial,i12bretro,Passbolt,Password Vault,Password Locker,Password Manager,Linux,Debian,Ubuntu,Self-Hosted,Security,Web Based">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Installing Passbolt on Linux (Debian 10)">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  12. <script type="text/javascript">
  13. $(function(){
  14. $('textarea').each(function(i,e){
  15. theTextarea = $(this);
  16. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  17. });
  18. $('li').each(function(i,e){
  19. if(!$(this).hasClass('noCheckbox')){
  20. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  21. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  22. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  23. }
  24. });
  25. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  26. theElement = $(this);
  27. var lines = theElement.html().split("\n");
  28. theElement.empty();
  29. for(l=0;l<lines.length;l++){
  30. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  31. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ $.trim(lines[l].replace(/"/g, '&quot;')) +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  32. } else {
  33. theElement.append(lines[l]);
  34. }
  35. }
  36. });
  37. $(document).on('click','input.copy-text',function(){
  38. theButton = $(this);
  39. $('input.copy-text').attr('src','images/clipboard.png');
  40. $('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
  41. try {
  42. if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
  43. $('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
  44. } else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
  45. $('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
  46. } else {
  47. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  48. }
  49. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  50. theButton.attr('src','images/clipboard_active.png');
  51. } catch(err) {
  52. }
  53. return false;
  54. });
  55. $(document).on('click','input.completeBox',function(){
  56. theBox = $(this);
  57. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  58. theBox.prop('disabled',true);
  59. theBox.parent('li').prevAll().each(function(i,e){
  60. theLI = $(this);
  61. if(theLI.find('input[type=checkbox]').not(':checked')){
  62. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  63. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  64. }
  65. });
  66. });
  67. if(window.self !== window.top){
  68. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  69. }
  70. });
  71. </script>
  72. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  73. </head>
  74. <body>
  75. <div id="gridContainer">
  76. <div class="topMargin"></div>
  77. <div id="listName" class="topMargin">
  78. <h1>Installing Passbolt on Linux (Debian 10)</h1>
  79. </div>
  80. <div></div>
  81. <div id="content">
  82. <ol>
  83. <li>Log into the Debian device</li>
  84. <li>Run the following commands in a terminal:
  85. <div class="codeBlock"># update software repositories<br />
  86. sudo apt update<br />
  87. # install available updates<br />
  88. sudo apt upgrade -y<br />
  89. # install some dependencies<br />
  90. sudo apt install git composer apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y<br />
  91. # install Apache HTTPD and MySQL<br />
  92. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  93. # install PHP components<br />
  94. sudo apt install php7.3 libapache2-mod-php7.3 php-imagick php-gnupg php7.3-common php7.3-mysql php7.3-fpm php7.3-ldap php7.3-gd php7.3-imap php7.3-json php7.3-curl php7.3-zip php7.3-xml php7.3-mbstring php7.3-bz2 php7.3-intl php7.3-gmp php7.3-xsl -y<br />
  95. # configure the MySQL database<br />
  96. sudo su<br />
  97. mysql_secure_installation</div>
  98. </li>
  99. <li>Press Enter to login as root</li>
  100. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  101. <li>Type Y and press Enter to remove anonymous users</li>
  102. <li>Type Y and press Enter to disallow root login remotely</li>
  103. <li>Type Y and press Enter to remove the test database</li>
  104. <li>Type Y and press Enter to reload privilege tables</li>
  105. <li>Run the following command to login into MySQL:
  106. <div class="codeBlock">mysql -u root -p</div>
  107. </li>
  108. <li>Authenticate with the root password set earlier</li>
  109. <li>Run the following commands to create the Passbolt database and database user
  110. <div class="codeBlock">CREATE DATABASE passbolt DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<br />
  111. GRANT ALL ON passbolt.* TO &#39;passboltuser&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;Pa$$b0lt!!&#39;;<br />
  112. FLUSH PRIVILEGES;<br />
  113. EXIT;<br />
  114. exit</div>
  115. </li>
  116. <li>Continue with the following commands to download and extract Passbolt in the Apache webroot
  117. <div class="codeBlock">cd /var/www<br />
  118. # clone passbolt from github<br />
  119. sudo git clone https://github.com/passbolt/passbolt_api.git<br />
  120. # rename extracted folder passbolt<br />
  121. sudo mv /var/www/passbolt* /var/www/passbolt<br />
  122. # set the owner of the new passbolt directory to www-data<br />
  123. sudo chown -R www-data:www-data /var/www/passbolt<br />
  124. # setup composer working directory<br />
  125. sudo mkdir /var/www/.composer<br />
  126. sudo chown -R www-data:www-data /var/www/.composer<br />
  127. cd /var/www/passbolt<br />
  128. # install dependencies with composer, answer y to default permissions<br />
  129. sudo -u www-data composer install --no-dev<br />
  130. # generate a key pair<br />
  131. gpg --gen-key</div>
  132. </li>
  133. <li>Enter a name and email address</li>
  134. <li>Type O for Okay &gt; Press Enter</li>
  135. <li>When prompted, leave the passwords blank</li>
  136. <li>Continue the installation with the following commands in terminal
  137. <div class="codeBlock"># export the private key, replace email with the email used to create the key pair above<br />
  138. gpg --armor --export-secret-keys i12bretro@i12bretro.local | sudo tee /var/www/passbolt/config/gpg/serverkey_private.asc &gt; /dev/null<br />
  139. # export the public key, replace email with the email used to create the key pair above<br />
  140. gpg --armor --export i12bretro@i12bretro.local | sudo tee /var/www/passbolt/config/gpg/serverkey.asc &gt; /dev/null<br />
  141. # setup gnupg working directory<br />
  142. sudo mkdir /var/www/.gnupg<br />
  143. sudo chown -R www-data:www-data /var/www/.gnupg<br />
  144. # initialize the keyring for www-data<br />
  145. sudo su -s /bin/bash -c &quot;gpg --list-keys&quot; www-data<br />
  146. # create a copy of the configuration template file<br />
  147. cd /var/www/passbolt/<br />
  148. sudo cp config/passbolt.default.php config/passbolt.php<br />
  149. # display the GPG key fingerprint, update the email to what was used above, copy the output to the clipboard<br />
  150. gpg --list-keys --fingerprint | grep -i -B 2 &#39;i12bretro@i12bretro.local&#39;<br />
  151. # edit the passbolt config file<br />
  152. sudo nano config/passbolt.php</div>
  153. </li>
  154. <li>Press CTRL + W and search for fullBaseUrl</li>
  155. <li>Update the URL to http://DNSorIP/passbolt</li>
  156. <li>Press CTRL + W and search for Database configuration</li>
  157. <li>Update the database connection information
  158. <p>host: localhost<br />
  159. username: passboltuser<br />
  160. password: Pa$$b0lt!!<br />
  161. database: passbolt</p>
  162. </li>
  163. <li>Press CTRL + W and search for Email configuration</li>
  164. <li>Update the email server configuration and default sender account</li>
  165. <li>Press CTRL + W and search for fingerprint</li>
  166. <li>Paste the fingerprint from the clipboard</li>
  167. <li>Remove all spaces from the fingerprint</li>
  168. <li>Uncomment the public and private lines below the fingerprint by deleting //</li>
  169. <li>Press CTRL + W and search for passbolt</li>
  170. <li>Paste the following after the &#39;passbolt&#39; =&gt; [ line to disable the SSL requirement<br />
  171. &#39;ssl&#39; =&gt; [<br />
  172. &#39;force&#39; =&gt; false,<br />
  173. ],</li>
  174. <li>Press CTRL+O, Enter, CTRL+X to write the changes to passbolt.php</li>
  175. <li>Continue the installation with the following commands
  176. <div class="codeBlock"># create a passbolt apache2 config<br />
  177. sudo nano /etc/apache2/sites-available/passbolt.conf</div>
  178. </li>
  179. <li>Paste the following configuration into passbolt.conf
  180. <p>Alias /passbolt /var/www/passbolt/webroot<br />
  181. &lt;Directory /var/www/passbolt/webroot&gt;<br />
  182. Options FollowSymLinks MultiViews<br />
  183. AllowOverride All<br />
  184. Order allow,deny<br />
  185. allow from all<br />
  186. &lt;/Directory&gt;</p>
  187. </li>
  188. <li>Press CTRL+O, Enter, CTRL+X to write the changes to passbolt.conf</li>
  189. <li>Run the following command to enable the passbolt site
  190. <div class="codeBlock"># enable apache modules<br />
  191. sudo a2enmod headers rewrite<br />
  192. # enable the passbolt site<br />
  193. sudo a2ensite passbolt.conf<br />
  194. # restart the apache2 service<br />
  195. sudo systemctl restart apache2</div>
  196. </li>
  197. <li>Run the following command to run the passbolt installer
  198. <div class="codeBlock">sudo su -s /bin/bash -c &quot;./bin/cake passbolt install --force&quot; www-data</div>
  199. </li>
  200. <li>When prompted, enter an email address, first name and last name to create an account</li>
  201. <li>Copy the URL output after the installation completes</li>
  202. <li>Open a web browser</li>
  203. <li>Install the Passbolt browser extension</li>
  204. <li>With the Passbolt extension installed, navigate to the URL copied from the output of the install script</li>
  205. <li>The Passbolt setup screen should be displayed</li>
  206. <li>Enter a passphrase to use for the account</li>
  207. <li>Save the recovery and store it in a safe place &gt; Click the Next button</li>
  208. <li>Set a color and 3 letter security token &gt; Click the Next button</li>
  209. <li>Welcome to self-hosted Passbolt Password Vault</li>
  210. </ol>
  211. </div>
  212. </div>
  213. </body>
  214. </html>