Skip to content

Commit d0345a6

Browse files
authored
Fix priviledge for passwd (#75)
Signed-off-by: fxiang1 <[email protected]>
1 parent 7692baa commit d0345a6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build/bin/user_setup

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
set -x
33

44
# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
5-
mkdir -p ${HOME}
6-
chown ${USER_UID}:0 ${HOME}
7-
chmod ug+rwx ${HOME}
8-
9-
# runtime user will need to be able to self-insert in /etc/passwd
10-
chmod g+rw /etc/passwd
5+
echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd
6+
mkdir -p "${HOME}"
7+
chown "${USER_UID}:0" "${HOME}"
8+
chmod ug+rwx "${HOME}"
119

1210
# no need for this script to remain in the image after running
1311
rm $0

0 commit comments

Comments
 (0)