22 lines
684 B
Bash
22 lines
684 B
Bash
|
#!/usr/bin/bash
|
||
|
|
||
|
chmod +x /usr/local/bin/sftpgo
|
||
|
|
||
|
mkdir /etc/sftpgo
|
||
|
|
||
|
# Generate SFTPGo key pair
|
||
|
ssh-keygen -f /etc/sftpgo/ed25519 -t ed25519 -N "" -C ""
|
||
|
# Generate fingerprints
|
||
|
fp=($(ssh-keygen -l -f /etc/sftpgo/ed25519))
|
||
|
echo ${fp[1]} > /etc/sftpgo/ed25519.fp
|
||
|
ssh-keygen -lv -f /etc/sftpgo/ed25519 | tail -n +2 > /etc/sftpgo/ed25519.asciiart
|
||
|
# Generate SSHFP record
|
||
|
echo ht.servnest.test. 86400 SSHFP 4 2 $(cut -d ' ' -f 2 /etc/sftpgo/ed25519.pub | base64 -d | sha256sum | cut -d ' ' -f 1) >> /srv/servnest/reg/servnest.test.zone
|
||
|
|
||
|
cp /install/sftpgo.toml /etc/sftpgo/
|
||
|
touch /etc/sftpgo/banner.txt
|
||
|
|
||
|
# For systemd
|
||
|
cp /install/sftpgo.service /etc/systemd/system/
|
||
|
systemctl enable sftpgo
|