LXC : login failed

Can’t login any LXC containers, even though enter correct password.

# create new container
$ lxc-create -n ubuntu-test -t download -- --dist ubuntu --release focal --arch amd64
# start the container
$ lxc-start -n ubuntu-test
# connnet to the console, but can't login
$ lxc-console -n ubuntu-test
ubuntu-test login: ubuntu
Password: 

Login incorrect

I have to set password by attach the console directly.

$ lxc-attach -n ubuntu-test
# in the container console, set ubuntu user password
$ passwd ubuntu
# then login from console again
$ lxc-console -n ubuntu-test
ubuntu-test login: ubuntu
Password: 
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.12.5-arch1-1 x86_64)
 

https://wiki.archlinux.org/title/Linux_Containers#Root_login_fails

Leave a Reply

Your email address will not be published. Required fields are marked *