-
Notifications
You must be signed in to change notification settings - Fork 1
/
sshd_config
84 lines (69 loc) · 3.64 KB
/
sshd_config
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#-----------------------------------------------------------------------------------------------------------------------------#
# Hardened SSH Configuration
#-----------------------------------------------------------------------------------------------------------------------------#
Port 22
AddressFamily inet
ListenAddress 0.0.0.0
#-----------------------------------------------------------------------------------------------------------------------------#
# Only use strong key exchange algorithms, cipers and MACs
#-----------------------------------------------------------------------------------------------------------------------------#
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTH
LogLevel VERBOSE
#-----------------------------------------------------------------------------------------------------------------------------#
# Login restrictions
#-----------------------------------------------------------------------------------------------------------------------------#
LoginGraceTime 30s
PermitRootLogin no
StrictModes yes
MaxAuthTries 3
MaxSessions 5
PasswordAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
HostbasedAuthentication no
IgnoreRhosts yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
AllowAgentForwarding no
AllowTcpForwarding no
GatewayPorts no
X11Forwarding no
PermitTTY yes
PrintMotd no
PrintLastLog no
#UsePrivilegeSeparation sandbox # As per documentation, this is considered depricated and turned on by default.
PermitUserEnvironment no
#-----------------------------------------------------------------------------------------------------------------------------#
# Enable compression
#-----------------------------------------------------------------------------------------------------------------------------#
Compression yes
ClientAliveInterval 600
ClientAliveCountMax 0
UseDNS no
PidFile /var/run/sshd.pid
MaxStartups 10:30:100
PermitTunnel no
#ChrootDirectory none
VersionAddendum none
#-----------------------------------------------------------------------------------------------------------------------------#
# Display a banner before authenticating to the system. Use your own /etc/issue.net file
#-----------------------------------------------------------------------------------------------------------------------------#
Banner /etc/issue.net
DebianBanner no
#-----------------------------------------------------------------------------------------------------------------------------#
# Allow client to pass locale environment variables
#-----------------------------------------------------------------------------------------------------------------------------#
AcceptEnv LANG LC_*
#-----------------------------------------------------------------------------------------------------------------------------#
# Override default of no subsystems
#-----------------------------------------------------------------------------------------------------------------------------#
Subsystem sftp /usr/lib/openssh/sftp-server
#-----------------------------------------------------------------------------------------------------------------------------#
# Allowing one or more system groups to login over SSH
#-----------------------------------------------------------------------------------------------------------------------------#
AllowGroups sshlogin