[file permission] explicitly set file permission on passwd, group, shadow (#3652)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
This commit is contained in:
parent
a0fbeeaca5
commit
9fb1860425
@ -282,6 +282,13 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
|
||||
mcelog
|
||||
fi
|
||||
|
||||
## Set /etc/shadow permissions to -rw-------.
|
||||
sudo LANG=c chroot $FILESYSTEM_ROOT chmod 600 /etc/shadow
|
||||
|
||||
## Set /etc/passwd, /etc/group permissions to -rw-r--r--.
|
||||
sudo LANG=c chroot $FILESYSTEM_ROOT chmod 644 /etc/passwd
|
||||
sudo LANG=c chroot $FILESYSTEM_ROOT chmod 644 /etc/group
|
||||
|
||||
#Adds a locale to a debian system in non-interactive mode
|
||||
sudo sed -i '/^#.* en_US.* /s/^#//' $FILESYSTEM_ROOT/etc/locale.gen && \
|
||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT locale-gen "en_US.UTF-8"
|
||||
|
Loading…
Reference in New Issue
Block a user