Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to login on an Alpine 3.19 RPi #2439

Closed
Tracked by #2052
mauromorales opened this issue Apr 5, 2024 · 9 comments · Fixed by mudler/entities#17 or kairos-io/packages#962
Closed
Tracked by #2052

It's not possible to login on an Alpine 3.19 RPi #2439

mauromorales opened this issue Apr 5, 2024 · 9 comments · Fixed by mudler/entities#17 or kairos-io/packages#962
Assignees
Labels
area/alpine arm/rpi bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call

Comments

@mauromorales
Copy link
Member

Kairos version:

v3.0.4

CPU architecture, OS, and Version:

arm64 Raspberry Pi4

Describe the bug

If I try to log in, I get a message saying that the password has expired

To Reproduce

Burn an image and plug it on the rpi4, it will boot but you won't be able to log in

Expected behavior

Logs

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <https://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

WARNING: Your password has expired.
You must change your password now and login again!
passwd: must be suid to work properly

Additional context

@mauromorales mauromorales added bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call labels Apr 5, 2024
@Itxaka
Copy link
Member

Itxaka commented Apr 9, 2024

building 3.19 results in this working?

image

@mauromorales mauromorales changed the title It's not possible to login on an Alpine 3.18 RPi It's not possible to login on an Alpine 3.19 RPi Apr 9, 2024
@Itxaka
Copy link
Member

Itxaka commented Apr 9, 2024

looks like we are alwasy enabling the hwclock via dockerfile and not letting the init do it. Currently testing some changes to make it simpler.

@jimmykarily
Copy link
Contributor

Since this is not reproducible anymore, I'll close and we can re-open if there are more data.

@mauromorales
Copy link
Member Author

The issue is still there, but you need to log in via ssh

@mauromorales mauromorales reopened this Jul 11, 2024
@mauromorales
Copy link
Member Author

are these two duplicates? #1994

@Itxaka
Copy link
Member

Itxaka commented Jul 11, 2024

The issue is still there, but you need to log in via ssh

I tested this and it was working. Whats the difference between our RPI? network maybe?

Can you tell me which exact artifact you tested and from sd/usb and network cable attached/dettached?

Also login via tty1/2/serial?

@Itxaka
Copy link
Member

Itxaka commented Jul 11, 2024

Note that i installed the rpi3 one instead by mistake :D

installed via

$ docker run -ti --rm -v $PWD:/image quay.io/luet/base util unpack quay.io/kairos/alpine:3.19-standard-arm64-rpi3-v3.1.0-k3sv1.30.2-k3s1-img /image
 INFO   Downloading quay.io/kairos/alpine:3.19-standard-arm64-rpi3-v3.1.0-k3sv1.30.2-k3s1-img to /image
 INFO   Pulled: sha256:83b2ec44cd9edc9756ee50e43813ee104257bf2957f203099711b6602219f666 quay.io/kairos/alpine:3.19-standard-arm64-rpi3-v3.1.0-k3sv1.30.2-k3s1-img
 INFO   Size: 998.1MiB
$ xzcat build/kairos-alpine-3.19-standard-arm64-rpi3-v3.1.0-k3sv1.30.2+k3s1.img.xz | sudo dd of=/dev/sda oflag=sync status=progress bs=10MB 

Booted and could login, even with a broken date:
image

@Itxaka
Copy link
Member

Itxaka commented Jul 11, 2024

Even with network and starting the ntpd service (not sure why it wasnt auto started?) I can still log out and in?

image

@Itxaka
Copy link
Member

Itxaka commented Jul 12, 2024

I did not understand this correctly. Talked with @mauromorales directly, he told me that the issue is login via SSH.

Checking the /etc/passwd file makes sense as the third field is a 0. That field is how many days passed since the last password change, and the 0 value is special as it means it needs to be changed on next login.

My thinking here is that when the kairos user gets created, entities library checks to see how many days have passed since unix epoch and writes it to the file: https://github.com/mudler/entities/blob/master/pkg/entities/shadow.go#L140
As no days have passed since the unix epoch, it sets the zero value, but ignores that it has a special meaning.

2 things to do here:

  • make sure entities NEVER sets a zero value in there by default.
  • make sure we run date to a safe date ini initramfs.before so we have a decent date set in the system instead of unix epoch, before the hwclock/swclock/ntpd can trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alpine arm/rpi bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants