-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.sh
More file actions
23 lines (18 loc) · 786 Bytes
/
start.sh
File metadata and controls
23 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Generate SSH host keys
rm -f "/etc/ssh/ssh_host_key"
rm -f "/etc/ssh/ssh_host_rsa_key"
rm -f "/etc/ssh/ssh_host_dsa_key"
rm -f "/etc/ssh/ssh_host_ecdsa_key"
rm -f "/etc/ssh/ssh_host_ed25519_key"
ssh-keygen -N '' -q -f "/etc/ssh/ssh_host_key" -t rsa1
ssh-keygen -N '' -q -f "/etc/ssh/ssh_host_rsa_key" -t rsa
ssh-keygen -N '' -q -f "/etc/ssh/ssh_host_dsa_key" -t dsa
ssh-keygen -N '' -q -f "/etc/ssh/ssh_host_ecdsa_key" -t ecdsa
ssh-keygen -N '' -q -f "/etc/ssh/ssh_host_ed25519_key" -t ed25519
MONIT_PASSWD=$(openssl rand -base64 6)
echo MONIT_PASSWORD=${MONIT_PASSWD}
groupadd monit
sed -e "s/__MONIT_PASSWD__/$MONIT_PASSWD/" -i /etc/monit/conf.d/enable_monit_webserver
sed -e 's/\(session.*pam_loginuid.so\)/\# \1/' -i /etc/pam.d/sshd
/usr/bin/monit -I -g monit -v