mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
Merge (#127)
This commit is contained in:
11
app/SSH/OS/scripts/create-user.sh
Executable file
11
app/SSH/OS/scripts/create-user.sh
Executable file
@ -0,0 +1,11 @@
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
echo "__key__" | sudo tee -a /home/root/.ssh/authorized_keys
|
||||
sudo useradd -p $(openssl passwd -1 __password__) __user__
|
||||
sudo usermod -aG sudo __user__
|
||||
echo "__user__ ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers
|
||||
sudo mkdir /home/__user__
|
||||
sudo mkdir /home/__user__/.ssh
|
||||
echo "__key__" | sudo tee -a /home/__user__/.ssh/authorized_keys
|
||||
sudo chown -R __user__:__user__ /home/__user__
|
||||
sudo chsh -s /bin/bash __user__
|
||||
sudo su - __user__ -c "ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa" <<< y
|
1
app/SSH/OS/scripts/delete-ssh-key.sh
Normal file
1
app/SSH/OS/scripts/delete-ssh-key.sh
Normal file
@ -0,0 +1 @@
|
||||
bash -c 'ssh_key_to_delete="$1"; sed -i "\#${ssh_key_to_delete//\//\\/}#d" /home/vito/.ssh/authorized_keys' bash '__key__'
|
3
app/SSH/OS/scripts/deploy-ssh-key.sh
Normal file
3
app/SSH/OS/scripts/deploy-ssh-key.sh
Normal file
@ -0,0 +1,3 @@
|
||||
if ! echo '__key__' | sudo tee -a ~/.ssh/authorized_keys; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
3
app/SSH/OS/scripts/edit-file.sh
Normal file
3
app/SSH/OS/scripts/edit-file.sh
Normal file
@ -0,0 +1,3 @@
|
||||
if ! echo "__content__" | tee __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
1
app/SSH/OS/scripts/generate-ssh-key.sh
Normal file
1
app/SSH/OS/scripts/generate-ssh-key.sh
Normal file
@ -0,0 +1 @@
|
||||
ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/__name__
|
1
app/SSH/OS/scripts/get-public-key.sh
Executable file
1
app/SSH/OS/scripts/get-public-key.sh
Executable file
@ -0,0 +1 @@
|
||||
cat ~/.ssh/id_rsa.pub
|
3
app/SSH/OS/scripts/install-dependencies.sh
Executable file
3
app/SSH/OS/scripts/install-dependencies.sh
Executable file
@ -0,0 +1,3 @@
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common curl zip unzip git gcc openssl
|
||||
git config --global user.email "__email__"
|
||||
git config --global user.name "__name__"
|
1
app/SSH/OS/scripts/read-file.sh
Normal file
1
app/SSH/OS/scripts/read-file.sh
Normal file
@ -0,0 +1 @@
|
||||
[ -f __path__ ] && cat __path__
|
1
app/SSH/OS/scripts/read-ssh-key.sh
Normal file
1
app/SSH/OS/scripts/read-ssh-key.sh
Normal file
@ -0,0 +1 @@
|
||||
cat ~/.ssh/__name__.pub
|
3
app/SSH/OS/scripts/reboot.sh
Normal file
3
app/SSH/OS/scripts/reboot.sh
Normal file
@ -0,0 +1,3 @@
|
||||
echo "Rebooting..."
|
||||
|
||||
sudo reboot
|
5
app/SSH/OS/scripts/run-script.sh
Normal file
5
app/SSH/OS/scripts/run-script.sh
Normal file
@ -0,0 +1,5 @@
|
||||
if ! cd __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
__script__
|
9
app/SSH/OS/scripts/upgrade.sh
Executable file
9
app/SSH/OS/scripts/upgrade.sh
Executable file
@ -0,0 +1,9 @@
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get clean
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get update
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
||||
|
||||
# Install Node.js
|
||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -;
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get update
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install nodejs -y
|
Reference in New Issue
Block a user