mirror of
https://github.com/tommytran732/Linux-Setup-Scripts
synced 2024-11-26 03:01:34 -05:00
Compare commits
21 Commits
9f6db69577
...
166b42d1fa
Author | SHA1 | Date | |
---|---|---|---|
166b42d1fa | |||
ed63904bb6 | |||
01d015e3bd | |||
29333a3ae0 | |||
09f2813823 | |||
289b0cd1bb | |||
0b0a7598e5 | |||
e52268730e | |||
51ac21f7c5 | |||
d84b235f16 | |||
b19562c65d | |||
0ce3e114d3 | |||
dc9496a67b | |||
8f7d1400b9 | |||
b4eba12921 | |||
9e89115f53 | |||
74b6200e90 | |||
4b5f7c70b5 | |||
f3a1dab4d4 | |||
66626ee5b4 | |||
7fb3fc18f3 |
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
@ -79,9 +79,15 @@ sudo mkdir -p /etc/systemd/system/NetworkManager.service.d
|
|||||||
unpriv curl 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
|
unpriv curl 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
|
||||||
sudo systemctl restart NetworkManager
|
sudo systemctl restart NetworkManager
|
||||||
|
|
||||||
# Disable automount
|
# Setup dconf
|
||||||
unpriv curl 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
|
unpriv curl 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
|
||||||
unpriv curl 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
|
unpriv curl 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
|
||||||
|
|
||||||
|
unpriv curl 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
|
||||||
|
unpriv curl 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
|
||||||
|
unpriv curl 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
|
||||||
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/touchpad | sudo tee /etc/dconf/db/local.d/touchpad
|
||||||
|
sudo chmod 644 /etc/dconf/db/local.d/*
|
||||||
sudo dconf update
|
sudo dconf update
|
||||||
|
|
||||||
# Setup ZRAM
|
# Setup ZRAM
|
||||||
@ -208,6 +214,3 @@ if [ "$virt_type" = '' ] || [ "${MACHINE_TYPE}" == 'x86_64' ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
output 'The script is done. You can also remove gnome-terminal since gnome-console will replace it.'
|
output 'The script is done. You can also remove gnome-terminal since gnome-console will replace it.'
|
||||||
|
|
||||||
#Enable Titlebar buttons
|
|
||||||
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#!/bin/bash
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
@ -25,5 +23,50 @@ unpriv(){
|
|||||||
sudo -u nobody "$@"
|
sudo -u nobody "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Update Kali
|
||||||
sudo apt full-upgrade -y
|
sudo apt full-upgrade -y
|
||||||
|
|
||||||
|
# Install all tools
|
||||||
sudo apt install kali-linux-everything -y
|
sudo apt install kali-linux-everything -y
|
||||||
|
|
||||||
|
# Setup UFW
|
||||||
|
sudo apt install ufw -y
|
||||||
|
sudo ufw enable
|
||||||
|
|
||||||
|
# Kernel hardening
|
||||||
|
unpriv curl https://raw.githubusercontent.com/Kicksecure/security-misc/master/etc/modprobe.d/30_security-misc.conf | sudo tee /etc/modprobe.d/30_security-misc.conf
|
||||||
|
sudo chmod 644 /etc/modprobe.d/30_security-misc.conf
|
||||||
|
unpriv curl https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/990-security-misc.conf | sudo tee /etc/sysctl.d/990-security-misc.conf
|
||||||
|
sudo chmod 644 /etc/sysctl.d/990-security-misc.conf
|
||||||
|
unpriv curl https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/30_silent-kernel-printk.conf | sudo tee /etc/sysctl.d/30_silent-kernel-printk.conf
|
||||||
|
sudo chmod 644 /etc/sysctl.d/30_silent-kernel-printk.conf
|
||||||
|
unpriv curl https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/30_security-misc_kexec-disable.conf | sudo tee /etc/sysctl.d/30_security-misc_kexec-disable.conf
|
||||||
|
sudo chmod 644 /etc/sysctl.d/30_security-misc_kexec-disable.conf
|
||||||
|
sudo sed -i 's/kernel.yama.ptrace_scope=2/kernel.yama.ptrace_scope=3/g' /etc/sysctl.d/990-security-misc.conf
|
||||||
|
sudo sysctl -p
|
||||||
|
|
||||||
|
# Installing tuned first here because virt-what is 1 of its dependencies anyways
|
||||||
|
sudo apt install tuned -y
|
||||||
|
virt_type=$(virt-what)
|
||||||
|
if [ "$virt_type" = '' ]; then
|
||||||
|
output 'Virtualization: Bare Metal.'
|
||||||
|
elif [ "$virt_type" = 'openvz lxc' ]; then
|
||||||
|
output 'Virtualization: OpenVZ 7.'
|
||||||
|
elif [ "$virt_type" = 'xen xen-hvm' ]; then
|
||||||
|
output 'Virtualization: Xen-HVM.'
|
||||||
|
elif [ "$virt_type" = 'xen xen-hvm aws' ]; then
|
||||||
|
output 'Virtualization: Xen-HVM on AWS.'
|
||||||
|
else
|
||||||
|
output "Virtualization: $virt_type."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setup tuned
|
||||||
|
if [ "$virt_type" = '' ]; then
|
||||||
|
# Don't know whether using tuned would be a good idea on a laptop, power-profiles-daemon should be handling performance tuning IMO.
|
||||||
|
sudo apt remove tuned -y
|
||||||
|
else
|
||||||
|
sudo tuned-adm profile virtual-guest
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable fstrim.timer
|
||||||
|
sudo systemctl enable --now fstrim.timer
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
@ -24,25 +24,20 @@ unpriv(){
|
|||||||
sudo -u nobody "$@"
|
sudo -u nobody "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Compliance and updates
|
# Compliance and updates
|
||||||
sudo systemctl mask debug-shell.service
|
sudo systemctl mask debug-shell.service
|
||||||
|
|
||||||
#sudo ua enable usg
|
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
sudo apt full-upgrade -y
|
sudo apt full-upgrade -y
|
||||||
#sudo apt install -y usg
|
|
||||||
sudo apt autoremove -y
|
sudo apt autoremove -y
|
||||||
#sudo usg fix cis_level2_workstation
|
|
||||||
|
# Default to gcc-12 instead of gcc-11
|
||||||
|
sudo rm /usr/bin/gcc
|
||||||
|
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc
|
||||||
|
|
||||||
# Make home directory private
|
# Make home directory private
|
||||||
sudo chmod 700 /home/*
|
sudo chmod 700 /home/*
|
||||||
|
|
||||||
# Remove AIDE
|
|
||||||
#sudo apt purge -y aide*
|
|
||||||
|
|
||||||
# Allow su which is disabled by CIS
|
|
||||||
sudo sed -i 's/auth required pam_wheel.so use_uid group=sugroup//g' /etc/pam.d/su
|
|
||||||
|
|
||||||
# Setting umask to 077
|
# Setting umask to 077
|
||||||
umask 077
|
umask 077
|
||||||
sudo sed -ie '/^DIR_MODE=/ s/=[0-9]*\+/=0700/' /etc/adduser.conf
|
sudo sed -ie '/^DIR_MODE=/ s/=[0-9]*\+/=0700/' /etc/adduser.conf
|
||||||
@ -56,6 +51,13 @@ sudo apt install -y curl chrony
|
|||||||
unpriv curl https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/chrony.conf | sudo tee /etc/chrony/chrony.conf
|
unpriv curl https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/chrony.conf | sudo tee /etc/chrony/chrony.conf
|
||||||
sudo systemctl restart chronyd
|
sudo systemctl restart chronyd
|
||||||
|
|
||||||
|
# Setup Networking
|
||||||
|
unpriv curl 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
|
||||||
|
unpriv curl 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
|
||||||
|
sudo nmcli general reload conf
|
||||||
|
sudo hostnamectl hostname 'localhost'
|
||||||
|
sudo hostnamectl --transient hostname ''
|
||||||
|
|
||||||
# Setup UFW
|
# Setup UFW
|
||||||
#UFW Snap is strictly confined, unlike its .deb counterpart
|
#UFW Snap is strictly confined, unlike its .deb counterpart
|
||||||
sudo apt purge -y ufw
|
sudo apt purge -y ufw
|
||||||
@ -88,17 +90,17 @@ unpriv curl https://gitlab.com/divested/brace/-/raw/master/brace/usr/lib/systemd
|
|||||||
sudo mkdir -p /etc/systemd/system/irqbalance.service.d
|
sudo mkdir -p /etc/systemd/system/irqbalance.service.d
|
||||||
unpriv curl https://gitlab.com/divested/brace/-/raw/master/brace/usr/lib/systemd/system/irqbalance.service.d/99-brace.conf | sudo tee /etc/systemd/system/irqbalance.service.d/99-brace.conf
|
unpriv curl https://gitlab.com/divested/brace/-/raw/master/brace/usr/lib/systemd/system/irqbalance.service.d/99-brace.conf | sudo tee /etc/systemd/system/irqbalance.service.d/99-brace.conf
|
||||||
|
|
||||||
# Disable automount
|
# Setup dconf
|
||||||
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Script/main/etc/dconf/db/local.d/automount-disable | sudo tee /etc/dconf/db/local.d/automount-disable
|
sudo mkdir -p /etc/dconf/db/local.d/locks
|
||||||
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Script/main/etc/dconf/db/local.d/locks/automount-disable | sudo tee /etc/dconf/db/local.d/locks/automount-disable
|
|
||||||
sudo dconf update
|
|
||||||
|
|
||||||
# Disable crash reports
|
unpriv curl 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
|
||||||
echo '[com/ubuntu/update-notifier]
|
unpriv curl 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
|
||||||
show-apport-crashes=false' | sudo tee /etc/dconf/db/local.d/disable-apport-crashes
|
|
||||||
|
|
||||||
echo 'com/ubuntu/update-notifier/show-apport-crashes' | sudo tee /etc/dconf/db/local.d/locks/disable-apport-crashes
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/apport-disable | sudo tee /etc/dconf/db/local.d/apport-disable
|
||||||
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/locks/apport-disable | sudo tee /etc/dconf/db/local.d/locks/apport-disable
|
||||||
|
|
||||||
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dconf/db/local.d/touchpad | sudo tee /etc/dconf/db/local.d/touchpad
|
||||||
|
sudo chmod 644 /etc/dconf/db/local.d/*
|
||||||
sudo dconf update
|
sudo dconf update
|
||||||
|
|
||||||
ubuntu-report -f send no
|
ubuntu-report -f send no
|
||||||
@ -122,20 +124,116 @@ sudo apt purge -y cups* eog gedit firefox* gnome-calculator gnome-characters* gn
|
|||||||
sudo apt autoremove -y
|
sudo apt autoremove -y
|
||||||
sudo snap remove firefox
|
sudo snap remove firefox
|
||||||
|
|
||||||
# Install packages that I use
|
sudo rm -rf /usr/share/hplip
|
||||||
sudo apt install -y git-core gnome-text-editor
|
|
||||||
sudo snap install eog
|
|
||||||
|
|
||||||
# Setup Networking
|
# Install packages that I use
|
||||||
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Script/main/etc/NetworkManager/conf.d/00-macrandomize.conf | sudo tee /etc/NetworkManager/conf.d/00-macrandomize.conf
|
sudo apt install -y gnome-console
|
||||||
unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Script/main/etc/NetworkManager/conf.d/01-transient-hostname.conf | sudo tee /etc/NetworkManager/conf.d/01-transient-hostname.conf
|
sudo snap install gnome-text-editor loupe
|
||||||
sudo nmcli general reload conf
|
|
||||||
sudo hostnamectl hostname 'localhost'
|
# Rosetta setup
|
||||||
sudo hostnamectl --transient hostname ''
|
echo '# deb cdrom:[Ubuntu 22.04.3 LTS _Jammy Jellyfish_ - Release arm64 (20240119)]/ jammy main restricted
|
||||||
|
|
||||||
|
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||||
|
# newer versions of the distribution.
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy main restricted
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy main restricted
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy main restricted
|
||||||
|
|
||||||
|
## Major bug fix updates produced after the final release of the
|
||||||
|
## distribution.
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
|
||||||
|
|
||||||
|
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||||
|
## team. Also, please note that software in universe WILL NOT receive any
|
||||||
|
## review or updates from the Ubuntu security team.
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy universe
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy universe
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy universe
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
|
||||||
|
|
||||||
|
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||||
|
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||||
|
## your rights to use the software. Also, please note that software in
|
||||||
|
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||||
|
## security team.
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy multiverse
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy multiverse
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy multiverse
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
|
||||||
|
|
||||||
|
## N.B. software from this repository may not have been tested as
|
||||||
|
## extensively as that contained in the main release, although it includes
|
||||||
|
## newer versions of some applications which may provide useful features.
|
||||||
|
## Also, please note that software in backports WILL NOT receive any review
|
||||||
|
## or updates from the Ubuntu security team.
|
||||||
|
deb [arch=arm64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
|
||||||
|
deb [arch=amd64] http://us.ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
|
||||||
|
# deb-src http://us.ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
|
||||||
|
|
||||||
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
|
||||||
|
deb [arch=amd64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
|
||||||
|
# deb-src http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
|
||||||
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security universe
|
||||||
|
deb [arch=amd64] http://ports.ubuntu.com/ubuntu-ports jammy-security universe
|
||||||
|
# deb-src http://ports.ubuntu.com/ubuntu-ports jammy-security universe
|
||||||
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
|
||||||
|
deb [arch=amd64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
|
||||||
|
# deb-src http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
|
||||||
|
|
||||||
|
# This system was installed using small removable media
|
||||||
|
# (e.g. netinst, live or single CD). The matching "deb cdrom"
|
||||||
|
# entries were disabled at the end of the installation process.
|
||||||
|
# For information about how to configure apt package sources,
|
||||||
|
# see the sources.list(5) manual.' | sudo tee /etc/apt/sources.list
|
||||||
|
|
||||||
|
sudo dpkg --add-architecture amd64
|
||||||
|
sudo apt update
|
||||||
|
|
||||||
|
# Install Microsoft Edge if x86_64
|
||||||
|
MACHINE_TYPE=$(uname -m)
|
||||||
|
if [ "${MACHINE_TYPE}" == 'x86_64' ] || [ -f /media/psf/RosettaLinux/rosetta ]; then
|
||||||
|
output 'x86_64 machine, installing Microsoft Edge.'
|
||||||
|
unpriv curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
|
||||||
|
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main"
|
||||||
|
sudo apt install -y microsoft-edge-stable
|
||||||
|
sudo mkdir -p /etc/opt/edge/policies/managed/ /etc/opt/edge/policies/recommended/
|
||||||
|
sudo chmod -R 755 /etc/opt/edge
|
||||||
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Microsoft-Edge-Policies/main/Linux/managed.json | sudo tee /etc/opt/edge/policies/managed/managed.json
|
||||||
|
sudo chmod 644 /etc/opt/edge/policies/managed/managed.json
|
||||||
|
unpriv curl https://raw.githubusercontent.com/TommyTran732/Microsoft-Edge-Policies/main/Linux/recommended.json | sudo tee /etc/opt/edge/policies/recommended/recommended.json
|
||||||
|
sudo chmod 644 /etc/opt/edge/policies/managed/managed.json /etc/opt/edge/policies/managed/recommended.json
|
||||||
|
sudo chmod 644 /etc/opt/edge/policies/managed/recommended.json
|
||||||
|
fi
|
||||||
|
|
||||||
# Enable fstrim.timer
|
# Enable fstrim.timer
|
||||||
sudo apt install tuned -y
|
|
||||||
sudo systemctl enable --now fstrim.timer
|
sudo systemctl enable --now fstrim.timer
|
||||||
|
|
||||||
#Enable Titlebar buttons
|
# Installing tuned first here because virt-what is 1 of its dependencies anyways
|
||||||
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
|
sudo apt install tuned -y
|
||||||
|
virt_type=$(virt-what)
|
||||||
|
if [ "$virt_type" = '' ]; then
|
||||||
|
output 'Virtualization: Bare Metal.'
|
||||||
|
elif [ "$virt_type" = 'openvz lxc' ]; then
|
||||||
|
output 'Virtualization: OpenVZ 7.'
|
||||||
|
elif [ "$virt_type" = 'xen xen-hvm' ]; then
|
||||||
|
output 'Virtualization: Xen-HVM.'
|
||||||
|
elif [ "$virt_type" = 'xen xen-hvm aws' ]; then
|
||||||
|
output 'Virtualization: Xen-HVM on AWS.'
|
||||||
|
else
|
||||||
|
output "Virtualization: $virt_type."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setup tuned
|
||||||
|
if [ "$virt_type" = '' ]; then
|
||||||
|
# Don't know whether using tuned would be a good idea on a laptop, power-profiles-daemon should be handling performance tuning IMO.
|
||||||
|
sudo apt remove tuned -y
|
||||||
|
sudo apt autoremove -y
|
||||||
|
else
|
||||||
|
sudo tuned-adm profile virtual-guest
|
||||||
|
fi
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright (C) 2023 Thien Tran
|
# Copyright (C) 2021-2024 Thien Tran
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
# 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
|
# use this file except in compliance with the License. You may obtain a copy of
|
||||||
@ -24,26 +24,22 @@ unpriv(){
|
|||||||
sudo -u nobody "$@"
|
sudo -u nobody "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Compliance and updates
|
# Compliance and updates
|
||||||
sudo systemctl mask debug-shell.service
|
sudo systemctl mask debug-shell.service
|
||||||
echo 'Authorized uses only. All activity may be monitored and reported.' | sudo tee /etc/issue
|
echo 'Authorized uses only. All activity may be monitored and reported.' | sudo tee /etc/issue
|
||||||
echo 'Authorized uses only. All activity may be monitored and reported.' | sudo tee /etc/issue.net
|
echo 'Authorized uses only. All activity may be monitored and reported.' | sudo tee /etc/issue.net
|
||||||
|
|
||||||
#USG CIS Server 2 Breaks Unbound right now.
|
|
||||||
#sudo ua enable usg
|
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
sudo apt full-upgrade -y
|
sudo apt full-upgrade -y
|
||||||
sudo apt install -y curl
|
sudo apt install -y curl
|
||||||
#sudo apt install -y usg curl libpam-pwquality
|
|
||||||
#sudo apt autoremove -y
|
# Default to gcc-12 instead of gcc-11
|
||||||
#sudo usg fix cis_level2_server
|
sudo rm /usr/bin/gcc
|
||||||
|
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc
|
||||||
|
|
||||||
# Make home directory private
|
# Make home directory private
|
||||||
sudo chmod 700 /home/*
|
sudo chmod 700 /home/*
|
||||||
|
|
||||||
# Remove AIDE
|
|
||||||
#sudo apt purge -y aide*
|
|
||||||
|
|
||||||
# Setup NTS
|
# Setup NTS
|
||||||
sudo systemctl disable --now systemd-timesyncd
|
sudo systemctl disable --now systemd-timesyncd
|
||||||
sudo apt install -y chrony
|
sudo apt install -y chrony
|
||||||
|
2
etc/dconf/db/local.d/adw-gtk3-dark
Normal file
2
etc/dconf/db/local.d/adw-gtk3-dark
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[org/gnome/desktop/interface]
|
||||||
|
gtk-theme='adw-gtk3-dark'
|
2
etc/dconf/db/local.d/apport-disable
Normal file
2
etc/dconf/db/local.d/apport-disable
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[com/ubuntu/update-notifier]
|
||||||
|
show-apport-crashes=false
|
2
etc/dconf/db/local.d/button-layout
Normal file
2
etc/dconf/db/local.d/button-layout
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[org/gnome/desktop/wm/preferences]
|
||||||
|
color-scheme='appmenu:minimize,maximize,close'
|
1
etc/dconf/db/local.d/locks/apport-disable
Normal file
1
etc/dconf/db/local.d/locks/apport-disable
Normal file
@ -0,0 +1 @@
|
|||||||
|
com/ubuntu/update-notifier/show-apport-crashes
|
2
etc/dconf/db/local.d/prefer-dark
Normal file
2
etc/dconf/db/local.d/prefer-dark
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[org/gnome/desktop/interface]
|
||||||
|
color-scheme='prefer-dark'
|
5
etc/dconf/db/local.d/touchpad
Normal file
5
etc/dconf/db/local.d/touchpad
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[org/gnome/desktop/peripherals/touchpad]
|
||||||
|
click-method='areas'
|
||||||
|
disable-while-typing=false
|
||||||
|
tap-to-click=true
|
||||||
|
to-finger-scrolling-enabled=false
|
Loading…
Reference in New Issue
Block a user