Gpg permission denied

Hello,

I am trying to install passbolt on raspbian stretch with nginx and PHP 7.0 using this guide: https://medium.com/passbolt/passbolt-on-debian-8-71-from-scratch-4438dad18908

Everything works till this command:

gpg --armor --export-secret-keys passbolt@passbolt.dev > /var/www/passbolt/app/Config/gpg/serverkey.private.asc gpg --armor --export passbolt@passbolt.dev > /var/www/passbolt/app/Config/gpg/serverkey.asc

I am getting an error:
-bash: /var/www/passbolt/app/Config/gpg/serverkey.asc: Permission denied

Any ideas what am I doing wrong? Thank you.

Hi @whst!

Those are 2 commands:
gpg --armor --export-secret-keys passbolt@passbolt.dev > /var/www/passbolt/app/Config/gpg/serverkey.private.asc
And
gpg --armor --export passbolt@passbolt.dev > /var/www/passbolt/app/Config/gpg/serverkey.asc

Might be a dumb question but are you root or any other user with write permissions on /var/www/passbolt?

Well dumb questions are good questions as actually I am pretty new with all this Linux stuff :slight_smile:
I use SSH and I write “sudo” before the commands, doesn’t that cover permissions stuff?

Yeah, problem is that you are executing a redirection on that command as well. I guess you did this:

sudo gpg --armor --export-secret-keys passbolt@passbolt.dev > /var/www/passbolt/app/Config/gpg/serverkey.private.asc

Which just elevates privileges for the gpg part and the redirection is being performed as regular user. Considering you created your gpg keys as root user and you want to export root keys to /var/www/passbolt/app/Config/gpg/:

You have plenty of alternatives here like for instance:

sudo gpg --armor --export-secret-keys passbolt@passbolt.dev | sudo tee /var/www/passbolt/app/Config/gpg/serverkey.private.asc

Thank you very much @diego , it worked now and your explanation helped me to understand what I did wrong :slight_smile:

Unfortunately, next problem came up:

sudo su -s /bin/bash -c “app/Console/cake install --no-admin” www-data

Cake Schema Shell

Error: Database connection “Mysql” is missing, or could not be created.
#0 /var/www/passbolt/lib/Cake/Model/Datasource/DboSource.php(269): Mysql->connect()
#1 /var/www/passbolt/lib/Cake/Model/ConnectionManager.php(105): DboSource->__construct(Array)
#2 /var/www/passbolt/app/Console/Command/SchemaShell.php(317): ConnectionManager::getDataSource(‘default’)
#3 /var/www/passbolt/app/Console/Command/SchemaShell.php(251): SchemaShell->_create(Object(AppSchema), NULL)
#4 /var/www/passbolt/lib/Cake/Console/Shell.php(458): SchemaShell->create()
#5 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(219): Shell->runCommand(‘create’, Array)
#6 /var/www/passbolt/lib/Cake/Console/Shell.php(399): ShellDispatcher->dispatch()
#7 /var/www/passbolt/app/Console/Command/InstallShell.php(312): Shell->dispatchShell(‘schema create -…’)
#8 /var/www/passbolt/app/Console/Command/InstallShell.php(133): InstallShell->schema()
#9 /var/www/passbolt/lib/Cake/Console/Shell.php(461): InstallShell->main()
#10 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(219): Shell->runCommand(’–no-admin’, Array)
#11 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#12 /var/www/passbolt/app/Console/cake.php(52): ShellDispatcher::run(Array)
#13 {main}

I found out that it might be problem with typo in database.php, but when I put this script in my index.php it works fine (Connected successfully):

<?php $servername = "localhost"; $database = "passbolt"; $username = "passbolt"; $password = "myPasswordHere"; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; ?>

@whst please create a different issue for the mysql problem so that other people with similar issue can also see the solution.
Thanks,

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.