Initial commit 2
This commit is contained in:
9
.env.example
Normal file
9
.env.example
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Global settings
|
||||||
|
#
|
||||||
|
APP_ENV=
|
||||||
|
USERNAME=
|
||||||
|
USER_PASSWORD=
|
||||||
|
DOMAIN=
|
||||||
|
LOCAL_IP=
|
||||||
|
SSH_KEY= # Will be added to authorized keys
|
||||||
43
bootstrap.sh
Normal file
43
bootstrap.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# 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
|
||||||
|
echo $SSH_KEY >> /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-key del 7fa2af80
|
||||||
|
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu24-4/x86_64/cuda-keyring_1.1-1_all.deb
|
||||||
|
sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install cuda-toolkit
|
||||||
|
sudo apt-get install nvidia-gds
|
||||||
|
|
||||||
|
# echo "------- Starting docker -------"
|
||||||
|
# systemctl enable docker --now
|
||||||
|
# docker-compose -f "/opt/mouse/docker-compose.yml" --env-file "/opt/mouse/.env" up -d
|
||||||
11
sshd_config
Normal file
11
sshd_config
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Port 629
|
||||||
|
LoginGraceTime 1m
|
||||||
|
PermitRootLogin no
|
||||||
|
MaxSessions 4
|
||||||
|
AllowUsers chris
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
AuthorizedKeysFile .ssh/authorized_keys
|
||||||
|
ChallengeResponseAuthentication no
|
||||||
|
PrintMotd no
|
||||||
|
PasswordAuthentication yes
|
||||||
|
|
||||||
Reference in New Issue
Block a user