Auth.json permissions issue

Hi. I installed OC3.x via composer in a fresh LAMP stack on Ubuntu 22.04. We have a couple of linux users. When trying to install a plugin using php artisan plugin:install rainlab.builder I get an error that says file auth.json is not readable. How can I solve this?

This error is occurring because the user that is running the php artisan plugin:install command does not have the proper permissions to read the auth.json file.

To solve this issue, you can change the ownership of the auth.json file to the user that is running the php artisan plugin:install command. Here are the steps to do this:

  1. Find out the username of the user that is running the php artisan plugin:install command by running the whoami command in the terminal.

  2. Change the ownership of the auth.json file to the user that is running the command by running the following command in the terminal:

    sudo chown <username>:<username> /path/to/auth.json
    

    Replace <username> with the username of the user that is running the command, and /path/to/auth.json with the path to the auth.json file.

  3. Make sure that the auth.json file has the correct permissions by running the following command in the terminal:

    sudo chmod 644 /path/to/auth.json
    

This will give read and write permissions to the owner of the file, and read permissions to everyone else.

Once you have changed the ownership and permissions of the auth.json file, you should be able to run the php artisan plugin:install command without encountering the “file auth.json is not readable” error.

Hi, thanks for your answer. I know that I can “solve” that changing the file permissions. But my question is if I should. I think there might be a reason for that file to come up with those strict permissions after install. But as I said, we’re a group of developers and we all need to be able to run plugin installs.
@daft any advice on this?

Take a look at umask settings in Linux, it controls the default permissions.