File tree Expand file tree Collapse file tree 2 files changed +36
-4
lines changed
Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ DUMP_VERSION='v2'
77# setup
88build_dependencies=' curl git build-essential'
99sudo apt-get update > /dev/null
10+ sudo apt-get upgrade -y > /dev/null
1011sudo apt-get install -y ${build_dependencies} > /dev/null
1112
1213# install postgres
6768sudo supervisorctl reread
6869sudo supervisorctl update
6970
71+ # harden ssh
72+ sudo apt-get install -y fail2ban > /dev/null
73+ sudo tee ' /etc/ssh/sshd_config' > /dev/null << EOF
74+ Port 22
75+ Protocol 2
76+ HostKey /etc/ssh/ssh_host_rsa_key
77+ HostKey /etc/ssh/ssh_host_dsa_key
78+ HostKey /etc/ssh/ssh_host_ecdsa_key
79+ HostKey /etc/ssh/ssh_host_ed25519_key
80+ UsePrivilegeSeparation yes
81+ KeyRegenerationInterval 3600
82+ ServerKeyBits 1024
83+ SyslogFacility AUTH
84+ LogLevel INFO
85+ LoginGraceTime 120
86+ PermitRootLogin no
87+ StrictModes yes
88+ RSAAuthentication yes
89+ PubkeyAuthentication yes
90+ IgnoreRhosts yes
91+ RhostsRSAAuthentication no
92+ HostbasedAuthentication no
93+ PermitEmptyPasswords no
94+ ChallengeResponseAuthentication no
95+ PasswordAuthentication no
96+ X11Forwarding no
97+ PrintMotd no
98+ PrintLastLog yes
99+ TCPKeepAlive yes
100+ AcceptEnv LANG LC_*
101+ Subsystem sftp /usr/lib/openssh/sftp-server
102+ UsePAM no
103+ EOF
104+ sudo systemctl reload ssh
105+
70106# cleanup
71107sudo apt-get remove -y ${build_dependencies} > /dev/null
72108sudo apt-get autoremove -y > /dev/null
You can’t perform that action at this time.
0 commit comments