]> git.pld-linux.org Git - packages/openssh.git/blame - sshd-keygen
- release 4 (by relup.sh)
[packages/openssh.git] / sshd-keygen
CommitLineData
1f912afe
JR
1#!/bin/sh
2
3# Get service config
4[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
5
35cb43f7
ER
6# generate new key with empty password if it does not exist
7ssh_gen_key() {
8 local type="$1" keyfile="$2"
9
10 test -s $keyfile && return
11
12 /usr/bin/ssh-keygen -t $type -f $keyfile -N '' >&2
13 chmod 600 $keyfile
aca544f0 14 [ ! -x /sbin/restorecon ] || /sbin/restorecon $keyfile
35cb43f7
ER
15}
16
1f912afe 17# generate new keys with empty passwords if they do not exist
56ee2986
AM
18ssh_gen_key ed25519 /etc/ssh/ssh_host_ed25519_key
19ssh_gen_key ecdsa /etc/ssh/ssh_host_ecdsa_key
35cb43f7
ER
20ssh_gen_key rsa /etc/ssh/ssh_host_rsa_key
21ssh_gen_key dsa /etc/ssh/ssh_host_dsa_key
This page took 0.025775 seconds and 4 git commands to generate.