Spaces:
Paused
Paused
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -67,12 +67,10 @@ generate_admin_ssh_keys() {
|
|
| 67 |
}
|
| 68 |
|
| 69 |
# Function to add public key to authorized_keys for 'admin' user
|
| 70 |
-
add_admin_authorized_keys() {
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
|
| 75 |
-
fi
|
| 76 |
}
|
| 77 |
|
| 78 |
# Function to add SSH private key to the SSH agent
|
|
|
|
| 67 |
}
|
| 68 |
|
| 69 |
# Function to add public key to authorized_keys for 'admin' user
|
| 70 |
+
add_admin_authorized_keys() {
|
| 71 |
+
echo "* Adding public key to authorized_keys for 'admin' user *"
|
| 72 |
+
cat /home/admin/.ssh/id_rsa.pub >> /home/admin/.ssh/authorized_keys || { echo "Failed to add public key to authorized_keys"; exit 1; }
|
| 73 |
+
chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
|
| 76 |
# Function to add SSH private key to the SSH agent
|