Skip to content

Commit 3319c5e

Browse files
committed
Comment jupyterhub-sftp's sshd config
- Remove commented out directives that did nothing - Remove opensshd pre-amble, we weren't using it - Remove the include of subconfig files, we don't use that
1 parent a610981 commit 3319c5e

File tree

1 file changed

+13
-49
lines changed

1 file changed

+13
-49
lines changed

jupyterhub-sftp/etc/ssh/sshd_config

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,40 @@
1-
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
2-
3-
# This is the sshd server system-wide configuration file. See
4-
# sshd_config(5) for more information.
5-
6-
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
7-
8-
# The strategy used for options in the default sshd_config shipped with
9-
# OpenSSH is to specify options with their default value where
10-
# possible, but leave them commented. Uncommented options override the
11-
# default value.
12-
13-
Include /etc/ssh/sshd_config.d/*.conf
14-
1+
# sshd still runs as root for chroot functionality, but
2+
# we listen on a non-privileged port anyway. This matches
3+
# the recommended port we expose in the helm chart.
154
Port 2222
16-
#AddressFamily any
17-
#ListenAddress 0.0.0.0
18-
#ListenAddress ::
195

206
# This file is assumed to be mounted to the Docker container
217
HostKey /etc/jupyterhub-sftp/config/hostKey
228

23-
# Ciphers and keying
24-
#RekeyLimit default none
25-
26-
# Logging
27-
#SyslogFacility AUTH
28-
#LogLevel INFO
29-
30-
# Authentication:
31-
32-
#LoginGraceTime 2m
33-
#PermitRootLogin prohibit-password
34-
#StrictModes yes
35-
#MaxAuthTries 6
36-
#MaxSessions 10
37-
389
# Only allow password auth, BECAUSE WE ARE EVIL HAHA
10+
# But also because users log in with their jupyterhub tokens
3911
PubkeyAuthentication no
40-
41-
# To disable tunneled clear text passwords, change to no here!
4212
PasswordAuthentication yes
13+
14+
# Passwords are jupyterhub Auth tokens, so they can't be empty
4315
PermitEmptyPasswords no
4416

45-
# Change to yes to enable challenge-response passwords (beware issues with
46-
# some PAM modules and threads)
17+
# FIXME: I'm not sure what to do with this one
4718
ChallengeResponseAuthentication no
4819

49-
# Set this to 'yes' to enable PAM authentication, account processing,
50-
# and session processing. If this is enabled, PAM authentication will
51-
# be allowed through the ChallengeResponseAuthentication and
52-
# PasswordAuthentication. Depending on your PAM configuration,
53-
# PAM authentication via ChallengeResponseAuthentication may bypass
54-
# the setting of "PermitRootLogin without-password".
55-
# If you just want the PAM account and session checks to run without
56-
# PAM authentication, then enable this but set PasswordAuthentication
57-
# and ChallengeResponseAuthentication to 'no'.
20+
# Our custom PAM module (pam_exec) calls jupyterhub-token-verify.py to
21+
# authenticate with a JupyterHub token.
5822
UsePAM yes
5923

60-
# We really only want sftp
24+
# Explicitly turn off all features of sshd we won't use
6125
AllowAgentForwarding No
6226
AllowTcpForwarding no
6327
GatewayPorts no
6428
X11Forwarding no
6529
PermitTTY no
6630
PrintMotd no
6731
PrintLastLog no
68-
TCPKeepAlive yes
6932
PermitUserEnvironment no
7033
PermitTunnel no
7134

72-
# no default banner path
73-
#Banner none
35+
# Use heartbeat packets to terminate 'stuck' connections
36+
# https://man.openbsd.org/sshd_config#TCPKeepAlive
37+
TCPKeepAlive yes
7438

7539
# Use the built-in internal-sftp setup, rather than shelling out to sftp-server
7640
Subsystem sftp internal-sftp

0 commit comments

Comments
 (0)