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

serge at hallyn.com serge at hallyn.com
Sun Jun 19 21:03:05 UTC 2016


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 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