Tyleo-Scripts/irp-alp-rds
2024-02-18 19:06:30 +01:00

63 lines
No EOL
2.1 KiB
Text
Executable file

clear
echo =======================================
echo = Server Node Installation RDS2S Mode =
echo =======================================
echo '[cli] Patching Repos to Latest Stable...'
cp /etc/apk/repositories /etc/apk/repositories.backup
echo https://dl-cdn.alpinelinux.org/alpine/latest-stable/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/latest-stable/community >> /etc/apk/repositories
echo '[apk] Updating Index...'
apk update
echo '[apk] Upgrading Packages to latest version before setup...'
apk upgrade
echo '[apk] Installing Base Packages...'
apk add curl wget aria2 screen sudo shadow htop btop nano vim fish bash zsh openssh xrdp xorgxrdp chromium bat fd ack ncdu exa
apk add plasma
echo '[orc] Enabling OpenSSH Server Daemon...'
rc-update add sshd
service sshd start
echo '[orc] Enabling XRDP Server Daemon...'
rc-update add xrdp
service xrdp start
rc-update add xrdp-sesman
service xrdp-sesman start
# Setup Service Account
clear
echo =======================================
echo = Server Node Installation RDS2S Mode =
echo =======================================
echo = Patching Sudo with Ruby Group Patch...
groupadd --gid 50000 ruby
echo "%ruby ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ruby-root
echo = Service Account Creation...
echo -n "= Username (lowercase): "
read Suid
echo = Creating $Suid...
useradd -d /home/service-$Suid -m $Suid
echo = Defining Shell to FiSH...
usermod --shell /usr/bin/fish $Suid
usermod --shell /usr/bin/fish root
echo = Adding to Groups Wheel, Ruby and Docker...
usermod -aG wheel $Suid
usermod -aG ruby $Suid
usermod -aG docker $Suid
echo = Set Password for $Suid Account...
passwd $Suid
echo = Setup $Suid Quick Sudo...
# Setup DNS Client to Server
clear
echo =======================================
echo = Server Node Installation RDS2S Mode =
echo =======================================
mkdir -p /etc/udhcpc
echo RESOLV_CONF=no >> /etc/udhcpc/udhcpc.conf
setup-dns
# Setup Desktop User to Server
clear
echo =======================================
echo = Server Node Installation RDS2S Mode =
echo =======================================
setup-desktop