mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-26 21:39:26 -05:00
avoiding /etc/passwd
This commit is contained in:
parent
b5ba03247a
commit
88f396264c
@ -34,7 +34,7 @@
|
|||||||
home_folder_access_rights_lockdown() {
|
home_folder_access_rights_lockdown() {
|
||||||
# Each users home directory to himself
|
# Each users home directory to himself
|
||||||
for user in $(dir /home); do # lists directories only
|
for user in $(dir /home); do # lists directories only
|
||||||
if [ grep --quiet "$user" /etc/passwd ]; then # check if user actually exists, and this is not some random directory
|
if [ $(id --user $user) ]; then # check if user actually exists, and this is not some random directory
|
||||||
dpkg-statoverride --add --update $user $user 0700 /home/$user # home directory of the user itself
|
dpkg-statoverride --add --update $user $user 0700 /home/$user # home directory of the user itself
|
||||||
echo "Permission updated: chmod go-rwx /home/$user"
|
echo "Permission updated: chmod go-rwx /home/$user"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user