2015-08-30 15:54:21 +02:00
|
|
|
# OpenSSH /etc/ssh/sshd_config. I am removing commented lines for this to
|
|
|
|
# be more clear and if they are missed some day, just download
|
|
|
|
# upstream config file or take it from any distribution.
|
2015-08-28 13:00:25 +02:00
|
|
|
|
|
|
|
Port 22
|
2015-08-30 15:54:21 +02:00
|
|
|
|
2015-08-28 13:00:25 +02:00
|
|
|
AddressFamily any
|
2014-12-27 10:09:00 +01:00
|
|
|
ListenAddress 0.0.0.0
|
2015-08-28 13:00:25 +02:00
|
|
|
ListenAddress ::
|
|
|
|
|
|
|
|
# The default requires explicit activation of protocol 1
|
2014-12-27 10:09:00 +01:00
|
|
|
Protocol 2
|
2015-08-28 13:00:25 +02:00
|
|
|
|
2014-12-27 10:09:00 +01:00
|
|
|
# HostKeys for protocol version 2
|
|
|
|
HostKey /etc/ssh/ssh_host_ed25519_key
|
2015-08-30 15:54:21 +02:00
|
|
|
HostKey /etc/ssh/ssh_host_rsa_key
|
2014-12-27 10:09:00 +01:00
|
|
|
|
|
|
|
## IF THE HOST KEYS ARE MISSING, RUN THE FOLLOWING AS ROOT:
|
|
|
|
# ssh-keygen -t ed25519 -N "" -f /etc/ssh/ssh_host_ed25519_key
|
2015-08-30 15:54:21 +02:00
|
|
|
# ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
|
2014-12-27 10:09:00 +01:00
|
|
|
|
2015-08-28 13:00:25 +02:00
|
|
|
# Uncomment one of the following depending on which OS
|
|
|
|
## Arch
|
2015-09-01 15:48:27 +02:00
|
|
|
Subsystem sftp /usr/lib/ssh/sftp-server
|
2015-08-28 13:00:25 +02:00
|
|
|
## Debian
|
|
|
|
#Subsystem sftp /usr/lib/openssh/sftp-server
|
2014-12-27 10:09:00 +01:00
|
|
|
|
|
|
|
# Logging
|
|
|
|
LogLevel VERBOSE
|
|
|
|
|
|
|
|
# Authentication:
|
2015-08-30 15:54:21 +02:00
|
|
|
PermitRootLogin No
|
2014-12-27 10:09:00 +01:00
|
|
|
|
2015-08-30 15:54:21 +02:00
|
|
|
# The default is to check both .ssh/authorized_keys and
|
|
|
|
# .ssh/authorized_keys2 but this is overridden so installations will only
|
|
|
|
# check .ssh/authorized_keys
|
2015-08-28 13:00:25 +02:00
|
|
|
AuthorizedKeysFile .ssh/authorized_keys
|
2014-12-27 10:09:00 +01:00
|
|
|
|
2015-08-30 15:54:21 +02:00
|
|
|
# Password based logins are disabled - only public key based logins are
|
|
|
|
# allowed.
|
|
|
|
AuthenticationMethods publickey
|
2014-12-27 10:09:00 +01:00
|
|
|
|
2015-08-30 15:54:21 +02:00
|
|
|
# Disable tunneled clear text passwords!
|
2014-12-27 10:09:00 +01:00
|
|
|
PasswordAuthentication no
|
2015-08-28 13:00:25 +02:00
|
|
|
|
2015-08-30 15:54:21 +02:00
|
|
|
# Disable s/key passwords
|
2015-08-28 13:00:25 +02:00
|
|
|
ChallengeResponseAuthentication no
|
2014-12-27 10:09:00 +01:00
|
|
|
|
|
|
|
# Set this to 'yes' to enable PAM authentication, account processing,
|
|
|
|
# and session processing. If this is enabled, PAM authentication will
|
|
|
|
# be allowed through the ChallengeResponseAuthentication and
|
|
|
|
# PasswordAuthentication. Depending on your PAM configuration,
|
|
|
|
# PAM authentication via ChallengeResponseAuthentication may bypass
|
|
|
|
# the setting of "PermitRootLogin without-password".
|
|
|
|
# If you just want the PAM account and session checks to run without
|
|
|
|
# PAM authentication, then enable this but set PasswordAuthentication
|
|
|
|
# and ChallengeResponseAuthentication to 'no'.
|
|
|
|
UsePAM yes
|
2015-08-28 13:00:25 +02:00
|
|
|
|
|
|
|
PrintMotd no # pam does that
|
|
|
|
UsePrivilegeSeparation sandbox # Default for new installations.
|
|
|
|
|
2015-08-28 18:25:18 +02:00
|
|
|
Banner /etc/issue.net
|