6 # Make sure the ssh-keygen progam exists
7 [ -f /usr/bin/ssh-keygen ] || exit 0
9 # Check for the SSH1 RSA key
10 if [ ! -f /etc/ssh_host_key ] ; then
11 echo Generating RSA Key...
12 /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh_host_key -C '' -N ''
15 # Check for the SSH2 RSA key
16 if [ ! -f /etc/ssh_host_rsa_key ] ; then
17 echo Generating RSA Key...
18 /usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -C '' -N ''
21 # Check for the SSH2 DSA key
22 if [ ! -f /etc/ssh_host_dsa_key ] ; then
23 echo Generating DSA Key...
25 /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -C '' -N ''
28 # Check for the SSH2 ECDSA key
29 if [ ! -f /etc/ssh_host_ecdsa_key ]; then
30 echo Generating ECDSA Key...
32 /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh_host_ecdsa_key -C '' -N ''
35 # Check for the ed25519 key
36 if [ ! -f /etc/ssh_host_ed25519_key ]; then
37 echo Generating ed25519 Key...
39 /usr/bin/ssh-keygen -t ed25519 -f /etc/ssh_host_ed25519_key -C '' -N ''
45 echo -n "Starting sshd: "
51 echo -n "Stopping sshd: "
72 echo "Usage: $0 {start|stop|restart}"