43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
# Force the locale
|
|
echo "LC_ALL=en_GB.UTF-8" >> /etc/default/locale
|
|
locale-gen en_US.UTF-8
|
|
|
|
# Set the hostname
|
|
echo "scarif.space" > /etc/hostname
|
|
|
|
source /opt/mouse/.env
|
|
|
|
echo "------- Generating system users -------"
|
|
useradd -m -p $(echo $USER_PASSWORD | openssl passwd -1 -stdin) chris
|
|
echo "chris ALL=(ALL) ALL" >> /etc/sudoers
|
|
passwd -l root
|
|
|
|
echo "------- Installing packages -------"
|
|
apt-get -y update
|
|
apt-get -y tmux htop docker docker-compose zsh
|
|
|
|
echo "------- Setting up SSH -------"
|
|
mkdir -p /home/chris/.ssh
|
|
cp /root/.ssh/authorized_keys /home/chris/.ssh/authorized_keys
|
|
rm /etc/ssh/sshd_config
|
|
ln -s /opt/mouse/sshd_config /etc/ssh/sshd_config
|
|
echo "Welcome to The Mouse!" > /etc/motd
|
|
systemctl restart sshd
|
|
|
|
echo "------- Setting up firewall -------"
|
|
ufw default deny incoming
|
|
ufw default allow outgoing
|
|
ufw allow 629
|
|
ufw --force enable
|
|
|
|
echo "------- Install Cuda -------"
|
|
apt remove -y vultr-nvidia-client-drivers
|
|
wget -q -O /tmp/vultr_nvidia_driver.zip "http://169.254.169.254/latest/nvidia_linux_driver_installer_url"
|
|
unzip -qq -o /tmp/vultr_nvidia_driver.zip -d /
|
|
bash /opt/nvidia/install.sh
|
|
rm -f /tmp/vultr_nvidia_driver.zip
|
|
|
|
# echo "------- Starting docker -------"
|
|
# systemctl enable docker --now
|
|
# docker-compose -f "/opt/mouse/docker-compose.yml" --env-file "/opt/mouse/.env" up -d
|