aboutsummaryrefslogtreecommitdiff
path: root/ssh-bastion/etc/ssh/sshd_config
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-bastion/etc/ssh/sshd_config')
-rw-r--r--ssh-bastion/etc/ssh/sshd_config101
1 files changed, 0 insertions, 101 deletions
diff --git a/ssh-bastion/etc/ssh/sshd_config b/ssh-bastion/etc/ssh/sshd_config
deleted file mode 100644
index fbe71c6..0000000
--- a/ssh-bastion/etc/ssh/sshd_config
+++ /dev/null
@@ -1,101 +0,0 @@
1# vim:set ft=sshdconfig
2
3HostKey /srv/ssh/hostkeys/rsa_key
4HostKey /srv/ssh/hostkeys/ed25519_key
5
6# By default SSH attempts to chdir to the logged-in user's home directory. The
7# vast majority of users won't have a home directory on the machine, so
8# suppress the warning with a chroot.
9ChrootDirectory /
10
11# No users will have home directories and all configs are under control of the
12# admin who mounts them from outside of this docker container so there is no
13# need to check modes and in-fact enabling this will cause failures.
14StrictModes no
15
16Protocol 2
17
18# Bind a port above 1024 so we can run ssh as an unpriviledged user
19Port 4321
20
21SyslogFacility AUTH
22LogLevel INFO
23PidFile /var/run/sshd.pid
24
25PubkeyAuthentication yes
26HostbasedAuthentication no
27IgnoreRhosts yes
28PasswordAuthentication no
29PermitEmptyPasswords no
30AuthorizedKeysFile /srv/ssh/users/%u/ssh
31
32UsePAM yes
33PermitRootLogin no
34ChallengeResponseAuthentication yes
35AuthenticationMethods publickey,keyboard-interactive:pam
36
37# Limit the number of authentication attemps per connection. SSH will log
38# failues once attempts reach half this number so this should also log all
39# authentication failures as well.
40PermitTTY no
41MaxAuthTries 2
42ForceCommand /usr/bin/nologin
43
44# This turns off reverse lookups of the originating host which hang sshd on DNS
45# timeouts when DNS is down. This also breaks "from=" lines in authorizd_keys
46# files which must be converted to dotted quad ip addrs.
47UseDNS no
48
49# By default SSH doesn't accept any environment variables from the client. But
50# we use this specific variable to pass robot user authentication tokens into
51# the system.
52AcceptEnv LANG LC_*
53
54# Disconnect after this period of time if the user hasn't provided a correct
55# password.
56LoginGraceTime 120
57
58# Disconnect dead sessions after 30 minutes of inactivity. The server will send
59# a keepalive every minutes and tolerate up to 30 failures before terminating
60# the session.
61ClientAliveInterval 60
62ClientAliveCountMax 30
63
64# Don't use TCP keepalives to prevent connections from dying when a temporary
65# routing issue occurs.
66TCPKeepAlive no
67
68# Allow up to 100 simultaneous unauthenticated connections. Any connections
69# beyond that limit will be dropped.
70MaxStartups 100
71
72# The maxiumum number of sessions which can be served on one multi-plexing
73# connection. ssh does not fail gracefully when this number is exceeded, so we
74# keep it high.
75MaxSessions 100
76
77X11Forwarding no
78PrintMotd no
79
80# Used hardened crypto algorithms
81#
82# Based on: https://stribika.github.io/2015/01/04/secure-secure-shell.html
83# And also: https://access.redhat.com/discussions/3121481
84# And also: https://infosec.mozilla.org/guidelines/openssh
85# Validated by: https://sshcheck.com/
86KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
87Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
88MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
89HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com
90# These may be needed for older ssh clients but use SHA1 so are discouraged
91#HostKeyAlgorithms ssh-rsa,ssh-rsa-cert-v01@openssh.com
92
93# Enable gateway ports for phone-home bastions so that administrators can
94# connect back to the forwarded ports without needing ssh access to the bastion
95# host itself. Also locks down what can be forwarded and to where.
96Match user phonehome
97 GatewayPorts yes
98 AuthenticationMethods publickey
99 AllowTcpForwarding remote
100 PermitOpen none
101Match all