mirror of
https://github.com/tomasriveral/vps-config.git
synced 2026-08-12 02:28:38 +02:00
fix file path and perm
This commit is contained in:
+28
-26
@@ -50,6 +50,28 @@ apt install -y \
|
|||||||
unzip \
|
unzip \
|
||||||
vim
|
vim
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# User
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
step "Creating administrator"
|
||||||
|
|
||||||
|
read -rp "Username: " USERNAME
|
||||||
|
|
||||||
|
adduser "$USERNAME"
|
||||||
|
|
||||||
|
usermod -aG sudo,docker "$USERNAME"
|
||||||
|
|
||||||
|
mkdir -p "/home/$USERNAME/.ssh"
|
||||||
|
|
||||||
|
cp /root/.ssh/authorized_keys \
|
||||||
|
"/home/$USERNAME/.ssh/authorized_keys"
|
||||||
|
|
||||||
|
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh"
|
||||||
|
|
||||||
|
chmod 700 "/home/$USERNAME/.ssh"
|
||||||
|
chmod 600 "/home/$USERNAME/.ssh/authorized_keys"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Repository
|
# Repository
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -57,9 +79,10 @@ apt install -y \
|
|||||||
step "Cloning configuration repository"
|
step "Cloning configuration repository"
|
||||||
|
|
||||||
if [ ! -d "$REPO_DIR" ]; then
|
if [ ! -d "$REPO_DIR" ]; then
|
||||||
git clone "$REPO"
|
git clone "$REPO" /home/$USERNAME/$REPO_DIR
|
||||||
fi
|
fi
|
||||||
cd "$REPO_DIR"
|
cd "/HOME/$USERNAME/$REPO_DIR"
|
||||||
|
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Docker
|
# Docker
|
||||||
@@ -118,28 +141,6 @@ systemctl enable --now fail2ban
|
|||||||
|
|
||||||
dpkg-reconfigure unattended-upgrades
|
dpkg-reconfigure unattended-upgrades
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# User
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
step "Creating administrator"
|
|
||||||
|
|
||||||
read -rp "Username: " USERNAME
|
|
||||||
|
|
||||||
adduser "$USERNAME"
|
|
||||||
|
|
||||||
usermod -aG sudo,docker "$USERNAME"
|
|
||||||
|
|
||||||
mkdir -p "/home/$USERNAME/.ssh"
|
|
||||||
|
|
||||||
cp /root/.ssh/authorized_keys \
|
|
||||||
"/home/$USERNAME/.ssh/authorized_keys"
|
|
||||||
|
|
||||||
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh"
|
|
||||||
|
|
||||||
chmod 700 "/home/$USERNAME/.ssh"
|
|
||||||
chmod 600 "/home/$USERNAME/.ssh/authorized_keys"
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Storage
|
# Storage
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -168,8 +169,8 @@ sleep 1
|
|||||||
echo ".."
|
echo ".."
|
||||||
sleep 1
|
sleep 1
|
||||||
echo "..."
|
echo "..."
|
||||||
|
sleep 1
|
||||||
mountpoint /mnt/kdrive || {echo "kDrive is still not mounted. Waiting..." && sleep 5 && mountpoint /mnt/kdrive } # if it fails we wait another 5 sec before retrying
|
mountpoint /mnt/kdrive
|
||||||
ls /mnt/kdrive
|
ls /mnt/kdrive
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -194,3 +195,4 @@ echo "You can now login as:"
|
|||||||
echo
|
echo
|
||||||
echo " ssh $USERNAME@<server>"
|
echo " ssh $USERNAME@<server>"
|
||||||
echo
|
echo
|
||||||
|
echo "Deploy by running the deploy.sh script"
|
||||||
|
|||||||
Reference in New Issue
Block a user