mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
chore(root): add server setup script
This commit is contained in:
parent
4a1fb1419e
commit
a40ff3d0ef
1
pockethost
Submodule
1
pockethost
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 3198f3da0988cfc8200cce94cd0a7ec238d3282e
|
37
setup.sh
Normal file
37
setup.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Update the package list and upgrade all packages
|
||||
apt-get update -y
|
||||
apt-get upgrade -y
|
||||
|
||||
|
||||
# Create user pockethost with no password
|
||||
adduser --disabled-password --gecos "" pockethost
|
||||
|
||||
# Grant passwordless sudo privileges to pockethost
|
||||
echo "pockethost ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/pockethost
|
||||
|
||||
# Update configurations
|
||||
ufw allow OpenSSH
|
||||
echo "y" | ufw enable
|
||||
|
||||
# Copy root's authorized_keys to pockethost
|
||||
mkdir -p /home/pockethost/.ssh
|
||||
cp /root/.ssh/authorized_keys /home/pockethost/.ssh/authorized_keys
|
||||
chown -R pockethost:pockethost /home/pockethost/.ssh
|
||||
chmod 700 /home/pockethost/.ssh
|
||||
chmod 600 /home/pockethost/.ssh/authorized_keys
|
||||
|
||||
# Add GitHub to known hosts to prevent interactive prompt
|
||||
su - pockethost -c "ssh-keyscan github.com >> ~/.ssh/known_hosts"
|
||||
|
||||
|
||||
#####
|
||||
# As pockethost user
|
||||
#####
|
||||
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
git clone git@github.com:pockethost/pockethost.git
|
||||
cd pockethost
|
||||
nvm install
|
||||
npm i -g pnpm pm2
|
Loading…
x
Reference in New Issue
Block a user