feat: get user creation working for Ubuntu 23.04 containers
This commit is contained in:
parent
635d085943
commit
9734d9daaf
1 changed files with 5 additions and 1 deletions
|
@ -325,7 +325,11 @@ if [[ $_cuid -eq 1000 ]] && grep -q ubuntu /etc/passwd; then
|
|||
grep -v ubuntu /etc/group > /etc/group.tmp
|
||||
mv /etc/passwd.tmp /etc/passwd
|
||||
mv /etc/group.tmp /etc/group
|
||||
echo -e '\n'"$_uname"':x:1000\n' >> /etc/group
|
||||
fi
|
||||
if ! grep -q "^${_uname}:" /etc/group; then
|
||||
if ! groupadd --force --gid "$_cgid" "$_uname"; then
|
||||
printf "%s:x:%s:" "$_uname" "$_cgid" >> /etc/group
|
||||
fi
|
||||
fi
|
||||
useradd --uid "$_cuid" --gid "$_cgid" --shell "/bin/bash" --no-create-home --home "$_uhome" "$_uname" &>/dev/null
|
||||
|
||||
|
|
Loading…
Reference in a new issue