Skip to content

Commit

Permalink
Attempt to fix issue when there is no public key
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed Mar 9, 2024
1 parent ccf540d commit eab2a86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ generate_ssh_host_keys() {
}

setup_ssh() {
echo "Setting up SSH..."
mkdir -p ~/.ssh

# Add SSH public key from environment variable to ~/.ssh/authorized_keys
# if the PUBLIC_KEY environment variable is set
if [[ ${PUBLIC_KEY} ]]; then
echo "Setting up SSH..."
mkdir -p ~/.ssh
echo -e "${PUBLIC_KEY}\n" >> ~/.ssh/authorized_keys
chmod 700 -R ~/.ssh
fi

chmod 700 -R ~/.ssh

# Generate SSH host keys if they don't exist
generate_ssh_host_keys

Expand Down

0 comments on commit eab2a86

Please sign in to comment.