Updated sshd config

This commit is contained in:
Héctor Molinero Fernández
2019-10-13 13:13:58 +02:00
parent e75903fce6
commit 92da9e1612
2 changed files with 29 additions and 29 deletions

View File

@@ -1,29 +1,26 @@
Protocol 2 Protocol 2
HostKey /etc/ssh/ssh_host_ed25519_key HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_rsa_key
Port 3322
ListenAddress 0.0.0.0 ListenAddress 0.0.0.0
Port 3322
StrictModes yes UseDNS no
UsePAM yes UsePAM yes
X11Forwarding yes
X11UseLocalhost no
X11DisplayOffset 10
AllowTcpForwarding yes
PermitRootLogin no PermitRootLogin no
PermitEmptyPasswords no
PermitUserEnvironment no
PubkeyAuthentication yes PubkeyAuthentication yes
PasswordAuthentication yes PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no ChallengeResponseAuthentication no
TCPKeepAlive yes GSSAPIAuthentication no
LoginGraceTime 30 LoginGraceTime 30
ClientAliveInterval 300 TCPKeepAlive yes
ClientAliveCountMax 1 ClientAliveInterval 60
ClientAliveCountMax 5
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
PrintMotd no PrintMotd no
PrintLastLog yes PrintLastLog no
SyslogFacility AUTH SyslogFacility AUTH
LogLevel INFO LogLevel INFO

View File

@@ -45,8 +45,11 @@ if [ ! -f "${RANDFILE:?}" ]; then
fi fi
# Generate SSH keys if they do not exist # Generate SSH keys if they do not exist
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' >/dev/null
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N '' >/dev/null
fi fi
# Generate self-signed certificate # Generate self-signed certificate