sudoers on Debian 9 installed from docker

0

I've installed a tomcat docker image based on Debian9. There is something weird with user creation I don't understand.

I'm root and I add an user with

useradd adminuser

No home directory is created...well. I create it. I add a password to the user with

passwd adminuser

I add the user to sudoers with

usermod -aG sudo adminuser

(I have actually to install sudo with apt-get install sudo)

Now if I log as adminuser with

 su adminuser

Password is not asked. Second, I can't sudo (sudo command not found) nor I have common commands available to root like java...

I also see that there is no /etc/sudoers file...

What is wrong?

I add /etc/sudoers with

%sudo   ALL=(ALL:ALL) ALL

but nothing changes. Adding export PATH in ~/.bashrc I can get commands as root though, but not sudo. I also add /bin/bash to /etc/passwd...as there was nothing

Glasnhost

Posted 2019-10-11T14:39:25.713

Reputation: 101

Answers

0

You may want to install sudo:

apt install sudo

Then reconsider, as containers are not meant to be standalone systems, rather small bricks within a bigger picture.

SYN

Posted 2019-10-11T14:39:25.713

Reputation: 287

I did install sudo indeed. The purpose of the container actually is to test some installations on centos without using virtual machines like VirtualBox – Glasnhost – 2019-10-12T08:49:05.477