mirror of
https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
synced 2025-06-03 06:30:16 +00:00
Specify uid when creating the user via useradd
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.
This commit is contained in:
parent
dba98d948b
commit
b818c44cbd
@ -122,7 +122,7 @@ RunWrappedScript()
|
||||
|
||||
# Allow normal user to sudo without a password. We may need to add the
|
||||
# normal user, as it probably isn't created by debootstrap
|
||||
$schroot -u root -- useradd -m $USER || :
|
||||
$schroot -u root -- useradd -m $USER -u $(id -u) || :
|
||||
$schroot -u root -- \
|
||||
/bin/sh -c "echo '$USER ALL=(ALL) NOPASSWD:ALL'>/etc/sudoers.d/nopasswd-$USER"
|
||||
$schroot -u root -- chmod 400 /etc/sudoers.d/nopasswd-$USER
|
||||
|
Loading…
Reference in New Issue
Block a user