Zammad database user account

Infos:

  • Used Zammad version: 5.2.3
  • Used Zammad installation type: (source, package, docker-compose, …): Unknown
  • Operating system: Ubuntu 20.04
  • Browser + version: Chrome v.118

Expected behavior:

  • Be able to successfully log into the Ruby Rails console to run commands in the CLI and set up some customizations and environment variables.

Actual behavior:

  • I am trying to run the Ruby Rails console to configure some environment variables via CLI but it’s giving me a Permission Denied error when running the ‘zammad run rails c’. After some digging I found that it might have to do with the admin user account I’m using to log in. It seems I may need to use the “Zammad” user account however I don’t know the password. Is there a way to retrieve that password or change it so that I can access the Rails console?

Steps to reproduce the behavior:

  1. Log into VM
  2. Run command “zammad run rails c”
  3. Permission Denied Errors

I’m guessing you need to sudo the command: sudo zammad run rails c

Also, I’d update to the latest release as 5.2.3 is quite old.

2 Likes

I did that, does not make a difference. It is prompting me to use the ‘Zammad’ account which I do not have the credentials for. I’d like to know if there is a way to change that password or any other options so I can use the cli.

For more context…

Running as sudo does not help, I get the following:

And doing a cd to the /home/zammad directory gives me permission denied, as sudo, as you can see in the error message above. So no, running the command as sudo is not the solution

I don’t see where it’s telling you that you have to use the Zammad user. When you run the command as sudo and are getting those errors, the command worked. You have errors to address.

I’m going to guess that permissions are not correct and it doesn’t matter what user you run the command as.

Here is the specific error:

Unfortunately, I did not configure this Zammad instance so I don’t have much background information on how the permissions were configured, etc. Any suggestions for how to address these permission errors? Is there a way for me to change the Zammad account password?

If you notice it also says; “or with root privileges”

That means that when you run Zammad run rails c run it as sudo and it will work.

I’m not sure how familiar you are with Linux, or what impact changing a users password will have the operation of your environment. To reset a users password you will want to execute Ubuntu commands. I would make a full backup of the system before proceeding. I’m also not sure how to address those permission issues in Ruby which I anticipate you’ll encounter as any user. Hopefully someone else here can offer some guidance there.

Also, your install is very outdated and updating should be your first priority.

Yes, I noticed that which made me think to try sudo but still got the errors above after doing that. I am very familiar with Linux, I just wasn’t sure if the Zammad user account was something created by default through the Zammad package. I will continue looking into the permissions set on the Ubuntu box.

Updating is also something I’m looking into and why I noticed issues with permissions, unfortunately one of the update steps is to clear the Zammad cache which is done through a command on Rails. $ zammad run rails r “Rails.cache.clear”.

Zammad run rails c - enters ruby console.
Zammad run rails r - runs a command.

Do you get errors when you run the command to clear cache without entering rails console?

sudo zammad run rails r “Cache.clear”

If installed by package, the Zammad package creates a “zammad” user. But not with /home/zammad as home folder, but with /opt/zammad instead. As I saw /home/zammad in one of your error messages, I guess (I am not a Linux expert), a Linux user “zammad” was created prior to the zammad installation. And this may lead to some confusion.

The “zammad run *” command is btw a way to run commands as the user “zammad”. So “zammad run rails c” runs the command “rails c” in the context of the user “zammad”.

Sorry, no solution in itself, but maybe some helpful informations.

Thanks, that is very helpful. Do you know if that “zammad” user has a default password out of the box? I can see the /opt/zammad directory so I’m assuming this was a package install. If I can ‘su’ as zammad I think that would work for me, I just don’t know the password when it prompts for it :frowning:

The Zammad user is a system account and thus has no password or login by default.

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