cirros-dev / cirros

120 stars 33 forks source link

Unable to set convenient password #61

Closed andreabolognani closed 2 years ago

andreabolognani commented 3 years ago

I use CirrOS to smoke test QEMU / libvirt after making changes, and so I don't care much if at all about security as all instances are throwaway. This appears to be perfectly in line with the project's stated goals.

Since I find the default password for the cirros user a bit difficult to type, I would like to change it into something simpler, for example the username itself. When I try to do that, however:

$ passwd
Changing password for cirros
Old password: <gocubsgo>
New password: <cirros>
Bad password: similar to username
passwd: password for cirros is unchanged

Well, okay. Let's try to work around that by using the mighty powers of root:

$ sudo passwd cirros
Changing password for cirros
New password: <cirros>
Bad password: similar to username
Retype password: <cirros>
Segmentation fault

Yes, I'm aware I could set the password to whatever I want using nocloud data, but when using QEMU / libvirt directly rather than through a higher-level management tool that's an extra annoying hoop to jump through. And, I don't think segmentation faults like the one above should happen :)

clebergnu commented 3 years ago

I can reproduce this issue starting with 0.5.0 on x86_64. CirrOS 0.4.0 does not suffer from this problem. It may be worthy to check for busybox related issues on the versions included starting on CirrOS 0.5.0.

clebergnu commented 3 years ago

According to this, it is a busybox issue indeed, and it has been fixed in Busybox 1.31.0.

The process of updating BuildRoot/busybox is not that trivial though.

andreabolognani commented 2 years ago

The process of updating BuildRoot/busybox is not that trivial though.

Luckily updating busybox is not necessary, as the upstream fix can be backported cleanly. See https://github.com/cirros-dev/cirros/pull/73.

hrw commented 2 years ago

Will be fixed with 0.6 release (due to Buildroot update):

$ passwd
Changing password for cirros
Old password:
New password:
Retype password:
passwd: password for cirros changed by cirros
hrw commented 2 years ago

0.6.0 is released