Spaces:
Paused
Paused
BinaryONe
commited on
Commit
·
5334b6e
1
Parent(s):
fe0652f
Changes
Browse files
start.sh
CHANGED
|
@@ -109,7 +109,6 @@ keep_container_running() {
|
|
| 109 |
# Main script execution
|
| 110 |
print_host_details
|
| 111 |
generate_ssh_keys
|
| 112 |
-
start_ssh_service
|
| 113 |
create_admin_user
|
| 114 |
fix_admin_permissions
|
| 115 |
generate_admin_ssh_keys
|
|
@@ -128,20 +127,22 @@ fi
|
|
| 128 |
#eval $(ssh-agent -s) || { echo "Failed to start SSH agent"; exit 1; }
|
| 129 |
|
| 130 |
# Ensure SSHD config is correctly set up
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
# Restart SSH service
|
| 136 |
#service ssh restart || { echo "Failed to restart SSH service"; exit 1; }
|
| 137 |
|
| 138 |
|
| 139 |
-
|
| 140 |
|
| 141 |
echo "* Contents of id_rsa of Admin:"
|
| 142 |
cat /home/admin/.ssh/id_rsa
|
| 143 |
cat /home/admin/.ssh/config
|
| 144 |
|
|
|
|
|
|
|
| 145 |
echo "* Testing admin's SSH login locally *"
|
| 146 |
ssh -o StrictHostKeyChecking=no -i /home/admin/.ssh/id_rsa admin@0.0.0.0 -p 2222 exit
|
| 147 |
|
|
|
|
| 109 |
# Main script execution
|
| 110 |
print_host_details
|
| 111 |
generate_ssh_keys
|
|
|
|
| 112 |
create_admin_user
|
| 113 |
fix_admin_permissions
|
| 114 |
generate_admin_ssh_keys
|
|
|
|
| 127 |
#eval $(ssh-agent -s) || { echo "Failed to start SSH agent"; exit 1; }
|
| 128 |
|
| 129 |
# Ensure SSHD config is correctly set up
|
| 130 |
+
echo "* Configuring SSHD *"
|
| 131 |
+
echo "UseKeychain yes" >> /home/admin/.ssh/config
|
| 132 |
+
echo "AddKeysToAgent yes" >> /home/admin/.ssh/config
|
| 133 |
|
| 134 |
# Restart SSH service
|
| 135 |
#service ssh restart || { echo "Failed to restart SSH service"; exit 1; }
|
| 136 |
|
| 137 |
|
| 138 |
+
add_ssh_key_to_agent
|
| 139 |
|
| 140 |
echo "* Contents of id_rsa of Admin:"
|
| 141 |
cat /home/admin/.ssh/id_rsa
|
| 142 |
cat /home/admin/.ssh/config
|
| 143 |
|
| 144 |
+
start_ssh_service
|
| 145 |
+
|
| 146 |
echo "* Testing admin's SSH login locally *"
|
| 147 |
ssh -o StrictHostKeyChecking=no -i /home/admin/.ssh/id_rsa admin@0.0.0.0 -p 2222 exit
|
| 148 |
|