-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssh-keys
More file actions
45 lines (37 loc) · 842 Bytes
/
ssh-keys
File metadata and controls
45 lines (37 loc) · 842 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
rm -rf /etc/ssh/ssh_host*
if ( ls /etc/ssh | grep ssh_host_key )
then
echo -e "SSH1 key ok..."
else
#SSH1 key
ssh-keygen -q -f /etc/ssh/ssh_host_key -t rsa1 -N ''
fi
if ( ls /etc/ssh | grep ssh_host_rsa_key )
then
echo -e "SSH2 RSA key ok..."
else
#SSH2 RSA key
ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
fi
if ( ls /etc/ssh | grep ssh_host_dsa_key )
then
echo -e "SSH2 DSA key ok..."
else
#SSH2 DSA key
ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
fi
if ( ls /etc/ssh | grep ssh_host_ecdsa_key )
then
echo -e "SSH2 ECDSA key ok..."
else
#SSH2 ECDSA key
ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -t ecdsa -N ''
fi
#if ( ls /etc/ssh | grep ssh_host_ed25519_key )
#then
#echo -e "SSH2 ED25519 key ok..."
#else
#SSH2 ED25519 key
#ssh-keygen -q -f /etc/ssh/ssh_host_ed25519_key -t ed25519 -N ''
#fi