aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssh/openssh-5.9p1/sshdgenkeys
blob: 61709b116be2da8313d095966277b0e3d3f12e3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

# This script
#     generates host keys
#     check /var/run/sshd nad creates it if not already created


if ! [ -f /etc/ssh/ssh_host_ecdsa_key ]; then
  /usr/bin/ssh-keygen -q -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key || exit 1
fi

if ! [ -f /etc/ssh/ssh_host_rsa_key ]; then
  /usr/bin/ssh-keygen -q -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key || exit 1
fi

if ! [ -f /etc/ssh/ssh_host_dsa_key ]; then
  /usr/bin/ssh-keygen  -q -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key || exit 1
fi

if [ ! -d /var/run/sshd ]; then
  mkdir /var/run/sshd || exit 1
  chmod 0755 /var/run/sshd || exit 1
fi

# `test' returns non-zero when it fails. Don't let this hold up ExecStart.
exit 0