You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
863 B
30 lines
863 B
8 years ago
|
#!/bin/bash
|
||
|
|
||
|
if [ ! -d /data/ssh ]; then
|
||
|
mkdir -p /data/ssh
|
||
|
fi
|
||
|
|
||
|
if [ ! -f /data/ssh/ssh_host_ed25519_key ]; then
|
||
|
echo "Generating /data/ssh/ssh_host_ed25519_key..."
|
||
6 years ago
|
ssh-keygen -t ed25519 -f /data/ssh/ssh_host_ed25519_key -N "" > /dev/null
|
||
8 years ago
|
fi
|
||
|
|
||
|
if [ ! -f /data/ssh/ssh_host_rsa_key ]; then
|
||
|
echo "Generating /data/ssh/ssh_host_rsa_key..."
|
||
|
ssh-keygen -t rsa -b 2048 -f /data/ssh/ssh_host_rsa_key -N "" > /dev/null
|
||
|
fi
|
||
|
|
||
|
if [ ! -f /data/ssh/ssh_host_dsa_key ]; then
|
||
|
echo "Generating /data/ssh/ssh_host_dsa_key..."
|
||
|
ssh-keygen -t dsa -f /data/ssh/ssh_host_dsa_key -N "" > /dev/null
|
||
|
fi
|
||
|
|
||
|
if [ ! -f /data/ssh/ssh_host_ecdsa_key ]; then
|
||
|
echo "Generating /data/ssh/ssh_host_ecdsa_key..."
|
||
|
ssh-keygen -t ecdsa -b 256 -f /data/ssh/ssh_host_ecdsa_key -N "" > /dev/null
|
||
|
fi
|
||
|
|
||
|
chown root:root /data/ssh/*
|
||
|
chmod 0700 /data/ssh
|
||
|
chmod 0600 /data/ssh/*
|