2015-10-03 02:24:55 +05:30
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
2015-10-12 21:09:40 +05:30
|
|
|
|
# Check if host keys are present, else create them
|
2015-10-13 02:43:22 +05:30
|
|
|
|
if ! test -f /data/ssh/ssh_host_rsa_key; then
|
2015-10-03 02:24:55 +05:30
|
|
|
|
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa
|
2015-10-12 21:09:40 +05:30
|
|
|
|
fi
|
|
|
|
|
|
2015-10-13 02:43:22 +05:30
|
|
|
|
if ! test -f /data/ssh/ssh_host_dsa_key; then
|
2015-10-03 02:24:55 +05:30
|
|
|
|
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa
|
2015-10-12 21:09:40 +05:30
|
|
|
|
fi
|
|
|
|
|
|
2015-10-13 02:43:22 +05:30
|
|
|
|
if ! test -f /data/ssh/ssh_host_ecdsa_key; then
|
2015-10-03 02:24:55 +05:30
|
|
|
|
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa
|
2015-10-12 21:09:40 +05:30
|
|
|
|
fi
|
|
|
|
|
|
2015-10-13 02:43:22 +05:30
|
|
|
|
if ! test -f /data/ssh/ssh_host_ed25519_key; then
|
2015-10-03 02:24:55 +05:30
|
|
|
|
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519
|
|
|
|
|
fi
|
2015-10-12 21:09:40 +05:30
|
|
|
|
|
|
|
|
|
# Set correct right to ssh keys
|
|
|
|
|
chown -R root:root /data/ssh/*
|
2015-11-05 00:49:39 +05:30
|
|
|
|
chmod 0700 /data/ssh
|
|
|
|
|
chmod 0600 /data/ssh/*
|