mirror of
https://github.com/kuhyx/scripts.git
synced 2026-07-04 14:23:08 +02:00
fix: etc hosts permissions
This commit is contained in:
parent
b94a0dc310
commit
325fd27580
@ -10,8 +10,8 @@ sudo chattr -i -a /etc/hosts 2>/dev/null || true
|
|||||||
echo "Downloading hosts file from StevenBlack repository..."
|
echo "Downloading hosts file from StevenBlack repository..."
|
||||||
sudo curl -o /etc/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
|
sudo curl -o /etc/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
|
||||||
|
|
||||||
# Set restrictive permissions (read-only for owner, no access for group/others)
|
# Set proper permissions (readable by all, writable only by root)
|
||||||
sudo chmod 600 /etc/hosts
|
sudo chmod 644 /etc/hosts
|
||||||
|
|
||||||
# Make the file immutable (prevents deletion, renaming, and most modifications)
|
# Make the file immutable (prevents deletion, renaming, and most modifications)
|
||||||
sudo chattr +i /etc/hosts
|
sudo chattr +i /etc/hosts
|
||||||
@ -22,4 +22,5 @@ sudo chattr -i /etc/hosts
|
|||||||
sudo chattr +a /etc/hosts
|
sudo chattr +a /etc/hosts
|
||||||
|
|
||||||
# Flush DNS caches
|
# Flush DNS caches
|
||||||
sudo systemd-resolve --flush-caches
|
sudo systemd-resolve --flush-caches
|
||||||
|
sudo systemctl restart NetworkManager.service
|
||||||
Loading…
Reference in New Issue
Block a user