Docker cannot login as admin via ssh, cannot switch to admin user

I am trying to test a yunohost community app, so I set up a docker container to be used as a dev environment.
The fact is I’ve run yunohost tools postinstallon the container, set the admin password, etc.
But when I try to connect via ssh to the container :

ssh admin@local.lan -p 2222
admin@local.lan’s password:
Permission denied, please try again.

I type the password I have set for admin user but it keeps saying “permission denied”.
Any idea…?

BTW I’m trying to connect via ssh because when I run a terminal via docker exec and then try to install my app I get errors (see folowing lines) :

root@bc501a23af69:/# yunohost app install /yunohost_apps/Gogs/
chown: invalid spec: admin:' chown: invalid spec: admin:’
Choose a domain for Gogs: local.lan
Choose a path for Gogs (default: /gogs):
Choose the admin user for Gogs: ramen
Enter a password for the administrator: 1234
Is it a public site ? (Yes|No) (default: Yes):
Executing script…
No passwd entry for user ‘admin’
Error: Installation failed

What I understand is I cannot switch to the admin user.
I don’t think it comes from the app itself because i put several echo "something" in the scripts and nothing outputs…

Any help would be appreciated…

Hi, I would recommend to do your tests in a virtual machine using the image provided rather than in docker.
If not possible in docker using the image provided and instructions in the documentation
Then you can install apps as root rather than as admin


Hi, thanks for replying.
Actualy I’ve had pretty bad experience with virtual box, especially about access time to vboxfs folders, that’s why I’d like to avoid it.
As you can see in my first post, all my commands are already run as root:

Could you try again please?
sudo useradd admin
sudo passwd admin

(I think these are the commands more or less…)

Good idea,
but I don’t think it would work. I don’t think there should be any “admin” entry in /etc/passwd as every Yunohost users (and so admin) are stored in the LDAP server. But maybe that’s an LDAP issue…
I’ll try your suggestion and also take a look at the LDAP when I get home, this evening.

Thank you.

ok, your solution worked great actually!
thank you…

You’re welcome :wink: Actually it was the same for some Raspberry postinstalls and various other situations. I don’t know why…