Added support for dropbear or ssh

This commit is contained in:
Dionysus 2024-07-16 20:20:21 -04:00
parent 4ed0812a70
commit 48df4f3802
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

22
setup
View File

@ -10,9 +10,9 @@ ARCH=x86_64 # x86_64 or x86_64-musl
CPU=intel # amd or intel (blank for none) CPU=intel # amd or intel (blank for none)
DISPLAY_SERVER=xorg # xorg or blank for none DISPLAY_SERVER=xorg # xorg or blank for none
GFX_DRIVER=intel # amd, intel, or nvidia (blank for none) GFX_DRIVER=intel # amd, intel, or nvidia (blank for none)
REMOTE=dropbear # dropbear or ssh REMOTE=dropbear # dropbear or ssh (blank for none)
USERNAME=acidvegas USERNAME=acidvegas
WIFI_DEV=wlan0
GIT_URL="https://raw.githubusercontent.com/acidvegas/void/master" GIT_URL="https://raw.githubusercontent.com/acidvegas/void/master"
@ -36,17 +36,16 @@ setup_root() {
printf "Defaults lecture = always\nDefaults lecture_file = /etc/sudoers.d/sudoers.lecture\nroot ALL=(ALL) ALL\n%%wheel ALL=(ALL) ALL\n" > /etc/sudoers printf "Defaults lecture = always\nDefaults lecture_file = /etc/sudoers.d/sudoers.lecture\nroot ALL=(ALL) ALL\n%%wheel ALL=(ALL) ALL\n" > /etc/sudoers
printf "\n\033[1m \033[32m\"Bee\" careful \033[34m__\n \033[32mwith sudo! \033[34m// \ \n \\\\\\_/ \033[33m//\n \033[35m''-.._.-''-.._.. \033[33m-(||)(')\n '''\033[0m\n" > /etc/sudoers.d/sudoers.lecture printf "\n\033[1m \033[32m\"Bee\" careful \033[34m__\n \033[32mwith sudo! \033[34m// \ \n \\\\\\_/ \033[33m//\n \033[35m''-.._.-''-.._.. \033[33m-(||)(')\n '''\033[0m\n" > /etc/sudoers.d/sudoers.lecture
if [ $REMOTE = "ssh" ]; then if [ $REMOTE = "dropbear" ]; then
xbps-install -y openssh LOCAL_IP=$(ip addr show $WIFI_DEV | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)
printf "PermitRootLogin no\nPasswordAuthentication no\n" >> /etc/ssh/sshd_config RND_PORT=$(shuf -i 10000-65535 -n 1)
ln -sfv /etc/sv/sshd /var/service/ xbps-install -y dropbear
elif [ $REMOTE = "dropbear" ]; then printf '#!/bin/sh\nexec 2>&1\n[ -r conf ] && . ./conf\nexec dropbear -p $LOCAL_IP:$RND_PORT -w -s -R -F' > /etc/sv/dropbear/run
printf '#!/bin/sh\nexec 2>&1\n[ -r conf ] && . ./conf\nexec dropbear -p CHANGE:ME -w -s -R -F\n' > /etc/sv/dropbear/run
fi fi
printf "\nhsts=0\n" >> /etc/wgetrc printf "\nhsts=0\n" >> /etc/wgetrc
for item in dhcpcd dropbear incus incus-user socklog-unix nanoklogd wpa_supplicant; do for item in dhcpcd incus incus-user socklog-unix nanoklogd wpa_supplicant; do
ln -sfv /etc/sv/$item /var/service # Use /etc/runit/runsvdir/default/ instead of /var/service if in a chroot environemnt ln -sfv /etc/sv/$item /var/service # Use /etc/runit/runsvdir/default/ instead of /var/service if in a chroot environemnt
done done
} }
@ -94,6 +93,11 @@ setup_packages() {
xbps-install -y checkbashisms go make patch pkg-config python3 python3-pip xbps-install -y checkbashisms go make patch pkg-config python3 python3-pip
# Essentials # Essentials
if [ $REMOTE = "dropbear" ]; then
xbps-install -y dhcpcd dropbear
elif [ $REMOTE = "ssh" ] || [ $REMOTE = "openssh" ]; then
xbps-install -y dhcpcd openssh
fi
xbps-install -y curl dropbear git jq progress rsync socklog-void tmux tor tree unzip zip xbps-install -y curl dropbear git jq progress rsync socklog-void tmux tor tree unzip zip
# Raspberry Pi specific # Raspberry Pi specific