Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的系统上有许多 lxd 容器。我无法从网络访问它们 我没有密码
有没有办法像我们在 docker 上做的那样附加一个 bash?
在远程 LXD 上启用网络:
lxc config set core.https_address [::]:8443 lxc config set core.trust_password PASSWORD
将目标主机添加为远程(它会要求PASSWORD):
PASSWORD
lxc remote add REMOTE_NAME IP_ADDRESS
在远程系统上运行命令:
lxc exec REMOTE_NAME:CONTAINER COMMAND
在大多数情况下,要获取 shell,您可以传递bash或作为命令。sh
bash
sh
更多信息: https ://web.archive.org/web/20160818010904/https://www.stgraber.org/2016/04/12/lxd-2-0-remote-hosts-and-container-migration-612 /