Spaces:
Paused
Paused
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -71,8 +71,11 @@ generate_admin_ssh_keys() {
|
|
| 71 |
add_admin_authorized_keys() {
|
| 72 |
echo "* Adding public key to authorized_keys for 'admin' user *"
|
| 73 |
cat ~/.ssh/id_rsa.pub
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
|
| 78 |
# Function to add SSH private key to the SSH agent
|
|
|
|
| 71 |
add_admin_authorized_keys() {
|
| 72 |
echo "* Adding public key to authorized_keys for 'admin' user *"
|
| 73 |
cat ~/.ssh/id_rsa.pub
|
| 74 |
+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys || { echo "Failed to add public key to authorized_keys"; exit 1; }
|
| 75 |
+
cat ~/.ssh/authorized_keys
|
| 76 |
+
chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
|
| 77 |
+
echo "password" | su -p "admin"
|
| 78 |
+
whoami
|
| 79 |
}
|
| 80 |
|
| 81 |
# Function to add SSH private key to the SSH agent
|