Answer the question
In order to leave comments, you need to log in
How to make automatic LXC authorization?
Hello. I have a host with several LXC containers. The host has an LXC container cont3, and the user vasya.
The user vasya connects to the host via SSH.
How to make it automatically hit the console of the cont3 container?
Those. something like automatic lxc-attach orlxc exec cont3 -- bash
Answer the question
In order to leave comments, you need to log in
Send him port 22 from the container to the world. Let him go straight to the container. There is nothing for him to do in the root system.
Write the following to the user vasya in the home directory in the .bashrc file at the end of the file:
sudo lxc-attach -n cont3
After ssh login, he will be prompted for the sudo password and after entering the password he will go to cont3.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question