I noticed that the username/password I use to connect to a newly created LXC container via lxc-console doesn't work with ssh (with sshd running in the container). When I try, I get Permission denied Why is that, and how can I make it work?
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
|
inside container, open /etc/ssh/sshd_config and change PermitRootLogin to yes.
|
|||
|
|
|
Do you allow passwords for SSH? Do you have an iptables rule for port forwarding from your host to the LXC container IP address? You can add one with the following line (change port to your container's ssh port):
|
|||
|
|
|
A newly created LXC container using the ubuntu-cloud template comes with the SSH daemon configured to not allow passwords: To fix this, attach to your container and edit the /etc/ssh/sshd_config file. Look for the following:
And change PasswordAuthentication to "yes" and restart SSH:
Then you should be able to log in to your container with a password. |
|||
|
|