I can't register admin user (non-root docker) [use non-root version of command]

Hello, I wanted to consult because I have a problem, I have installed in docker and I think it works fine, but when I create the admin user, it does not show the link on the screen nor does it send me an email.

This is the code that I execute, and the user “adminsrv” is that I use in ubuntu. After executing this code it does nothing.

if you open the web, it opens but always goes to/auth/login?redirect=%2F&locale=es-ES

docker-compose -f docker-compose-ce.yaml exec adminsrv su -m -c “/usr/share/php/passbolt/bin/cake
adminsrv register_user
-u sistemas@mail.com
-f
-l
-r admin” -s /bin/sh www-data

Hi @SistemaInprotur Welcome to the forum!

What is happening here is just a misunderstanding of the command. Your user’s email address (u), and first (f) and last (l) name are able to be set.

Where you have adminsrv it needs to be passbolt.

Hi Garrett, I already tried that but it doesn’t work, it gives the following error.

adminsrv@svr-docker01:~/passbolt$ docker-compose -f docker-compose-ce.yaml exec passbolt su -m -c “/usr/share/php/passbolt/bin/cake
passbolt register_user
-u sistemas@xxxxxx.xxx
-f
-l
-r admin” -s /bin/sh www-data
Password:
su: Authentication failure

I don’t know what the passbolt user’s password is, I haven’t created it, that’s why it had changed to the ubuntu user with which I run, which is adminsrv.

The first passbolt is a reference to the passbolt container, and the second passbolt is a reference to a passbolt family of commands.

The adminsrv user must not have su rights would be my guess. Or, if it asks for a password, provide the one for adminsrv.

ok thanks, if I type the password of the adminsrv user, it gives the same error, “su: Authentication failure”. So where does it say passbolt do I have to change something?
Sorry I didn’t understand this part.

Which docker tag are you using here? The non-root one will have slightly different instructions for the first user creation

Hi Clayton, yes I am using image: passbolt/passbolt:latest-ce-non-root.

I think everything works but I would need to create that first admin user.

version: ‘3.9’
services:
db:
image: mariadb:10.3
restart: unless-stopped
environment:
MYSQL_RANDOM_ROOT_PASSWORD: “true”
MYSQL_DATABASE: “passbolt”
MYSQL_USER: “passbolt”
MYSQL_PASSWORD: “xxxxxxxxxxxxxx”
volumes:
- database_volume:/var/lib/mysql

passbolt:
#image: passbolt/passbolt:latest-ce
#Alternatively you can use rootless:
image: passbolt/passbolt:latest-ce-non-root
restart: unless-stopped
depends_on:
- db
environment:
APP_FULL_BASE_URL: https://vault.xxxxxxxxx.xxx:xxxx
DATASOURCES_DEFAULT_HOST: “db”
DATASOURCES_DEFAULT_USERNAME: “passbolt”
DATASOURCES_DEFAULT_PASSWORD: “xxxxxxxxxxxxxx”
DATASOURCES_DEFAULT_DATABASE: “passbolt”
#PASSBOLT_REGISTRATION_PUBLIC: “true”
EMAIL_DEFAULT_FROM_NAME: “Passbolt”
EMAIL_DEFAULT_FROM: “no-replay@xxxxxx.xxx”
EMAIL_TRANSPORT_DEFAULT_HOST: 192.168.xxx.xxx
EMAIL_TRANSPORT_DEFAULT_PORT: 25
EMAIL_TRANSPORT_DEFAULT_USERNAME: null
EMAIL_TRANSPORT_DEFAULT_PASSWORD: null
EMAIL_TRANSPORT_DEFAULT_TLS: null
volumes:
- gpg_volume:/etc/passbolt/gpg
- jwt_volume:/etc/passbolt/jwt
- ./certs/cert.pem:/etc/passbolt/certs/certificate.crt:ro
- ./certs/key.pem:/etc/passbolt/certs/certificate.key:ro
command: [“/usr/bin/wait-for.sh”, “-t”, “0”, “db:xxxx”, “–”, “/docker-entrypoint.sh”]
ports:
# - 80:80
# - 443:443
#Alternatively for non-root images:
- 80:xxxx
- 443:xxxx

volumes:
database_volume:
gpg_volume:
jwt_volume:

Ok that makes sense with the error you have been getting. The non-root install by default uses the www-data user so no need to su so the command will actually be:

docker-compose -f docker-compose-ce.yaml exec passbolt ./bin/cake passbolt register_user \
-u email@domain.tld \
-f yourname \
-l surname \
-r admin
1 Like

Excellent, Clayton was that. Thank you very much for your help.

2 Likes