Disable root, absolutely require password for 'ubuntu'

lxc exec executes a command directly into the container as the root user, the kernel doesn’t have a concept of authentication so there’s no prompt there.

Make sure you don’t give access to the lxc command to anyone who you don’t want to have root access to all containers (and to the host). To give access to other users to your containers, the best is to just use plain old SSH which will go through the normal userspace authentication stack of the container.

2 Likes