What is the default username/password of LXC instances (Ubuntu) deployed by Juju via MAAS?

Andrew Wilkins andrew.wilkins at canonical.com
Sun Sep 20 01:47:34 UTC 2015


On Sun, Sep 20, 2015 at 12:17 AM Jeff McLamb <mclamb at gmail.com> wrote:

> Hi all -
>
> I am currently in a situation where my juju deployment host and MAAS host
> (thus DHCP/DNS) are down and I won’t be able to power them back on for a
> few days.
>
> I have manually added entries to /etc/hosts on all of my bare metal
> machines (so that OpenStack services can resolve names absent the DNS
> server) but I cannot login to my LXC instances in order to modify
> /etc/hosts.
>
> For whatever reason the keys aren’t in place to directly ssh into each LXC
> instance from my bare-metal machines. The only option I have is to
> lxc-console directly into each instance, where I am presented with a login
> prompt.
>

You can use "lxc-attach" command to run arbitrary processes within the
container, without the need for a login.

Is there a default user/pass for these Ubuntu LXC instances deployed by
> juju (via MAAS?) or some way to inject a file (e.g. replace/mod /etc/hosts)
> into the container?
>
> It appears as though I could just modify
> /var/lib/lxc/<container>/rootfs/etc/hosts directly, but that seems like it
> might cause consistency issues? Or maybe doing that followed by an
> `lxc-stop —name <container> -r` will reboot the container and it will Just
> Work?
>

AFAIK editing the file via the rootfs path is fine, and you only need to
restart the container if some application is caching the host resolution.

FYI the LXC container, if provisioned by Juju, should have the public SSH
keys of the user who bootstrapped. So you should be able to ssh to the LXC
container from your client machine if you can ssh to the MAAS node.

I'm not sure what versions of the juju CLI this is true for (definitely the
most recent), but for a while now "juju ssh" will accept an IP address or
hostname, and and attempt to ssh to it using a Juju server as a proxy. i.e.:
    juju ssh 10.x.y.z
will do something like
    ssh -o ProxyCommand="juju ssh 0" 10.x.y.z

HTH,
Andrew

Thanks,
>
> Jeff
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20150920/bde1e7a0/attachment.html>


More information about the Juju mailing list