Eu tento criar um contêiner sem privilégios e nada funciona como esperado.
Aqui está o meu código: segue esse tutorial
#!/bin/bash
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -y install lxc uidmap
sudo sh -c 'echo 1 > /sys/fs/cgroup/cpuset/cgroup.clone_children'
sudo sh -c 'echo 1 > /proc/sys/kernel/unprivileged_userns_clone'
sudo usermod --add-subuids 100000-165536 $USER
sudo usermod --add-subgids 100000-165536 $USER
sudo chmod +x $HOME
mkdir -p ~/.config/lxc/
echo "lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
" > ~/.config/lxc/default.conf
sudo sh -c "echo '$USER veth lxcbr0 10' > /etc/lxc/lxc-usernet"
lxc-create -t download -n c1 -- -d ubuntu -r trusty -a amd64
E aqui está o resultado, de novo e de novo:
...
Unpacking the rootfs
sudo: /etc/sudo.conf is owned by uid 65534, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
sudo: /etc/sudo.conf is owned by uid 65534, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
---
You just created an Ubuntu container (release=trusty, arch=amd64, variant=default)
To enable sshd, run: apt-get install openssh-server
For security reason, container images ship without user accounts
and without a root password.
Use lxc-attach or chroot directly into the rootfs to set a root password
or create user accounts.
sudo: /etc/sudo.conf is owned by uid 65534, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
O que estou fazendo de errado?
Em um primeiro lugar, eu pensei que o systemD estava com falha e instalei a libpam-systemd como uma solução. Mas finalmente não foi isso: '(E eu estou preso