13 lines
384 B
Bash
Executable File
13 lines
384 B
Bash
Executable File
#!/bin/bash
|
|
# Generate SSH host key for SFTP server if it doesn't exist
|
|
|
|
KEY_FILE="/app/ssh_host_key"
|
|
|
|
if [ ! -f "$KEY_FILE" ]; then
|
|
echo "Generating SSH host key for SFTP server..."
|
|
ssh-keygen -t rsa -b 4096 -f "$KEY_FILE" -N "" -C "SFTP-Server-Host-Key"
|
|
echo "SSH host key generated successfully at $KEY_FILE"
|
|
else
|
|
echo "SSH host key already exists at $KEY_FILE"
|
|
fi
|