Once you registration is approved you will see all the Boards on the Forum. Non members of the forum only see the Public topics
#!/bin/bash
# -------------------------------------------------------------------------------
# Hardened Dedicated Server Setup Script (Unified)
# Author: Giles
# Location: /home/ubuntu/setup-dedicated-server.sh
# -------------------------------------------------------------------------------
echo "?? Starting setup: $(date)"
# -------------------------------------------------------------------------------
# Create the NEW User in case something goes wrong
# -------------------------------------------------------------------------------
echo " ** Create the NEW User in case something goes wrong **"
read -rsp "?? Enter New User name: " BOINC_USER
echo ** "You can enter through the address details. **"
echo "$BOINC_USER" | sudo tee /etc/boinc-client/gui_rpc_auth.cfg /usr/bin/gui_rpc_auth.cfg > /dev/null
echo "? BOINC password configured"
echo "Create User $BOINC_USER"
sudo adduser $BOINC_USER
echo "Add New User to sudo users"
sudo usermod -aG sudo $BOINC_USER
# -------------------------------------------------------------------------------
# 1. Hostname and SSH Setup
# -------------------------------------------------------------------------------
echo "** Enter you Host name/ Computer Name here **"
read -rp "?? Enter hostname for this server: " HOSTNAME
sudo hostnamectl set-hostname "$HOSTNAME"
echo "? Hostname set to '$HOSTNAME'"
echo "?? Enabling SSH..."
sudo systemctl enable ssh
sudo systemctl start ssh
echo "? SSH enabled and running"
# -------------------------------------------------------------------------------
# 2. Disable Sleep/Hibernate
# -------------------------------------------------------------------------------
echo "?? Disabling sleep and suspend modes..."
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
echo "? Sleep modes disabled"
# ------------------------------------------------------------------------------
# 2.1 Add the CERN deb file that is used in the apt install
# ------------------------------------------------------------------------------
wget https://cvmrepo.s3.cern.ch/cvmrepo/apt/cvmfs-release-latest_all.deb
sudo dpkg -i cvmfs-release-latest_all.deb
rm -f cvmfs-release-latest_all.deb
# -------------------------------------------------------------------------------
# 3. System Update and Core Packages
# -------------------------------------------------------------------------------
echo "?? Updating system and installing core packages..."
sudo apt update
sudo apt upgrade -y
sudo apt install -y boinc default-jre default-jdk libquadmath0 iptables-persistent curl sendmail mailutils libdvd-pkg sshguard podman cvmfs
echo "? System updated and core packages installed"
sudo systemctl enable sshguard
sudo systemctl start sshguard
sudo cvmfs_config setup
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 boinc
# -------------------------------------------------------------------------------
# 4. BOINC Init Script
# -------------------------------------------------------------------------------
echo "** This is a script to stop and start BOINC. It is used with the command line /ect/init.d/boinc stop OR start ie /ect/init.d/boinc start **"
echo "?? Creating BOINC init script..."
sudo tee /etc/init.d/boinc > /dev/null <<'EOT'
#!/bin/bash
# BOINC start/stop script
case "$1" in
start)
echo "?? Starting BOINC..."
cd /usr/bin
./boinc --daemon --allow_remote_gui_rpc
;;
stop)
echo "?? Stopping BOINC..."
pkill boinc || true
;;
*)
echo "Usage: /etc/init.d/boinc {start|stop}"
exit 1
;;
esac
exit 0
EOT
sudo chmod 755 /etc/init.d/boinc
sudo update-rc.d boinc defaults
echo "? BOINC init script installed"
# -------------------------------------------------------------------------------
# 5. BOINC Password Setup
# -------------------------------------------------------------------------------
echo "** This the password that boinc uses to log itself in and also used by programs like BOINCTAsks. Enter a password you will remember. It replaces a long hexidecimal password boinc defaults to **"
read -rsp "?? Enter BOINC password (for remote GUI): " BOINC_PASS
echo
echo "$BOINC_PASS" | sudo tee /etc/boinc-client/gui_rpc_auth.cfg /usr/bin/gui_rpc_auth.cfg > /dev/null
echo "? BOINC password configured"
# -------------------------------------------------------------------------------
# 9. BOINC Startup Script
# -------------------------------------------------------------------------------
echo "** This creates a script called myscript.sh which I use to start boinc when the computer boots up so boinc is always running. **"
echo "** Use the User name you created earlier in the script. **"
echo "?? Creating BOINC startup script..."
read -rsp "?? Enter BOINC user name for myscript.sh: " BOINC_USER
sudo tee /home/$BOINC_USER/myscript.sh > /dev/null <<'EOT'
#!/bin/bash
/etc/init.d/boinc stop
sleep 5
/etc/init.d/boinc start
EOT
sudo chmod +x /home/$BOINC_USER/myscript.sh
( sudo crontab -l 2>/dev/null; echo "@reboot bash /home/dingo/myscript.sh" ) | sudo crontab -
echo "? BOINC startup script added to crontab"
# ------------------------------------------------------------------------------
# 12. SET TIMEZONE
# ------------------------------------------------------------------------------
read -rp "?? Enter Time Zone for this server like Australia/Sydney: " TIME_ZONE
sudo timedatectl set-timezone "$TIME_ZONE"
echo "? Timezone set to '$TIME_ZONE'"
# -------------------------------------------------------------------------------
# Final Message
# -------------------------------------------------------------------------------
echo "?? Setup complete: $(date)"
echo " ** Rebooting the computer **"
sleep 10
reboot
Quote[Gerasim@Home] Gerasim@home:
****
Всем привет и хорошего настроения.
p.s. Слухи о моей смерти оказались несколько преувеличены. :)
****
****
All private and good construction.
p.s. My death was confirmed without fear. :)
****
View article · Fri, 24 Apr 2026 11:46:50 +0000
Page created in 0.044 seconds with 10 queries.