It’s not a SSH problem, but a MariaDB (MySQL).
It seems that on later builds, root access is no longer allowed by default
I managed to solve this problem, but Docker is a real pain in my a** , I wonder why developers persist in using it …
If anyone’s interested, what I’ve done :
- stopped all components by
docker-compose stop
- retrieve the password from /mnt/repo-base/.env
- started a new container of mariadb using
docker container run -i -t -v “/mnt/repo-base/volumes/mysql/db:/var/lib/mysql” -v “/mnt/repo-base/config-dynamic/nextcloud/database:/docker-entrypoint-initdb.d” mariadb:10.3.17 ‘/bin/bash’
- once started, I got an interactive bash shell
- in this shell, launched
mysqld_safe --defaults-file=/etc/mysql/debian.cnf --skip-grant-tables --user=root &
- and then
mysql -u root
- in SQL shell, launched
use mysql;
update user set password=password(‘<MYSQL_ROOT_PASSWORD>’) where user=‘root’;
update user set authentication_string=‘’ where user=‘root’;
update user set plugin=‘’ where user=‘root’;
flush privileges;
\q
- then killed the mysqld process and the shell (ctrl-d), destroyed the container
docker container ls -a
docker container rm #
- then restarted the mariadb container and checked
docker container ls -a
docker container start #
docker exec -i -t # bash
mysql -u root -p
(ctrl-d)
docker container stop #
- then restarted all
source /mnt/repo-base/scripts/base.sh
docker-compose start
- and relaunched the post-install script
/mnt/repo-base/scripts/postinstall.sh
A little further, I got :
PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user ‘postfix’@‘172.18.0.8’ (using password: YES) in /postfixadmin/functions.inc.php:1564
I had to connect a shell to mariadb container and use the following SQL to unlock :
grant all privileges on . to ‘postfix’@‘172.18.0.%’ identified by ‘’ with grant option;
After that the scripts ended successfully
And, finally, it works !