privateone commited on
Commit
f19db59
·
verified ·
1 Parent(s): 7381827

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +5 -2
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
- cp ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys || { echo "Failed to add public key to authorized_keys"; exit 1; }
75
- chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
 
 
 
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