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

Specify uid when creating the user via useradd #126

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

oToToT
Copy link
Contributor

@oToToT oToToT commented Jan 1, 2025

On my ubuntu24.04, the user created via useradd always has uid=1000. However, the uid I observed entering chroot is the same as my own uid, which is not 1000. Therefore, tools like sudo will fail because it cannot recognize what user it is.

This commit fixes the issue by forcing the uid to be the same as the outer one when creating the user via useradd.

Note that I didn't test this commit on other platforms, so I'm not sure if it would break other platforms.

@matt335672
Copy link
Member

@oToToT

I've merged #127 to address #123

Can you rebase your PR? I'm out of time today, but I'll try to reproduce when I can.

@matt335672
Copy link
Member

I can reproduce this now, and I can see what's happening - @oToToT - nice find!

I'm happy to merge this when you rebase. At this point the CI should succeed again.

On my ubuntu24.04, the user created via useradd always has uid=1000.
However, the uid I observed entering chroot is the same as my own uid,
which is not 1000. Therefore, tools like sudo will fail because it
cannot recognize what user it is.

This commit fixes the issue by forcing the uid to be the same as the
outer one when creating the user via useradd.
@oToToT
Copy link
Contributor Author

oToToT commented Jan 3, 2025

rebased. Thanks for the fast response!

@matt335672
Copy link
Member

Thanks for your contribution @oToToT

@matt335672 matt335672 merged commit 1910e49 into neutrinolabs:devel Jan 4, 2025
3 checks passed
@oToToT oToToT deleted the ubuntu-2404 branch January 5, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants