privateone commited on
Commit
21e483f
·
verified ·
1 Parent(s): be3c488

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +4 -6
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
- if [ ! -f /home/admin/.ssh/authorized_keys ]; then
72
- echo "* Adding public key to authorized_keys for 'admin' user *"
73
- cat /home/admin/.ssh/id_rsa.pub >> /home/admin/.ssh/authorized_keys || { echo "Failed to add public key to authorized_keys"; exit 1; }
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