From f70e84dd5161933445db6f24bc8fb40c3e199cdd Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 14 Aug 2023 15:26:43 -0400 Subject: [PATCH] Fixed unsafe permissions on/in ~/.gnupg --- chrootInstall.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/chrootInstall.sh b/chrootInstall.sh index fd24d68..2a992c0 100755 --- a/chrootInstall.sh +++ b/chrootInstall.sh @@ -193,11 +193,19 @@ fi # ssh configuration pacman -S openssh --needed --noconfirm -mkdir /home/"$username"/.ssh +mkdir -p /home/"$username"/.ssh touch /home/"$username"/.ssh/authorized_keys chown -R "$username":users /home/"$username"/.ssh +chmod 700 /home/"$username"/.ssh chmod 600 /home/"$username"/.ssh/authorized_keys +# gpg configuration +mkdir -p /home/"$username"/.gnupg +echo 'pinentry-program /usr/bin/pinentry-tty' > /home/"$username"/.gnupg/gpg-agent.conf # forces gpg prompts to use terminal input +chown -R "$username":users /home/"$username"/.gnupg +chmod 700 /home/"$username"/.gnupg +chmod 600 /home/"$username"/.gnupg/gpg-agent.conf + # misc configuration if [ "$swap" -gt 0 ]; then echo 'vm.swappiness=10' > /etc/sysctl.d/99-swappiness.conf @@ -205,7 +213,6 @@ else echo 'vm.swappiness=0' > /etc/sysctl.d/99-swappiness.conf fi echo -e ""$username" soft memlock 64\n"$username" hard memlock 2097152\n"$username" hard nofile 524288\n# End of file" > /etc/security/limits.conf # increase memlock and add support for esync -echo 'pinentry-program /usr/bin/pinentry-tty' > /home/"$username"/.gnupg/gpg-agent.conf # forces gpg prompts to use terminal input curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/gai.conf -o /etc/gai.conf # configure gai to prefer IPv6 echo 'vm.max_map_count=2147483642' > /etc/sysctl.d/90-override.conf # increase max virtual memory maps (helps with some Wine games) pacman -S neofetch htop neovim --needed --noconfirm