[lxc-devel] [PATCH 1/3] lxc-debian: define a password for root

Laurent Vivier laurent at vivier.eu
Mon Jun 20 20:59:41 UTC 2016



Le 19/06/2016 à 23:03, serge at hallyn.com a écrit :
> Hi,
> 
> are you saying that you cannot lxc-attach to set the root pwd
> anymore, or that that does not suffice?  Since sshd is not installed

You're right: this patch is not needed, the password can be empty and
lxc-attach allows to set it afterwards.

Thanks,
Laurent


> by default there's little reason to support setting a root ssh key,
> but a template creation flag to specify a root pwd sha256sum seems
> like the simplest solution.On 6/18/16 8:13 Laurent Vivier wrote:
> 
> 
> Le 17/06/2016 à 16:52, serge at hallyn.com (Serge E. Hallyn) a écrit
> :
>> Quoting Laurent Vivier (laurent at vivier.eu):
>>> Signed-off-by: Laurent Vivier <laurent at vivier.eu>
>> 
>> Sorry but isn't this a regression?  How about making this subject
>> to a --default-password argument or something?
> 
> Oh, yes... I've found:
> 
> 515fb8d do not set the root password in the debian template
> 
> https://github.com/lxc/lxc/issues/302
> 
>> I think Michael said he might be around right now, and at one
>> point he was trying to standardize this across templates, so maybe
>> he wants to comment (cc:d)
> 
> With old version of debian, you can have a root with no password: so
> at login you just type "root" , no password is asked and you are
> logged in.
> 
> With the last versions of debian, this doesn't work: you can't login 
> without having defined a password.
> 
> I think it is not worst than having a sudoer "ubuntu" with password 
> "ubuntu"...
> 
> I'm open to any other proposition allowing to login into the
> container.
> 
> Thanks, Laurent
> 
>>> --- templates/lxc-debian.in | 4 ++++ 1 file changed, 4
>>> insertions(+)
>>> 
>>> diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in 
>>> index 56953b6..5dc4e0b 100644 --- a/templates/lxc-debian.in +++
>>> b/templates/lxc-debian.in @@ -163,6 +163,10 @@ EOF echo "Timezone
>>> in container is not configured. Adjust it manually." fi
>>> 
>>> +    echo "root:root" | chroot $rootfs chpasswd +    chroot
>>> $rootfs passwd -e root +    echo "Root password is 'root', please
>>> change !" + return 0 }
>>> 
>>> -- 2.5.5
>>> 
>>> _______________________________________________ lxc-devel mailing
>>> list lxc-devel at lists.linuxcontainers.org 
>>> http://lists.linuxcontainers.org/listinfo/lxc-devel
>> 
> 


More information about the lxc-devel mailing list