2024-06-26 01:24:45 -04:00
#!/bin/sh
2024-04-18 11:31:52 -04:00
# Copyright (C) 2021-2024 Thien Tran
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#Please note that this is how I PERSONALLY setup my computer - I do some stuff such as not using anything to download GNOME extensions from extensions.gnome.org and installing the extensions as a package instead
2024-07-20 21:23:38 -04:00
set -eu
2024-07-02 19:48:15 -04:00
2024-04-18 11:31:52 -04:00
output( ) {
2024-06-26 01:24:45 -04:00
printf '\e[1;34m%-6s\e[m\n' " ${ @ } "
2024-04-18 11:31:52 -04:00
}
unpriv( ) {
sudo -u nobody " $@ "
}
2024-05-29 17:52:09 -04:00
virtualization = $( systemd-detect-virt)
2024-04-28 16:41:30 -04:00
2024-04-18 11:31:52 -04:00
# Increase compression level
2024-05-31 00:57:03 -04:00
sudo sed -i 's/zstd:1/zstd/g' /etc/fstab
2024-04-18 11:31:52 -04:00
# Compliance
sudo systemctl mask debug-shell.service
sudo systemctl mask kdump.service
# Setting umask to 077
umask 077
2024-05-29 15:27:45 -04:00
sudo sed -i 's/^UMASK.*/UMASK 077/g' /etc/login.defs
sudo sed -i 's/^HOME_MODE/#HOME_MODE/g' /etc/login.defs
2024-04-18 11:31:52 -04:00
sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc
# Make home directory private
sudo chmod 700 /home/*
# Setup NTS
2024-05-29 17:52:09 -04:00
if [ " ${ virtualization } " = 'parallels' ] ; then
2024-04-28 16:41:30 -04:00
sudo dnf -y remove chrony
else
sudo rm -rf /etc/chrony.conf
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/chrony.conf | sudo tee /etc/chrony.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/chrony.conf
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/sysconfig/chronyd | sudo tee /etc/sysconfig/chronyd > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/sysconfig/chronyd
2024-04-28 16:41:30 -04:00
sudo systemctl restart chronyd
fi
2024-04-18 11:31:52 -04:00
# Remove nullok
sudo /usr/bin/sed -i 's/\s+nullok//g' /etc/pam.d/system-auth
# Harden SSH
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/ssh/ssh_config.d/10-custom.conf | sudo tee /etc/ssh/ssh_config.d/10-custom.conf > /dev/null
2024-04-18 11:31:52 -04:00
sudo chmod 644 /etc/ssh/ssh_config.d/10-custom.conf
# Security kernel settings
2024-06-04 07:23:30 -04:00
if [ " ${ virtualization } " = 'parallels' ] ; then
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Kernel-Module-Blacklist/main/etc/modprobe.d/workstation-blacklist.conf | sudo tee /etc/modprobe.d/workstation-blacklist.conf > /dev/null
2024-06-04 07:23:30 -04:00
else
2024-07-26 07:59:01 -04:00
unpriv curl -s https://raw.githubusercontent.com/secureblue/secureblue/live/files/system/usr/etc/modprobe.d/blacklist.conf | sudo tee /etc/modprobe.d/workstation-blacklist.conf > /dev/null
2024-06-04 07:23:30 -04:00
fi
sudo chmod 644 /etc/modprobe.d/workstation-blacklist.conf
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/sysctl.d/99-workstation.conf | sudo tee /etc/sysctl.d/99-workstation.conf > /dev/null
2024-06-04 07:23:30 -04:00
sudo chmod 644 /etc/sysctl.d/99-workstation.conf
2024-04-18 11:31:52 -04:00
sudo dracut -f
sudo sysctl -p
2024-04-18 13:11:05 -04:00
2024-05-20 10:07:44 -04:00
if sudo bootctl status | grep -q systemd-boot; then
2024-05-29 17:52:09 -04:00
if [ " ${ virtualization } " = 'parallels' ] ; then
2024-05-27 13:40:07 -04:00
sudo sed -i 's/quiet root/quiet mitigations=auto,nosmt spectre_v2=on spectre_bhi=on spec_store_bypass_disable=on tsx=off kvm.nx_huge_pages=force nosmt=force l1d_flush=on spec_rstack_overflow=safe-ret gather_data_sampling=force reg_file_data_sampling=on random.trust_bootloader=off random.trust_cpu=off intel_iommu=on amd_iommu=force_isolation efi=disable_early_pci_dma iommu=force iommu.passthrough=0 iommu.strict=1 slab_nomerge init_on_alloc=1 init_on_free=1 pti=on vsyscall=none ia32_emulation=0 page_alloc.shuffle=1 randomize_kstack_offset=on debugfs=off root/g' /etc/kernel/cmdline
2024-04-23 17:59:58 -04:00
else
2024-05-27 13:40:07 -04:00
sudo sed -i 's/quiet root/quiet mitigations=auto,nosmt spectre_v2=on spectre_bhi=on spec_store_bypass_disable=on tsx=off kvm.nx_huge_pages=force nosmt=force l1d_flush=on spec_rstack_overflow=safe-ret gather_data_sampling=force reg_file_data_sampling=on random.trust_bootloader=off random.trust_cpu=off intel_iommu=on amd_iommu=force_isolation efi=disable_early_pci_dma iommu=force iommu.passthrough=0 iommu.strict=1 slab_nomerge init_on_alloc=1 init_on_free=1 pti=on vsyscall=none ia32_emulation=0 page_alloc.shuffle=1 randomize_kstack_offset=on debugfs=off lockdown=confidentiality module.sig_enforce=1 root/g' /etc/kernel/cmdline
2024-04-23 17:59:58 -04:00
fi
2024-05-27 13:40:07 -04:00
sudo dnf reinstall -y kernel-core
2024-04-18 13:11:05 -04:00
else
2024-05-29 17:52:09 -04:00
if [ " ${ virtualization } " = 'parallels' ] ; then
2024-05-27 13:22:47 -04:00
sudo grubby --update-kernel= ALL --args= 'mitigations=auto,nosmt spectre_v2=on spectre_bhi=on spec_store_bypass_disable=on tsx=off kvm.nx_huge_pages=force nosmt=force l1d_flush=on spec_rstack_overflow=safe-ret gather_data_sampling=force reg_file_data_sampling=on random.trust_bootloader=off random.trust_cpu=off intel_iommu=on amd_iommu=force_isolation efi=disable_early_pci_dma iommu=force iommu.passthrough=0 iommu.strict=1 slab_nomerge init_on_alloc=1 init_on_free=1 pti=on vsyscall=none ia32_emulation=0 page_alloc.shuffle=1 randomize_kstack_offset=on debugfs=off'
2024-04-23 17:59:58 -04:00
else
2024-05-27 13:22:47 -04:00
sudo grubby --update-kernel= ALL --args= 'mitigations=auto,nosmt spectre_v2=on spectre_bhi=on spec_store_bypass_disable=on tsx=off kvm.nx_huge_pages=force nosmt=force l1d_flush=on spec_rstack_overflow=safe-ret gather_data_sampling=force reg_file_data_sampling=on random.trust_bootloader=off random.trust_cpu=off intel_iommu=on amd_iommu=force_isolation efi=disable_early_pci_dma iommu=force iommu.passthrough=0 iommu.strict=1 slab_nomerge init_on_alloc=1 init_on_free=1 pti=on vsyscall=none ia32_emulation=0 page_alloc.shuffle=1 randomize_kstack_offset=on debugfs=off lockdown=confidentiality module.sig_enforce=1'
2024-04-23 17:59:58 -04:00
fi
2024-04-18 13:11:05 -04:00
fi
2024-04-18 11:31:52 -04:00
# Disable coredump
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/security/limits.d/30-disable-coredump.conf | sudo tee /etc/security/limits.d/30-disable-coredump.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/security/limits.d/30-disable-coredump.conf
2024-06-04 17:29:50 -04:00
sudo mkdir -p /etc/systemd/coredump.conf.d
2024-06-06 00:42:12 -04:00
sudo chmod 755 /etc/systemd/coredump.conf.d
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/coredump.conf.d/disable.conf | sudo tee /etc/systemd/coredump.conf.d/disable.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/systemd/coredump.conf.d/disable.conf
2024-04-18 11:31:52 -04:00
# Disable XWayland
sudo mkdir -p /etc/systemd/user/org.gnome.Shell@wayland.service.d
2024-06-06 00:42:12 -04:00
sudo chmod 755 /etc/systemd/user/org.gnome.Shell@wayland.service.d
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/user/org.gnome.Shell%40wayland.service.d/override.conf | sudo tee /etc/systemd/user/org.gnome.Shell@wayland.service.d/override.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/systemd/user/org.gnome.Shell@wayland.service.d/override.conf
2024-04-18 11:31:52 -04:00
# Setup dconf
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/adw-gtk3-dark | sudo tee /etc/dconf/db/local.d/adw-gtk3-dark > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/automount-disable | sudo tee /etc/dconf/db/local.d/automount-disable > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/button-layout | sudo tee /etc/dconf/db/local.d/button-layout > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/prefer-dark | sudo tee /etc/dconf/db/local.d/prefer-dark > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/privacy | sudo tee /etc/dconf/db/local.d/privacy > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/touchpad | sudo tee /etc/dconf/db/local.d/touchpad > /dev/null
2024-06-06 01:18:53 -04:00
sudo chmod 644 /etc/dconf/db/local.d/*
2024-06-06 00:42:12 -04:00
mkdir -p /etc/dconf/db/local.d/locks
sudo chmod 755 /etc/dconf/db/local.d/locks
2024-04-18 11:31:52 -04:00
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/locks/automount-disable | sudo tee /etc/dconf/db/local.d/locks/automount-disable > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/locks/privacy | sudo tee /etc/dconf/db/local.d/locks/privacy > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/dconf/db/local.d/locks/*
umask 022
2024-04-18 11:31:52 -04:00
sudo dconf update
umask 077
# Setup ZRAM
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/zram-generator.conf | sudo tee /etc/systemd/zram-generator.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/systemd/zram-generator.conf
2024-04-18 11:31:52 -04:00
2024-04-28 16:17:59 -04:00
# Setup DNF
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dnf/dnf.conf | sudo tee /etc/dnf/dnf.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/dnf/dnf.conf
2024-04-18 11:31:52 -04:00
sudo sed -i 's/^metalink=.*/&\&protocol=https/g' /etc/yum.repos.d/*
2024-07-05 17:30:46 -04:00
# Remove unwanted groups
sudo dnf -y group remove 'Container Management' 'Desktop accessibility' 'Firefox Web Browser' 'Guest Desktop Agents' 'LibreOffice' 'Printing Support'
2024-04-18 11:31:52 -04:00
# Remove firefox packages
sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem
# Remove Network + hardware tools packages
2024-05-21 22:26:42 -04:00
sudo dnf -y remove avahi cifs* '*cups' dmidecode dnsmasq geolite2* mtr net-snmp-libs net-tools nfs-utils nmap-ncat nmap-ncat opensc openssh-server rsync rygel sgpio tcpdump teamd traceroute usb_modeswitch
2024-04-18 11:31:52 -04:00
2024-04-29 00:21:30 -04:00
# Remove support for some languages and spelling
2024-05-21 22:26:42 -04:00
sudo dnf -y remove '*anthy*' '*hangul*' ibus-typing-booster '*m17n*' '*pinyin*' '*speech*' texlive-libs words '*zhuyin*'
2024-04-18 11:31:52 -04:00
2024-04-29 00:21:30 -04:00
# Remove codec + image + printers
2024-04-18 11:31:52 -04:00
sudo dnf -y remove openh264 ImageMagick* sane* simple-scan
2024-04-29 00:21:30 -04:00
# Remove Active Directory + Sysadmin + reporting tools
2024-04-18 11:31:52 -04:00
sudo dnf -y remove 'sssd*' realmd cyrus-sasl-gssapi quota* dos2unix kpartx sos samba-client gvfs-smb
2024-04-29 00:21:30 -04:00
# Remove vm and virtual stuff
2024-04-18 11:31:52 -04:00
sudo dnf -y remove 'podman*' '*libvirt*' 'open-vm*' qemu-guest-agent 'hyperv*' spice-vdagent virtualbox-guest-additions vino xorg-x11-drv-vmware xorg-x11-drv-amdgpu
2024-04-29 00:21:30 -04:00
# Remove NetworkManager
2024-04-18 11:31:52 -04:00
sudo dnf -y remove NetworkManager-pptp-gnome NetworkManager-ssh-gnome NetworkManager-openconnect-gnome NetworkManager-openvpn-gnome NetworkManager-vpnc-gnome ppp* ModemManager
2024-04-29 00:21:30 -04:00
# Remove Gnome apps
2024-05-22 02:16:23 -04:00
sudo dnf remove -y baobab chrome-gnome-shell eog gnome-boxes gnome-calculator gnome-calendar gnome-characters gnome-classic* gnome-clocks gnome-color-manager gnome-connections \
gnome-contacts gnome-disk-utility gnome-font-viewer gnome-logs gnome-maps gnome-photos gnome-remote-desktop gnome-screenshot gnome-shell-extension-apps-menu \
gnome-shell-extension-background-logo gnome-shell-extension-launch-new-instance gnome-shell-extension-places-menu gnome-shell-extension-window-list gnome-text-editor \
gnome-themes-extra gnome-tour gnome-user* gnome-weather loupe snapshot totem
2024-04-18 11:31:52 -04:00
2024-04-29 00:21:30 -04:00
# Remove apps
2024-06-05 19:24:37 -04:00
sudo dnf remove -y abrt* cheese evince file-roller* libreoffice* mediawriter rhythmbox yelp
2024-04-18 11:31:52 -04:00
2024-04-29 00:21:30 -04:00
# Remove other packages
2024-04-18 11:31:52 -04:00
sudo dnf remove -y lvm2 rng-tools thermald '*perl*' yajl
# Disable openh264 repo
sudo dnf config-manager --set-disabled fedora-cisco-openh264
# Update packages
sudo dnf -y upgrade
2024-06-04 07:23:30 -04:00
# Install hardened_malloc
sudo dnf copr enable secureblue/hardened_malloc -y
sudo dnf install -y hardened_malloc
2024-06-07 00:58:28 -04:00
echo 'libhardened_malloc.so' | sudo tee /etc/ld.so.preload
2024-06-07 00:59:38 -04:00
sudo chmod 644 /etc/ld.so.preload
2024-06-04 07:23:30 -04:00
2024-04-18 11:31:52 -04:00
# Install packages that I use
2024-04-23 18:08:27 -04:00
sudo dnf -y install adw-gtk3-theme gnome-console gnome-shell-extension-appindicator gnome-shell-extension-blur-my-shell gnome-shell-extension-background-logo
2024-04-18 11:31:52 -04:00
2024-05-29 17:52:09 -04:00
# Install appropriate virtualization drivers
if [ " $virtualization " = 'kvm' ] ; then
sudo dnf install -y qemu-guest-agent spice-vdagent
fi
2024-04-18 11:31:52 -04:00
# Setup Flatpak
2024-04-23 17:29:57 -04:00
sudo flatpak override --system --nosocket= x11 --nosocket= fallback-x11 --nosocket= pulseaudio --nosocket= session-bus --nosocket= system-bus --unshare= network --unshare= ipc --nofilesystem= host:reset --nodevice= input --nodevice= shm --nodevice= all --no-talk-name= org.freedesktop.Flatpak --no-talk-name= org.freedesktop.systemd1 --no-talk-name= ca.desrt.dconf --no-talk-name= org.gnome.Shell.Extensions
flatpak override --user --nosocket= x11 --nosocket= fallback-x11 --nosocket= pulseaudio --nosocket= session-bus --nosocket= system-bus --unshare= network --unshare= ipc --nofilesystem= host:reset --nodevice= input --nodevice= shm --nodevice= all --no-talk-name= org.freedesktop.Flatpak --no-talk-name= org.freedesktop.systemd1 --no-talk-name= ca.desrt.dconf --no-talk-name= org.gnome.Shell.Extensions
2024-04-18 11:31:52 -04:00
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak --user install org.gnome.Extensions com.github.tchx84.Flatseal org.gnome.Loupe -y
flatpak --user override com.github.tchx84.Flatseal --filesystem= /var/lib/flatpak/app:ro --filesystem= xdg-data/flatpak/app:ro --filesystem= xdg-data/flatpak/overrides:create
flatpak --user override org.gnome.Extensions --talk-name= org.gnome.Shell.Extensions
flatpak update -y
# Install Microsoft Edge if x86_64
MACHINE_TYPE = $( uname -m)
2024-06-26 01:24:45 -04:00
if [ " ${ MACHINE_TYPE } " = 'x86_64' ] ; then
2024-04-18 11:31:52 -04:00
output 'x86_64 machine, installing Microsoft Edge.'
echo ' [ microsoft-edge]
name = microsoft-edge
baseurl = https://packages.microsoft.com/yumrepos/edge/
enabled = 1
gpgcheck = 1
gpgkey = https://packages.microsoft.com/keys/microsoft.asc' | sudo tee /etc/yum.repos.d/microsoft-edge.repo
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/yum.repos.d/microsoft-edge.repo
2024-04-18 11:31:52 -04:00
sudo dnf install -y microsoft-edge-stable
sudo mkdir -p /etc/opt/edge/policies/managed/ /etc/opt/edge/policies/recommended/
2024-06-09 23:37:50 -04:00
sudo chmod -R 755 /etc/opt
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Microsoft-Edge-Policies/main/Linux/managed.json | sudo tee /etc/opt/edge/policies/managed/managed.json > /dev/null
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Microsoft-Edge-Policies/main/Linux/recommended.json | sudo tee /etc/opt/edge/policies/recommended/recommended.json > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/opt/edge/policies/managed/managed.json /etc/opt/edge/policies/recommended/recommended.json
2024-04-18 11:31:52 -04:00
sudo mkdir -p /usr/local/share/applications
2024-06-06 01:18:53 -04:00
sudo chmod 755 /usr/local/share/applications
2024-04-18 18:31:31 -04:00
sed 's/^Exec=\/usr\/bin\/microsoft-edge-stable/& --ozone-platform=wayland --start-maximized/g' /usr/share/applications/microsoft-edge.desktop | sudo tee /usr/local/share/applications/microsoft-edge.desktop
2024-06-06 00:42:12 -04:00
sudo chmod 644 /usr/local/share/applications/microsoft-edge.desktop
2024-04-18 11:31:52 -04:00
fi
2024-05-17 05:49:31 -04:00
# Enable auto TRIM
sudo systemctl enable fstrim.timer
2024-04-18 11:31:52 -04:00
### Differentiating bare metal and virtual installs
2024-06-09 08:34:13 -04:00
# Setup fwupd
echo 'UriSchemes=file;https' | sudo tee -a /etc/fwupd/fwupd.conf
sudo systemctl restart fwupd
2024-04-18 11:31:52 -04:00
# Setup tuned
2024-05-29 17:52:09 -04:00
if [ " $virtualization " = 'none' ] ; then
output "Bare Metal installation. Tuned will not be set up here - PPD should take care of it."
2024-04-18 11:31:52 -04:00
else
2024-05-29 17:53:50 -04:00
sudo dnf remove -y power-profiles-daemon
2024-05-29 17:52:09 -04:00
sudo dnf install -y tuned
sudo systemctl enable --now tuned
2024-04-18 11:31:52 -04:00
sudo tuned-adm profile virtual-guest
fi
2024-05-29 20:48:45 -04:00
# Setup networking
2024-07-26 07:59:01 -04:00
sudo systemctl enable --now firewalld
2024-04-28 14:47:36 -04:00
sudo firewall-cmd --set-default-zone= block
sudo firewall-cmd --permanent --add-service= dhcpv6-client
sudo firewall-cmd --reload
sudo firewall-cmd --lockdown-on
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/NetworkManager/conf.d/00-macrandomize.conf | sudo tee /etc/NetworkManager/conf.d/00-macrandomize.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/NetworkManager/conf.d/00-macrandomize.conf
2024-07-03 05:23:28 -04:00
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/NetworkManager/conf.d/01-transient-hostname.conf | sudo tee /etc/NetworkManager/conf.d/01-transient-hostname.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/NetworkManager/conf.d/01-transient-hostname.conf
2024-04-28 14:47:36 -04:00
sudo nmcli general reload conf
sudo hostnamectl hostname 'localhost'
sudo hostnamectl --transient hostname ''
sudo mkdir -p /etc/systemd/system/NetworkManager.service.d
2024-07-03 05:23:28 -04:00
unpriv curl -s https://gitlab.com/divested/brace/-/raw/master/brace/usr/lib/systemd/system/NetworkManager.service.d/99-brace.conf | sudo tee /etc/systemd/system/NetworkManager.service.d/99-brace.conf > /dev/null
2024-06-06 00:42:12 -04:00
sudo chmod 644 /etc/systemd/system/NetworkManager.service.d/99-brace.conf
2024-04-28 14:47:36 -04:00
sudo systemctl daemon-reload
sudo systemctl restart NetworkManager
2024-07-02 18:50:44 -04:00
output 'The script is done. You can also remove gnome-terminal since gnome-console will replace it.'