1
0
mirror of https://github.com/tommytran732/Linux-Setup-Scripts synced 2024-11-09 11:41:33 -05:00

Better umask handling

Signed-off-by: Tommy <contact@tommytran.io>
This commit is contained in:
Tommy 2024-05-29 12:27:45 -07:00
parent 2d8eb5f31d
commit 1cca00f237
Signed by: Tomster
GPG Key ID: 555C902A34EC968F
4 changed files with 15 additions and 3 deletions

View File

@ -33,8 +33,10 @@ sudo systemctl mask kdump.service
# Setting umask to 077 # Setting umask to 077
umask 077 umask 077
sudo sed -i 's/^UMASK.*/UMASK 077/g' /etc/login.defs
sudo sed -i 's/^HOME_MODE/#HOME_MODE/g' /etc/login.defs
sudo sed -i 's/^USERGROUPS_ENAB.*/USERGROUPS_ENAB no/g' /etc/login.defs
sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc
echo 'umask 077' | sudo tee -a /etc/bashrc
# Make home directory private # Make home directory private
sudo chmod 700 /home/* sudo chmod 700 /home/*

View File

@ -50,8 +50,10 @@ sudo systemctl mask kdump.service
# Setting umask to 077 # Setting umask to 077
umask 077 umask 077
sudo sed -i 's/^UMASK.*/UMASK 077/g' /etc/login.defs
sudo sed -i 's/^HOME_MODE/#HOME_MODE/g' /etc/login.defs
sudo sed -i 's/^USERGROUPS_ENAB.*/USERGROUPS_ENAB no/g' /etc/login.defs
sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc
echo 'umask 077' | sudo tee -a /etc/bashrc
# Make home directory private # Make home directory private
sudo chmod 700 /home/* sudo chmod 700 /home/*

View File

@ -49,7 +49,9 @@ sudo chmod 700 /home/*
# Setting umask to 077 # Setting umask to 077
umask 077 umask 077
echo 'umask 077' | sudo tee -a /etc/bash.bashrc sudo sed -i 's/^UMASK.*/UMASK 077/g' /etc/login.defs
sudo sed -i 's/^HOME_MODE/#HOME_MODE/g' /etc/login.defs
sudo sed -i 's/^USERGROUPS_ENAB.*/USERGROUPS_ENAB no/g' /etc/login.defs
# Setup NTS # Setup NTS
sudo systemctl disable --now systemd-timesyncd sudo systemctl disable --now systemd-timesyncd

View File

@ -32,6 +32,12 @@ echo 'Authorized uses only. All activity may be monitored and reported.' | sudo
# Make home directory private # Make home directory private
sudo chmod 700 /home/* sudo chmod 700 /home/*
# Setting umask to 077
umask 077
sudo sed -i 's/^UMASK.*/UMASK 077/g' /etc/login.defs
sudo sed -i 's/^HOME_MODE/#HOME_MODE/g' /etc/login.defs
sudo sed -i 's/^USERGROUPS_ENAB.*/USERGROUPS_ENAB no/g' /etc/login.defs
# Setup NTS # Setup NTS
sudo systemctl disable --now systemd-timesyncd sudo systemctl disable --now systemd-timesyncd
sudo systemctl mask systemd-timesyncd sudo systemctl mask systemd-timesyncd